Fixed code smells

This commit is contained in:
Florian CUNY 2019-01-02 14:48:17 +01:00
parent c078d8dce6
commit 01b7ace0be
3 changed files with 20 additions and 20 deletions

View File

@ -10,7 +10,7 @@ import world.bentobox.bentobox.api.commands.ConfirmableCommand;
import world.bentobox.bentobox.api.user.User; import world.bentobox.bentobox.api.user.User;
/** /**
* Unlike {@link AdminClearresetsCommand}, this command will be removed. * @deprecated Unlike {@link AdminClearresetsCommand}, this command will be removed.
* We will be working on an alternative which will use {@link world.bentobox.bentobox.api.commands.admin.resets.AdminResetsResetCommand} instead. * We will be working on an alternative which will use {@link world.bentobox.bentobox.api.commands.admin.resets.AdminResetsResetCommand} instead.
*/ */
@Deprecated @Deprecated

View File

@ -118,7 +118,8 @@ public class ServerCompatibility {
if (version == null || version.getCompatibility().equals(Compatibility.INCOMPATIBLE)) { if (version == null || version.getCompatibility().equals(Compatibility.INCOMPATIBLE)) {
// 'Version = null' means that it's not listed. And therefore, it's implicitly incompatible. // 'Version = null' means that it's not listed. And therefore, it's implicitly incompatible.
return result = Compatibility.INCOMPATIBLE; result = Compatibility.INCOMPATIBLE;
return result;
} }
// Now, check the server software // Now, check the server software
@ -126,19 +127,23 @@ public class ServerCompatibility {
if (software == null || software.getCompatibility().equals(Compatibility.INCOMPATIBLE)) { if (software == null || software.getCompatibility().equals(Compatibility.INCOMPATIBLE)) {
// 'software = null' means that it's not listed. And therefore, it's implicitly incompatible. // 'software = null' means that it's not listed. And therefore, it's implicitly incompatible.
return result = Compatibility.INCOMPATIBLE; result = Compatibility.INCOMPATIBLE;
return result;
} }
if (software.getCompatibility().equals(Compatibility.NOT_SUPPORTED) || version.getCompatibility().equals(Compatibility.NOT_SUPPORTED)) { if (software.getCompatibility().equals(Compatibility.NOT_SUPPORTED) || version.getCompatibility().equals(Compatibility.NOT_SUPPORTED)) {
return result = Compatibility.NOT_SUPPORTED; result = Compatibility.NOT_SUPPORTED;
return result;
} }
if (software.getCompatibility().equals(Compatibility.SUPPORTED) || version.getCompatibility().equals(Compatibility.SUPPORTED)) { if (software.getCompatibility().equals(Compatibility.SUPPORTED) || version.getCompatibility().equals(Compatibility.SUPPORTED)) {
return result = Compatibility.SUPPORTED; result = Compatibility.SUPPORTED;
return result;
} }
// Nothing's wrong, the server is compatible. // Nothing's wrong, the server is compatible.
return result = Compatibility.COMPATIBLE; result = Compatibility.COMPATIBLE;
return result;
} }
return result; return result;

View File

@ -1,6 +1,3 @@
/**
*
*/
package world.bentobox.bentobox.api.localization; package world.bentobox.bentobox.api.localization;
import static org.junit.Assert.*; import static org.junit.Assert.*;
@ -10,21 +7,19 @@ import org.junit.Test;
/** /**
* Test class just to check that these constants don't accidentally change * Test class just to check that these constants don't accidentally change
* @author tastybento * @author tastybento
*
*/ */
public class TextVariablesTest { public class TextVariablesTest {
@Test @Test
public void test() { public void test() {
assertEquals("[name]", TextVariables.NAME); assertEquals(TextVariables.NAME, "[name]");
assertEquals("[description]", TextVariables.DESCRIPTION); assertEquals(TextVariables.DESCRIPTION, "[description]");
assertEquals("[number]", TextVariables.NUMBER); assertEquals(TextVariables.NUMBER, "[number]");
assertEquals("[rank]", TextVariables.RANK); assertEquals(TextVariables.RANK, "[rank]");
assertEquals("[label]", TextVariables.LABEL); assertEquals(TextVariables.LABEL, "[label]");
assertEquals("[permission]", TextVariables.PERMISSION); assertEquals(TextVariables.PERMISSION, "[permission]");
assertEquals("[spawn_here]", TextVariables.SPAWN_HERE); assertEquals(TextVariables.SPAWN_HERE, "[spawn_here]");
assertEquals("[version]", TextVariables.VERSION); assertEquals(TextVariables.VERSION, "[version]");
assertEquals("[start]", TextVariables.START_TEXT); assertEquals(TextVariables.START_TEXT, "[start]");
} }
} }