diff --git a/src/main/java/world/bentobox/bentobox/api/panels/TabbedPanel.java b/src/main/java/world/bentobox/bentobox/api/panels/TabbedPanel.java index 95202c58d..b827a35fe 100644 --- a/src/main/java/world/bentobox/bentobox/api/panels/TabbedPanel.java +++ b/src/main/java/world/bentobox/bentobox/api/panels/TabbedPanel.java @@ -85,7 +85,7 @@ public class TabbedPanel extends Panel implements PanelListener { // Remove any tabs that have no items, if required if (tpb.isHideIfEmpty()) { - tpb.getTabs().values().removeIf(t -> !t.equals(tab) && !t.getPanelItems().stream().anyMatch(Objects::nonNull)); + tpb.getTabs().values().removeIf(t -> !t.equals(tab) && t.getPanelItems().stream().noneMatch(Objects::nonNull)); } // Set up the tabbed header diff --git a/src/main/java/world/bentobox/bentobox/database/json/JSONDatabaseHandler.java b/src/main/java/world/bentobox/bentobox/database/json/JSONDatabaseHandler.java index 318a38928..2a00d140d 100644 --- a/src/main/java/world/bentobox/bentobox/database/json/JSONDatabaseHandler.java +++ b/src/main/java/world/bentobox/bentobox/database/json/JSONDatabaseHandler.java @@ -62,8 +62,7 @@ public class JSONDatabaseHandler extends AbstractJSONDatabaseHandler { list.add(object); } else { plugin.logError("JSON file created a null object: " + file.getPath()); - // Required to keep OS file handlers low and not rely on GC NOSONAR - reader.close(); + reader.close(); // NOSONAR Required to keep OS file handlers low and not rely on GC } } catch (FileNotFoundException e) { plugin.logError("Could not load file '" + file.getName() + "': File not found."); diff --git a/src/main/java/world/bentobox/bentobox/managers/IslandDeletionManager.java b/src/main/java/world/bentobox/bentobox/managers/IslandDeletionManager.java index 64c92e9bf..127d32020 100644 --- a/src/main/java/world/bentobox/bentobox/managers/IslandDeletionManager.java +++ b/src/main/java/world/bentobox/bentobox/managers/IslandDeletionManager.java @@ -61,8 +61,6 @@ public class IslandDeletionManager implements Listener { } }); } - // Remove the islands from the database so they don't come back - //toBeRemoved.forEach(handler::deleteObject); } @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) diff --git a/src/main/java/world/bentobox/bentobox/panels/settings/SettingsTab.java b/src/main/java/world/bentobox/bentobox/panels/settings/SettingsTab.java index 63746b157..df4eb7b9f 100644 --- a/src/main/java/world/bentobox/bentobox/panels/settings/SettingsTab.java +++ b/src/main/java/world/bentobox/bentobox/panels/settings/SettingsTab.java @@ -36,7 +36,8 @@ import world.bentobox.bentobox.lists.Flags; */ public class SettingsTab implements Tab, ClickHandler { - protected static final String PROTECTION_PANEL = "protection.panel."; + private static final String PROTECTION_PANEL = "protection.panel."; + private static final String CLICK_TO_SWITCH = PROTECTION_PANEL + "mode.click-to-switch"; protected BentoBox plugin = BentoBox.getInstance(); protected Flag.Type type; protected User user; @@ -138,7 +139,7 @@ public class SettingsTab implements Tab, ClickHandler { icons.put(7, new PanelItemBuilder().icon(Material.GOLD_INGOT) .name(user.getTranslation(PROTECTION_PANEL + "mode.advanced.name")) .description(user.getTranslation(PROTECTION_PANEL + "mode.advanced.description"), "", - user.getTranslation(PROTECTION_PANEL + "mode.click-to-switch", + user.getTranslation(CLICK_TO_SWITCH, TextVariables.NEXT, user.getTranslation(PROTECTION_PANEL + "mode.expert.name"))) .clickHandler(this) .build()); @@ -147,7 +148,7 @@ public class SettingsTab implements Tab, ClickHandler { icons.put(7, new PanelItemBuilder().icon(Material.NETHER_BRICK) .name(user.getTranslation(PROTECTION_PANEL + "mode.expert.name")) .description(user.getTranslation(PROTECTION_PANEL + "mode.expert.description"), "", - user.getTranslation(PROTECTION_PANEL + "mode.click-to-switch", + user.getTranslation(CLICK_TO_SWITCH, TextVariables.NEXT, user.getTranslation(PROTECTION_PANEL + "mode.basic.name"))) .clickHandler(this) .build()); @@ -156,7 +157,7 @@ public class SettingsTab implements Tab, ClickHandler { icons.put(7, new PanelItemBuilder().icon(Material.IRON_INGOT) .name(user.getTranslation(PROTECTION_PANEL + "mode.basic.name")) .description(user.getTranslation(PROTECTION_PANEL + "mode.basic.description"), "", - user.getTranslation(PROTECTION_PANEL + "mode.click-to-switch", + user.getTranslation(CLICK_TO_SWITCH, TextVariables.NEXT, user.getTranslation(PROTECTION_PANEL + "mode.advanced.name"))) .clickHandler(this) .build());