refactor: Satisfy Semgrep

This commit is contained in:
NotMyFault 2021-12-22 02:06:07 +01:00
parent 3da1e9255a
commit af2613202d
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
2 changed files with 3 additions and 5 deletions

View File

@ -75,7 +75,7 @@ public class EntitySpawnListener implements Listener {
public static void testCreate(final Entity entity) {
@NonNull World world = entity.getWorld();
if (areaName == world.getName()) {
if (areaName.equals(world.getName())) {
} else {
areaName = world.getName();
hasPlotArea = PlotSquared.get().getPlotAreaManager().hasPlotArea(areaName);

View File

@ -286,15 +286,13 @@ public class StringMan {
}
public static boolean isEqualIgnoreCase(String a, String b) {
return (a == b) || ((a != null) && (b != null) && (a.length() == b.length()) && a
return (a.equals(b)) || ((a != null) && (b != null) && (a.length() == b.length()) && a
.equalsIgnoreCase(b));
}
public static String repeat(String s, int n) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < n; i++) {
sb.append(s);
}
sb.append(String.valueOf(s).repeat(Math.max(0, n)));
return sb.toString();
}