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;
/**
* 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.
*/
@Deprecated

View File

@ -118,7 +118,8 @@ public class ServerCompatibility {
if (version == null || version.getCompatibility().equals(Compatibility.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
@ -126,19 +127,23 @@ public class ServerCompatibility {
if (software == null || software.getCompatibility().equals(Compatibility.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)) {
return result = Compatibility.NOT_SUPPORTED;
result = Compatibility.NOT_SUPPORTED;
return result;
}
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.
return result = Compatibility.COMPATIBLE;
result = Compatibility.COMPATIBLE;
return result;
}
return result;

View File

@ -1,6 +1,3 @@
/**
*
*/
package world.bentobox.bentobox.api.localization;
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
* @author tastybento
*
*/
public class TextVariablesTest {
@Test
public void test() {
assertEquals("[name]", TextVariables.NAME);
assertEquals("[description]", TextVariables.DESCRIPTION);
assertEquals("[number]", TextVariables.NUMBER);
assertEquals("[rank]", TextVariables.RANK);
assertEquals("[label]", TextVariables.LABEL);
assertEquals("[permission]", TextVariables.PERMISSION);
assertEquals("[spawn_here]", TextVariables.SPAWN_HERE);
assertEquals("[version]", TextVariables.VERSION);
assertEquals("[start]", TextVariables.START_TEXT);
assertEquals(TextVariables.NAME, "[name]");
assertEquals(TextVariables.DESCRIPTION, "[description]");
assertEquals(TextVariables.NUMBER, "[number]");
assertEquals(TextVariables.RANK, "[rank]");
assertEquals(TextVariables.LABEL, "[label]");
assertEquals(TextVariables.PERMISSION, "[permission]");
assertEquals(TextVariables.SPAWN_HERE, "[spawn_here]");
assertEquals(TextVariables.VERSION, "[version]");
assertEquals(TextVariables.START_TEXT, "[start]");
}
}