diff --git a/.lift.toml b/.lift.toml new file mode 100644 index 000000000..e84745efc --- /dev/null +++ b/.lift.toml @@ -0,0 +1,4 @@ +jdkVersion = "17" +build = "gradle clean build -x test" +tools = ["findsecbugs", "ErrorProne", "Semgrep", "Detekt", "Infer"] +ignoreRules = ["CatchAndPrintStackTrace", "ReferenceEquality", "FallThrough", "FutureReturnValueIgnored", "MixedMutabilityReturnType", "EmptyCatch", "MissingCasesInEnumSwitch", "OperatorPrecedence", "StaticAssignmentInConstructor", "ReferenceEquality", "EqualsHashCode", "EqualsGetClass"] diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitCommand.java b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitCommand.java index 0a94a293b..ff85f806c 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitCommand.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitCommand.java @@ -63,7 +63,6 @@ public class BukkitCommand implements CommandExecutor, TabCompleter { return false; } - @SuppressWarnings("MixedMutabilityReturnType") @Override public List onTabComplete( CommandSender commandSender, Command command, String label, diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java index 2b8670d5b..7a7569f78 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java @@ -243,7 +243,6 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl return Bukkit.getVersion(); } - @SuppressWarnings("CatchAndPrintStackTrace") @Override public void onEnable() { this.pluginName = getDescription().getName(); @@ -563,7 +562,6 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl ServerLib.checkUnsafeForks(); } - @SuppressWarnings("CatchAndPrintStackTrace") private void unload() { if (!this.methodUnloadSetup) { this.methodUnloadSetup = true; @@ -649,7 +647,6 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl } } - @SuppressWarnings("FutureReturnValueIgnored") private void startUuidCaching( final @NonNull SQLiteUUIDService sqLiteUUIDService, final @NonNull CacheUUIDService cacheUUIDService @@ -750,7 +747,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl return Bukkit.getWorldContainer(); } - @SuppressWarnings({"deprecation", "CatchAndPrintStacktrace"}) + @SuppressWarnings("deprecation") private void runEntityTask() { TaskManager.runTaskRepeat(() -> this.plotAreaManager.forEachPlotArea(plotArea -> { final World world = Bukkit.getWorld(plotArea.getWorldName()); diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/entity/ReplicatingEntityWrapper.java b/Bukkit/src/main/java/com/plotsquared/bukkit/entity/ReplicatingEntityWrapper.java index 10aa20fbb..24ff4eec5 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/entity/ReplicatingEntityWrapper.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/entity/ReplicatingEntityWrapper.java @@ -461,7 +461,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper { this.tamed.tamed = tamed.isTamed(); } - @SuppressWarnings({"EmptyCatch", "deprecation"}) // Paper deprecation + @SuppressWarnings("deprecation") // Paper deprecation @Override public Entity spawn(World world, int xOffset, int zOffset) { Location location = new Location(world, this.getX() + xOffset, this.getY(), this.z + zOffset); diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/generator/BukkitPlotGenerator.java b/Bukkit/src/main/java/com/plotsquared/bukkit/generator/BukkitPlotGenerator.java index b5387fcbb..f5406ef9a 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/generator/BukkitPlotGenerator.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/generator/BukkitPlotGenerator.java @@ -108,7 +108,6 @@ public class BukkitPlotGenerator extends ChunkGenerator return this.platformGenerator; } - @SuppressWarnings("CatchAndPrintStackTrace") @Override public @NonNull List getDefaultPopulators(@NonNull World world) { try { @@ -154,7 +153,6 @@ public class BukkitPlotGenerator extends ChunkGenerator return toAdd; } - @SuppressWarnings("CatchAndPrintStackTrace") @Override public @NonNull ChunkData generateChunkData( @NonNull World world, @NonNull Random random, int x, int z, @@ -197,7 +195,6 @@ public class BukkitPlotGenerator extends ChunkGenerator return result.getChunkData(); } - @SuppressWarnings("CatchAndPrintStackTrace") private void generate(BlockVector2 loc, World world, ScopedQueueCoordinator result) { // Load if improperly loaded if (!this.loaded) { @@ -261,7 +258,6 @@ public class BukkitPlotGenerator extends ChunkGenerator } } - @SuppressWarnings({"EqualsHashCode", "EqualsGetClass"}) // Valid comparison @Override public boolean equals(final Object obj) { if (obj == null) { diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/generator/DelegatePlotGenerator.java b/Bukkit/src/main/java/com/plotsquared/bukkit/generator/DelegatePlotGenerator.java index 0dceeb0b1..93d60997b 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/generator/DelegatePlotGenerator.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/generator/DelegatePlotGenerator.java @@ -66,7 +66,6 @@ final class DelegatePlotGenerator extends IndependentPlotGenerator { return PlotSquared.platform().defaultGenerator().getNewPlotArea(world, id, min, max); } - @SuppressWarnings("EmptyCatch") @Override public void generateChunk(final ScopedQueueCoordinator result, PlotArea settings) { World world = BukkitUtil.getWorld(this.world); diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/inject/BukkitModule.java b/Bukkit/src/main/java/com/plotsquared/bukkit/inject/BukkitModule.java index 11408c275..8a1e917c6 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/inject/BukkitModule.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/inject/BukkitModule.java @@ -89,7 +89,6 @@ public class BukkitModule extends AbstractModule { this.bukkitPlatform = bukkitPlatform; } - @SuppressWarnings("CatchAndPrintStackTrace") @Override protected void configure() { bind(PlayerManager.class).to(BukkitPlayerManager.class); @@ -133,7 +132,6 @@ public class BukkitModule extends AbstractModule { install(new FactoryModuleBuilder().build(ChunkCoordinatorBuilderFactory.class)); } - @SuppressWarnings("EmptyCatch") @Provides @Singleton @NonNull EconHandler provideEconHandler() { diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/inject/PermissionModule.java b/Bukkit/src/main/java/com/plotsquared/bukkit/inject/PermissionModule.java index 0f7d527bf..2419fd227 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/inject/PermissionModule.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/inject/PermissionModule.java @@ -35,7 +35,6 @@ import org.bukkit.Bukkit; public class PermissionModule extends AbstractModule { - @SuppressWarnings("EmptyCatch") @Provides @Singleton PermissionHandler providePermissionHandler() { diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java index b9d65add9..66d92c502 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java @@ -203,7 +203,6 @@ public class BlockEventListener implements Listener { } } - @SuppressWarnings("MissingCasesInEnumSwitch") @EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST) public void onPhysicsEvent(BlockPhysicsEvent event) { Block block = event.getBlock(); @@ -426,7 +425,6 @@ public class BlockEventListener implements Listener { event.setCancelled(true); } - @SuppressWarnings("FallThrough") @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockSpread(BlockSpreadEvent event) { Block block = event.getBlock(); @@ -531,7 +529,6 @@ public class BlockEventListener implements Listener { } } - @SuppressWarnings("MissingCasesInEnumSwitch") @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockForm(BlockFormEvent event) { if (event instanceof EntityBlockFormEvent) { @@ -687,7 +684,6 @@ public class BlockEventListener implements Listener { event.setCancelled(true); } - @SuppressWarnings("MissingCaseesInEnumSwitch") @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onFade(BlockFadeEvent event) { Block block = event.getBlock(); @@ -1076,7 +1072,6 @@ public class BlockEventListener implements Listener { } - @SuppressWarnings("OperatorPrecedence") @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockIgnite(BlockIgniteEvent event) { Player player = event.getPlayer(); diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener117.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener117.java index e1b517ed9..301984b9c 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener117.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener117.java @@ -139,7 +139,6 @@ public class BlockEventListener117 implements Listener { } } - @SuppressWarnings("MissingCasesInEnumSwitch") @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockForm(BlockFormEvent event) { Block block = event.getBlock(); diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/ChunkListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/ChunkListener.java index adce8c1b3..95e35a076 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/ChunkListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/ChunkListener.java @@ -88,7 +88,6 @@ public class ChunkListener implements Listener { private boolean ignoreUnload = false; private boolean isTrueForNotSave = true; - @SuppressWarnings({"StaticAssignmentInConstructor", "CatchAndPrintStackTrace"}) @Inject public ChunkListener(final @NonNull PlotAreaManager plotAreaManager) { this.plotAreaManager = plotAreaManager; @@ -258,7 +257,6 @@ public class ChunkListener implements Listener { processChunk(event.getChunk(), false); } - @SuppressWarnings("FutureReturnValueIgnored") @EventHandler(priority = EventPriority.LOWEST) public void onItemSpawn(ItemSpawnEvent event) { Item entity = event.getEntity(); @@ -289,7 +287,6 @@ public class ChunkListener implements Listener { } } - @SuppressWarnings("FutureReturnValueIgnored") @EventHandler(priority = EventPriority.LOWEST) public void onEntitySpawn(CreatureSpawnEvent event) { LivingEntity entity = event.getEntity(); diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java index 466772a63..37a5c8e95 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java @@ -85,7 +85,6 @@ public class EntitySpawnListener implements Listener { test(entity); } - @SuppressWarnings("FutureReturnValueIgnored") public static void test(Entity entity) { @NonNull World world = entity.getWorld(); List meta = entity.getMetadata(KEY); @@ -122,7 +121,6 @@ public class EntitySpawnListener implements Listener { } } - @SuppressWarnings({"MissingCaseesInEnumSwitch", "FallThrough"}) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void creatureSpawnEvent(EntitySpawnEvent event) { Entity entity = event.getEntity(); diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PaperListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PaperListener.java index 06ab36ff7..012fee6ff 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PaperListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PaperListener.java @@ -83,7 +83,6 @@ public class PaperListener implements Listener { this.plotAreaManager = plotAreaManager; } - @SuppressWarnings("ReferenceEquality") @EventHandler public void onEntityPathfind(EntityPathfindEvent event) { if (!Settings.Paper_Components.ENTITY_PATHING) { @@ -118,7 +117,6 @@ public class PaperListener implements Listener { event.setCancelled(true); } - @SuppressWarnings("ReferenceEquality") @EventHandler public void onEntityPathfind(SlimePathfindEvent event) { if (!Settings.Paper_Components.ENTITY_PATHING) { @@ -161,7 +159,6 @@ public class PaperListener implements Listener { event.setCancelled(true); } - @SuppressWarnings({"MissingCasesInEnumSwitch", "FallThrough"}) @EventHandler public void onPreCreatureSpawnEvent(PreCreatureSpawnEvent event) { if (!Settings.Paper_Components.CREATURE_SPAWN) { @@ -366,7 +363,6 @@ public class PaperListener implements Listener { } } - @SuppressWarnings("EmptyCatch") @EventHandler public void onAsyncTabCompletion(final AsyncTabCompleteEvent event) { if (!Settings.Paper_Components.ASYNC_TAB_COMPLETION) { diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEventListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEventListener.java index 762031c9b..e88177b80 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEventListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEventListener.java @@ -430,7 +430,6 @@ public class PlayerEventListener extends PlotListener implements Listener { playerMove(event); } - @SuppressWarnings("FutureReturnValueIgnored") @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void vehicleMove(VehicleMoveEvent event) throws IllegalAccessException { @@ -808,7 +807,7 @@ public class PlayerEventListener extends PlotListener implements Listener { } } - @SuppressWarnings({"deprecation", "FallThrough"}) + @SuppressWarnings("deprecation") @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onInventoryClick(InventoryClickEvent event) { /*if (!event.isLeftClick() || (event.getAction() != InventoryAction.PLACE_ALL) || event diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/SingleWorldListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/SingleWorldListener.java index 96c6cc5d2..12ef2146e 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/SingleWorldListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/SingleWorldListener.java @@ -48,7 +48,6 @@ public class SingleWorldListener implements Listener { private final Method methodGetHandleChunk; private Field shouldSave; - @SuppressWarnings("CatchAndPrintStackTrace") public SingleWorldListener() throws Exception { ReflectionUtils.RefClass classCraftChunk = getRefClass("{cb}.CraftChunk"); this.methodGetHandleChunk = classCraftChunk.getMethod("getHandle").getRealMethod(); @@ -69,7 +68,6 @@ public class SingleWorldListener implements Listener { } } - @SuppressWarnings("CatchAndPrintStackTrace") public void markChunkAsClean(Chunk chunk) { try { Object nmsChunk = methodGetHandleChunk.invoke(chunk); diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/managers/BukkitWorldManager.java b/Bukkit/src/main/java/com/plotsquared/bukkit/managers/BukkitWorldManager.java index d81cd03da..fc73f54f4 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/managers/BukkitWorldManager.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/managers/BukkitWorldManager.java @@ -64,7 +64,6 @@ public class BukkitWorldManager implements PlatformWorldManager { return Bukkit.createWorld(wc); } - @SuppressWarnings("CatchAndPrintStackTrace") protected void setGenerator(final @Nullable String worldName, final @Nullable String generator) { if (generator == null) { return; diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java b/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java index 645fc787e..aae86f930 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java @@ -148,7 +148,6 @@ public class BukkitPlayer extends PlotPlayer { return true; } - @SuppressWarnings("CatchAndPrintStackTrace") private void callEvent(final @NonNull Event event) { final RegisteredListener[] listeners = event.getHandlers().getRegisteredListeners(); for (final RegisteredListener listener : listeners) { @@ -229,7 +228,6 @@ public class BukkitPlayer extends PlotPlayer { return max; } - @SuppressWarnings("FutureReturnValueIgnored") @Override public void teleport(final @NonNull Location location, final @NonNull TeleportCause cause) { if (Math.abs(location.getX()) >= 30000000 || Math.abs(location.getZ()) >= 30000000) { @@ -317,7 +315,6 @@ public class BukkitPlayer extends PlotPlayer { this.player.setAllowFlight(fly); } - @SuppressWarnings("ReferenceEquality") @Override public void playMusic(final @NonNull Location location, final @NonNull ItemType id) { if (id == ItemTypes.AIR) { @@ -341,7 +338,6 @@ public class BukkitPlayer extends PlotPlayer { this.player.kickPlayer(message); } - @SuppressWarnings("ReferenceEquality") @Override public void stopSpectating() { if (getGameMode() == SPECTATOR) { diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/queue/BukkitChunkCoordinator.java b/Bukkit/src/main/java/com/plotsquared/bukkit/queue/BukkitChunkCoordinator.java index cd7ed4036..e8416fab1 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/queue/BukkitChunkCoordinator.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/queue/BukkitChunkCoordinator.java @@ -193,7 +193,6 @@ public final class BukkitChunkCoordinator extends ChunkCoordinator { /** * Requests a batch of chunks to be loaded */ - @SuppressWarnings("FutureReturnValueIgnored") private void requestBatch() { BlockVector2 chunk; for (int i = 0; i < this.batchSize && (chunk = this.requestedChunks.poll()) != null; i++) { diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitEntityUtil.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitEntityUtil.java index f0c268771..bc79f2926 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitEntityUtil.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitEntityUtil.java @@ -337,7 +337,6 @@ public class BukkitEntityUtil { && !(victim instanceof Creature))); } - @SuppressWarnings("OperatorPrecedence") public static boolean checkEntity(Entity entity, Plot plot) { if (plot == null || !plot.hasOwner() || plot.getFlags().isEmpty() && plot.getArea() .getFlagContainer().getFlagMap().isEmpty()) { diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitRegionManager.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitRegionManager.java index cf9d398c1..2e78b7508 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitRegionManager.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitRegionManager.java @@ -94,7 +94,6 @@ public class BukkitRegionManager extends RegionManager { return false; } - @SuppressWarnings({"FutureReturnValueIgnored", "OperatorPrecedence"}) @Override public int[] countEntities(@NonNull Plot plot) { int[] existing = (int[]) plot.getMeta("EntityCount"); diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitSetupUtils.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitSetupUtils.java index 5ea299d15..1efd58a5c 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitSetupUtils.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitSetupUtils.java @@ -74,7 +74,6 @@ public class BukkitSetupUtils extends SetupUtils { this.worldFile = worldFile; } - @SuppressWarnings("CatchAndPrintStackTrace") @Override public void updateGenerators(final boolean force) { if (!SetupUtils.generators.isEmpty() && !force) { @@ -127,7 +126,6 @@ public class BukkitSetupUtils extends SetupUtils { }); } - @SuppressWarnings("CatchAndPrintStackTrace") @Override public String setupWorld(PlotAreaBuilder builder) { this.updateGenerators(false); diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java index c7a9fcc0b..3a46fbb7d 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java @@ -193,7 +193,6 @@ public class BukkitUtil extends WorldUtil { return Bukkit.getWorld(string); } - @SuppressWarnings("FutureReturnValueIgnored") private static void ensureLoaded( final @NonNull String world, final int x, @@ -204,7 +203,6 @@ public class BukkitUtil extends WorldUtil { .thenAccept(chunk -> ensureMainThread(chunkConsumer, chunk)); } - @SuppressWarnings("FutureReturnValueIgnored") private static void ensureLoaded(final @NonNull Location location, final @NonNull Consumer chunkConsumer) { PaperLib.getChunkAtAsync(adapt(location), true).thenAccept(chunk -> ensureMainThread(chunkConsumer, chunk)); } @@ -293,7 +291,6 @@ public class BukkitUtil extends WorldUtil { return bukkitWorld.getMaxHeight() - 1; } - @SuppressWarnings("CatchAndPrintStackTrace") @Override public @NonNull String[] getSignSynchronous(final @NonNull Location location) { Block block = Objects.requireNonNull(getWorld(location.getWorldName())).getBlockAt( @@ -573,7 +570,6 @@ public class BukkitUtil extends WorldUtil { getChunkAt(chunk.getBlockX(), chunk.getBlockZ()).getTileEntities().length; } - @SuppressWarnings("CatchAndPrintStackTrace") @Override public Set getChunkChunks(String world) { Set chunks = super.getChunkChunks(world); diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/EssentialsUUIDService.java b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/EssentialsUUIDService.java index bdcb27fd1..ac26c0f4a 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/EssentialsUUIDService.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/EssentialsUUIDService.java @@ -52,7 +52,6 @@ public class EssentialsUUIDService implements UUIDService { return Collections.emptyList(); } - @SuppressWarnings("EmptyCatch") @Override public @NonNull List getUUIDs(final @NonNull List usernames) { final List mappings = new ArrayList<>(usernames.size()); diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/LuckPermsUUIDService.java b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/LuckPermsUUIDService.java index 04b870883..21919002b 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/LuckPermsUUIDService.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/LuckPermsUUIDService.java @@ -53,7 +53,6 @@ public class LuckPermsUUIDService implements UUIDService { } } - @SuppressWarnings("EmptyCatch") @Override public @NonNull List getNames(final @NonNull List uuids) { final List mappings = new ArrayList<>(uuids.size()); @@ -70,7 +69,6 @@ public class LuckPermsUUIDService implements UUIDService { return mappings; } - @SuppressWarnings("EmptyCatch") @Override public @NonNull List getUUIDs(final @NonNull List usernames) { final List mappings = new ArrayList<>(usernames.size()); diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/OfflinePlayerUUIDService.java b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/OfflinePlayerUUIDService.java index 4b8917c17..9014e145c 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/OfflinePlayerUUIDService.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/OfflinePlayerUUIDService.java @@ -43,7 +43,6 @@ import java.util.UUID; */ public class OfflinePlayerUUIDService implements UUIDService { - @SuppressWarnings({"EmptyCatch", "MixedMutabilityReturnType"}) @Override public @NonNull List getNames(final @NonNull List uuids) { if (Settings.UUID.FORCE_LOWERCASE || Bukkit.getWorlds().isEmpty()) { diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/SQLiteUUIDService.java b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/SQLiteUUIDService.java index 9981ab130..3d56585ef 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/SQLiteUUIDService.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/SQLiteUUIDService.java @@ -49,7 +49,6 @@ public class SQLiteUUIDService implements UUIDService, Consumer getNames(final @NonNull List uuids) { final List mappings = new ArrayList<>(uuids.size()); @@ -93,7 +91,6 @@ public class SQLiteUUIDService implements UUIDService, Consumer getUUIDs(@NonNull List usernames) { final List mappings = new ArrayList<>(usernames.size()); @@ -116,7 +113,6 @@ public class SQLiteUUIDService implements UUIDService, Consumer uuidWrappers) { try (final PreparedStatement statement = getConnection() @@ -136,7 +132,6 @@ public class SQLiteUUIDService implements UUIDService, Consumer getAll() { final List mappings = new LinkedList<>(); try (final PreparedStatement statement = getConnection().prepareStatement("SELECT * FROM `usercache`")) { diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/SquirrelIdUUIDService.java b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/SquirrelIdUUIDService.java index e366b980c..e3a2e8c60 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/SquirrelIdUUIDService.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/SquirrelIdUUIDService.java @@ -67,7 +67,6 @@ public class SquirrelIdUUIDService implements UUIDService { this.rateLimiter = RateLimiter.create(rateLimit / 600.0D); } - @SuppressWarnings("CatchAndPrintStackTrace") @Override public @NonNull List getNames(final @NonNull List uuids) { final List results = new ArrayList<>(uuids.size()); @@ -103,7 +102,6 @@ public class SquirrelIdUUIDService implements UUIDService { return results; } - @SuppressWarnings("CatchAndPrintStackTrace") @Override public @NonNull List getUUIDs(final @NonNull List usernames) { final List results = new ArrayList<>(usernames.size());