From d1a7735b51d0357e1d8ec71cd3fb0065da30bbe0 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Sat, 22 Jan 2022 17:14:25 +0100 Subject: [PATCH] Makes sure manager classes cannot be instantiated or extended --- .../knarcraft/permissionsigns/manager/EconomyManager.java | 6 +++++- .../permissionsigns/manager/PermissionManager.java | 6 +++++- .../net/knarcraft/permissionsigns/manager/SignManager.java | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/knarcraft/permissionsigns/manager/EconomyManager.java b/src/main/java/net/knarcraft/permissionsigns/manager/EconomyManager.java index e5d690b..f0b88ac 100644 --- a/src/main/java/net/knarcraft/permissionsigns/manager/EconomyManager.java +++ b/src/main/java/net/knarcraft/permissionsigns/manager/EconomyManager.java @@ -7,10 +7,14 @@ import org.bukkit.entity.Player; /** * A manager that performs all Economy tasks */ -public class EconomyManager { +public final class EconomyManager { private static Economy economy; + private EconomyManager() { + + } + /** * Initializes the economy manager * diff --git a/src/main/java/net/knarcraft/permissionsigns/manager/PermissionManager.java b/src/main/java/net/knarcraft/permissionsigns/manager/PermissionManager.java index 3cb4429..aaac4f3 100644 --- a/src/main/java/net/knarcraft/permissionsigns/manager/PermissionManager.java +++ b/src/main/java/net/knarcraft/permissionsigns/manager/PermissionManager.java @@ -20,12 +20,16 @@ import java.util.logging.Level; /** * A manager that performs all Permission tasks */ -public class PermissionManager { +public final class PermissionManager { private static Permission permission; private static Queue temporaryPermissions = new PriorityBlockingQueue<>(); private static final File permissionsFile = new File(PermissionSigns.getInstance().getDataFolder(), "data.yml"); + private PermissionManager() { + + } + /** * Initializes the permission manager * diff --git a/src/main/java/net/knarcraft/permissionsigns/manager/SignManager.java b/src/main/java/net/knarcraft/permissionsigns/manager/SignManager.java index d8526c3..e1fa5f2 100644 --- a/src/main/java/net/knarcraft/permissionsigns/manager/SignManager.java +++ b/src/main/java/net/knarcraft/permissionsigns/manager/SignManager.java @@ -25,11 +25,15 @@ import java.util.logging.Level; /** * A manager for keeping track of known signs */ -public class SignManager { +public final class SignManager { private static Map managedSigns = new HashMap<>(); private static final File signsFile = new File(PermissionSigns.getInstance().getDataFolder(), "data.yml"); + private SignManager() { + + } + /** * Gets the permission sign at the given location *