mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-06-30 08:44:55 +02:00
Fixed two security issues from sonar
This commit is contained in:
parent
fa4c772572
commit
bbbe2565eb
|
@ -91,12 +91,12 @@ public class Flag implements Comparable<Flag> {
|
||||||
*/
|
*/
|
||||||
public Mode getNext() {
|
public Mode getNext() {
|
||||||
switch(this) {
|
switch(this) {
|
||||||
case ADVANCED:
|
case ADVANCED:
|
||||||
return EXPERT;
|
return EXPERT;
|
||||||
case BASIC:
|
case BASIC:
|
||||||
return ADVANCED;
|
return ADVANCED;
|
||||||
default:
|
default:
|
||||||
return BASIC;
|
return BASIC;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,12 +107,12 @@ public class Flag implements Comparable<Flag> {
|
||||||
*/
|
*/
|
||||||
public boolean isGreaterThan(Mode rank) {
|
public boolean isGreaterThan(Mode rank) {
|
||||||
switch(this) {
|
switch(this) {
|
||||||
case EXPERT:
|
case EXPERT:
|
||||||
return rank.equals(BASIC) || rank.equals(ADVANCED);
|
return rank.equals(BASIC) || rank.equals(ADVANCED);
|
||||||
case ADVANCED:
|
case ADVANCED:
|
||||||
return rank.equals(BASIC);
|
return rank.equals(BASIC);
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -478,7 +478,7 @@ public class Flag implements Comparable<Flag> {
|
||||||
private int cooldown;
|
private int cooldown;
|
||||||
|
|
||||||
// Mode
|
// Mode
|
||||||
public Mode mode = Mode.EXPERT;
|
private Mode mode = Mode.EXPERT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builder for making flags
|
* Builder for making flags
|
||||||
|
|
|
@ -42,7 +42,6 @@ public class ItemStackTypeAdapter extends TypeAdapter<ItemStack> {
|
||||||
c.loadFromString(reader.nextString());
|
c.loadFromString(reader.nextString());
|
||||||
return c.getItemStack("is");
|
return c.getItemStack("is");
|
||||||
} catch (InvalidConfigurationException e) {
|
} catch (InvalidConfigurationException e) {
|
||||||
e.printStackTrace();
|
|
||||||
throw new IOException(e.getMessage());
|
throw new IOException(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user