From 4851655110151f3bd586d883eb30d66d7025e2f1 Mon Sep 17 00:00:00 2001 From: Draycia Date: Mon, 10 Jun 2019 11:10:39 -0700 Subject: [PATCH] Make various things final --- .../java/me/clip/placeholderapi/PlaceholderListener.java | 2 +- .../java/me/clip/placeholderapi/ServerLoadEventListener.java | 2 +- .../clip/placeholderapi/commands/PlaceholderAPICommands.java | 4 ++-- .../placeholderapi/configuration/PlaceholderAPIConfig.java | 2 +- .../clip/placeholderapi/events/ExpansionRegisterEvent.java | 2 +- .../clip/placeholderapi/events/ExpansionUnregisterEvent.java | 2 +- .../placeholderapi/events/PlaceholderHookUnloadEvent.java | 4 ++-- .../me/clip/placeholderapi/expansion/ExpansionManager.java | 2 +- .../java/me/clip/placeholderapi/expansion/NMSVersion.java | 2 +- src/main/java/me/clip/placeholderapi/expansion/Version.java | 5 ++--- .../me/clip/placeholderapi/external/EZPlaceholderHook.java | 5 ++--- .../me/clip/placeholderapi/updatechecker/UpdateChecker.java | 5 +++-- 12 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/main/java/me/clip/placeholderapi/PlaceholderListener.java b/src/main/java/me/clip/placeholderapi/PlaceholderListener.java index 04cc1fb..050f02c 100644 --- a/src/main/java/me/clip/placeholderapi/PlaceholderListener.java +++ b/src/main/java/me/clip/placeholderapi/PlaceholderListener.java @@ -40,7 +40,7 @@ import org.bukkit.event.server.PluginDisableEvent; public class PlaceholderListener implements Listener { - private PlaceholderAPIPlugin plugin; + private final PlaceholderAPIPlugin plugin; public PlaceholderListener(PlaceholderAPIPlugin instance) { plugin = instance; diff --git a/src/main/java/me/clip/placeholderapi/ServerLoadEventListener.java b/src/main/java/me/clip/placeholderapi/ServerLoadEventListener.java index 71a9c5c..855cd92 100644 --- a/src/main/java/me/clip/placeholderapi/ServerLoadEventListener.java +++ b/src/main/java/me/clip/placeholderapi/ServerLoadEventListener.java @@ -9,7 +9,7 @@ import org.bukkit.event.server.ServerLoadEvent; public class ServerLoadEventListener implements Listener { - private PlaceholderAPIPlugin plugin; + private final PlaceholderAPIPlugin plugin; public ServerLoadEventListener(PlaceholderAPIPlugin instance) { plugin = instance; diff --git a/src/main/java/me/clip/placeholderapi/commands/PlaceholderAPICommands.java b/src/main/java/me/clip/placeholderapi/commands/PlaceholderAPICommands.java index 7ddf45a..969e98f 100644 --- a/src/main/java/me/clip/placeholderapi/commands/PlaceholderAPICommands.java +++ b/src/main/java/me/clip/placeholderapi/commands/PlaceholderAPICommands.java @@ -36,8 +36,8 @@ import org.bukkit.entity.Player; public class PlaceholderAPICommands implements CommandExecutor { - private PlaceholderAPIPlugin plugin; - private CommandExecutor eCloud; + private final PlaceholderAPIPlugin plugin; + private final CommandExecutor eCloud; public PlaceholderAPICommands(PlaceholderAPIPlugin i) { plugin = i; diff --git a/src/main/java/me/clip/placeholderapi/configuration/PlaceholderAPIConfig.java b/src/main/java/me/clip/placeholderapi/configuration/PlaceholderAPIConfig.java index a8cdd8d..8a27475 100644 --- a/src/main/java/me/clip/placeholderapi/configuration/PlaceholderAPIConfig.java +++ b/src/main/java/me/clip/placeholderapi/configuration/PlaceholderAPIConfig.java @@ -24,7 +24,7 @@ import me.clip.placeholderapi.PlaceholderAPIPlugin; public class PlaceholderAPIConfig { - private PlaceholderAPIPlugin plugin; + private final PlaceholderAPIPlugin plugin; public PlaceholderAPIConfig(PlaceholderAPIPlugin i) { plugin = i; diff --git a/src/main/java/me/clip/placeholderapi/events/ExpansionRegisterEvent.java b/src/main/java/me/clip/placeholderapi/events/ExpansionRegisterEvent.java index fc78a66..4e1ba54 100644 --- a/src/main/java/me/clip/placeholderapi/events/ExpansionRegisterEvent.java +++ b/src/main/java/me/clip/placeholderapi/events/ExpansionRegisterEvent.java @@ -27,7 +27,7 @@ import org.bukkit.event.HandlerList; public class ExpansionRegisterEvent extends Event { private static final HandlerList HANDLERS = new HandlerList(); - private PlaceholderExpansion expansion; + private final PlaceholderExpansion expansion; public ExpansionRegisterEvent(PlaceholderExpansion expansion) { this.expansion = expansion; diff --git a/src/main/java/me/clip/placeholderapi/events/ExpansionUnregisterEvent.java b/src/main/java/me/clip/placeholderapi/events/ExpansionUnregisterEvent.java index e5ba621..405f1bb 100644 --- a/src/main/java/me/clip/placeholderapi/events/ExpansionUnregisterEvent.java +++ b/src/main/java/me/clip/placeholderapi/events/ExpansionUnregisterEvent.java @@ -27,7 +27,7 @@ import org.bukkit.event.HandlerList; public class ExpansionUnregisterEvent extends Event { private static final HandlerList HANDLERS = new HandlerList(); - private PlaceholderExpansion expansion; + private final PlaceholderExpansion expansion; public ExpansionUnregisterEvent(PlaceholderExpansion expansion) { this.expansion = expansion; diff --git a/src/main/java/me/clip/placeholderapi/events/PlaceholderHookUnloadEvent.java b/src/main/java/me/clip/placeholderapi/events/PlaceholderHookUnloadEvent.java index 69ad53d..fb3d0cd 100644 --- a/src/main/java/me/clip/placeholderapi/events/PlaceholderHookUnloadEvent.java +++ b/src/main/java/me/clip/placeholderapi/events/PlaceholderHookUnloadEvent.java @@ -28,8 +28,8 @@ import org.bukkit.event.HandlerList; public class PlaceholderHookUnloadEvent extends Event { private static final HandlerList HANDLERS = new HandlerList(); - private String plugin; - private PlaceholderHook hook; + private final String plugin; + private final PlaceholderHook hook; public PlaceholderHookUnloadEvent(String plugin, PlaceholderHook placeholderHook) { this.plugin = plugin; diff --git a/src/main/java/me/clip/placeholderapi/expansion/ExpansionManager.java b/src/main/java/me/clip/placeholderapi/expansion/ExpansionManager.java index e1499a4..1915dfa 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/ExpansionManager.java +++ b/src/main/java/me/clip/placeholderapi/expansion/ExpansionManager.java @@ -36,7 +36,7 @@ import java.util.Map; import java.util.Map.Entry; public final class ExpansionManager { - private PlaceholderAPIPlugin plugin; + private final PlaceholderAPIPlugin plugin; public ExpansionManager(PlaceholderAPIPlugin instance) { plugin = instance; diff --git a/src/main/java/me/clip/placeholderapi/expansion/NMSVersion.java b/src/main/java/me/clip/placeholderapi/expansion/NMSVersion.java index 21d6856..1e739e2 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/NMSVersion.java +++ b/src/main/java/me/clip/placeholderapi/expansion/NMSVersion.java @@ -39,7 +39,7 @@ public enum NMSVersion { SPIGOT_1_13_R2("v1_13_R2"), SPIGOT_1_14_R1("v1_14_R1"); - private String version; + private final String version; NMSVersion(String version) { this.version = version; diff --git a/src/main/java/me/clip/placeholderapi/expansion/Version.java b/src/main/java/me/clip/placeholderapi/expansion/Version.java index 3b04676..f8c0dbf 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/Version.java +++ b/src/main/java/me/clip/placeholderapi/expansion/Version.java @@ -22,9 +22,8 @@ package me.clip.placeholderapi.expansion; public final class Version { - private boolean isSpigot; - - private String version; + private final boolean isSpigot; + private final String version; public Version(String version, boolean isSpigot) { this.version = version; diff --git a/src/main/java/me/clip/placeholderapi/external/EZPlaceholderHook.java b/src/main/java/me/clip/placeholderapi/external/EZPlaceholderHook.java index 097e13e..d22891f 100644 --- a/src/main/java/me/clip/placeholderapi/external/EZPlaceholderHook.java +++ b/src/main/java/me/clip/placeholderapi/external/EZPlaceholderHook.java @@ -28,9 +28,8 @@ import org.bukkit.plugin.Plugin; @Deprecated public abstract class EZPlaceholderHook extends PlaceholderHook { - private String identifier; - - private String plugin; + private final String identifier; + private final String plugin; public EZPlaceholderHook(Plugin plugin, String identifier) { Validate.notNull(plugin, "Plugin can not be null!"); diff --git a/src/main/java/me/clip/placeholderapi/updatechecker/UpdateChecker.java b/src/main/java/me/clip/placeholderapi/updatechecker/UpdateChecker.java index 0325bb7..04fdfdd 100644 --- a/src/main/java/me/clip/placeholderapi/updatechecker/UpdateChecker.java +++ b/src/main/java/me/clip/placeholderapi/updatechecker/UpdateChecker.java @@ -15,8 +15,9 @@ import org.bukkit.event.player.PlayerJoinEvent; public class UpdateChecker implements Listener { private final int RESOURCE_ID = 6245; - private PlaceholderAPIPlugin plugin; - private String spigotVersion, pluginVersion; + private final PlaceholderAPIPlugin plugin; + private String spigotVersion; + private final String pluginVersion; private boolean updateAvailable; public UpdateChecker(PlaceholderAPIPlugin i) {