Fixed two security issues from sonar

This commit is contained in:
tastybento 2019-08-29 15:41:56 -07:00
parent fa4c772572
commit bbbe2565eb
2 changed files with 13 additions and 14 deletions

View File

@ -91,12 +91,12 @@ public class Flag implements Comparable<Flag> {
*/
public Mode getNext() {
switch(this) {
case ADVANCED:
return EXPERT;
case BASIC:
return ADVANCED;
default:
return BASIC;
case ADVANCED:
return EXPERT;
case BASIC:
return ADVANCED;
default:
return BASIC;
}
}
@ -107,12 +107,12 @@ public class Flag implements Comparable<Flag> {
*/
public boolean isGreaterThan(Mode rank) {
switch(this) {
case EXPERT:
return rank.equals(BASIC) || rank.equals(ADVANCED);
case ADVANCED:
return rank.equals(BASIC);
default:
return false;
case EXPERT:
return rank.equals(BASIC) || rank.equals(ADVANCED);
case ADVANCED:
return rank.equals(BASIC);
default:
return false;
}
}
}
@ -478,7 +478,7 @@ public class Flag implements Comparable<Flag> {
private int cooldown;
// Mode
public Mode mode = Mode.EXPERT;
private Mode mode = Mode.EXPERT;
/**
* Builder for making flags

View File

@ -42,7 +42,6 @@ public class ItemStackTypeAdapter extends TypeAdapter<ItemStack> {
c.loadFromString(reader.nextString());
return c.getItemStack("is");
} catch (InvalidConfigurationException e) {
e.printStackTrace();
throw new IOException(e.getMessage());
}
}