From 50eaba9503f46b2e781816c87e267f305ff46953 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 9 Jun 2018 20:03:42 +0100 Subject: [PATCH] Cleanup last commit (Remember, always git diff!) Because the one time you don't... --- ...lose-Plugin-Class-Loaders-on-Disable.patch | 146 +----------------- 1 file changed, 1 insertion(+), 145 deletions(-) diff --git a/Spigot-API-Patches/Close-Plugin-Class-Loaders-on-Disable.patch b/Spigot-API-Patches/Close-Plugin-Class-Loaders-on-Disable.patch index ac9d0d6c6c..303813a99c 100644 --- a/Spigot-API-Patches/Close-Plugin-Class-Loaders-on-Disable.patch +++ b/Spigot-API-Patches/Close-Plugin-Class-Loaders-on-Disable.patch @@ -97,153 +97,9 @@ index bd0588a2..cb2b0b9c 100644 lookupNames.clear(); HandlerList.unregisterAll(); diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 40fd71dc..d2c538b2 100644 +index 40fd71dc..43ec5369 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -@@ -0,0 +0,0 @@ - package org.bukkit.plugin.java; - --import java.io.File; --import java.io.FileNotFoundException; --import java.io.IOException; --import java.io.InputStream; --import java.lang.reflect.InvocationTargetException; --import java.lang.reflect.Method; --import java.util.Arrays; --import java.util.HashMap; --import java.util.HashSet; --import java.util.List; --import java.util.Map; --import java.util.Set; --import java.util.concurrent.CopyOnWriteArrayList; --import java.util.jar.JarEntry; --import java.util.jar.JarFile; --import java.util.logging.Level; --import java.util.regex.Pattern; -- - import org.apache.commons.lang.Validate; - import org.bukkit.Server; - import org.bukkit.Warning; -@@ -0,0 +0,0 @@ import org.bukkit.Warning.WarningState; - import org.bukkit.configuration.serialization.ConfigurationSerializable; - import org.bukkit.configuration.serialization.ConfigurationSerialization; - import org.bukkit.event.Event; --import org.bukkit.event.EventException; - import org.bukkit.event.EventHandler; - import org.bukkit.event.Listener; - import org.bukkit.event.server.PluginDisableEvent; -@@ -0,0 +0,0 @@ import org.bukkit.plugin.TimedRegisteredListener; - import org.bukkit.plugin.UnknownDependencyException; - import org.yaml.snakeyaml.error.YAMLException; - -+import java.io.File; -+import java.io.FileNotFoundException; -+import java.io.IOException; -+import java.io.InputStream; -+import java.lang.reflect.Method; -+import java.util.Arrays; -+import java.util.HashMap; -+import java.util.HashSet; -+import java.util.List; -+import java.util.Map; -+import java.util.Set; -+import java.util.concurrent.CopyOnWriteArrayList; -+import java.util.jar.JarEntry; -+import java.util.jar.JarFile; -+import java.util.logging.Level; -+import java.util.regex.Pattern; -+ - /** - * Represents a Java plugin loader, allowing plugins in the form of .jar - */ - public final class JavaPluginLoader implements PluginLoader { - final Server server; -- private final Pattern[] fileFilters = new Pattern[] { Pattern.compile("\\.jar$"), }; -+ private final Pattern[] fileFilters = new Pattern[]{Pattern.compile("\\.jar$"),}; - private final Map> classes = new java.util.concurrent.ConcurrentHashMap>(); // Spigot - private final List loaders = new CopyOnWriteArrayList(); - - /** - * This class was not meant to be constructed explicitly -- * -+ * - * @param instance the server instance - */ - @Deprecated -@@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { - - final File parentFile = file.getParentFile(); - final File dataFolder = new File(parentFile, description.getName()); -- @SuppressWarnings("deprecation") -- final File oldDataFolder = new File(parentFile, description.getRawName()); -+ @SuppressWarnings("deprecation") final File oldDataFolder = new File(parentFile, description.getRawName()); - - // Found old data folder - if (dataFolder.equals(oldDataFolder)) { - // They are equal -- nothing needs to be done! - } else if (dataFolder.isDirectory() && oldDataFolder.isDirectory()) { - server.getLogger().warning(String.format( -- "While loading %s (%s) found old-data folder: `%s' next to the new one `%s'", -- description.getFullName(), -- file, -- oldDataFolder, -- dataFolder -+ "While loading %s (%s) found old-data folder: `%s' next to the new one `%s'", -+ description.getFullName(), -+ file, -+ oldDataFolder, -+ dataFolder - )); - } else if (oldDataFolder.isDirectory() && !dataFolder.exists()) { - if (!oldDataFolder.renameTo(dataFolder)) { - throw new InvalidPluginException("Unable to rename old data folder: `" + oldDataFolder + "' to: `" + dataFolder + "'"); - } - server.getLogger().log(Level.INFO, String.format( -- "While loading %s (%s) renamed data folder: `%s' to `%s'", -- description.getFullName(), -- file, -- oldDataFolder, -- dataFolder -+ "While loading %s (%s) renamed data folder: `%s' to `%s'", -+ description.getFullName(), -+ file, -+ oldDataFolder, -+ dataFolder - )); - } - - if (dataFolder.exists() && !dataFolder.isDirectory()) { - throw new InvalidPluginException(String.format( -- "Projected datafolder: `%s' for %s (%s) exists and is not a directory", -- dataFolder, -- description.getFullName(), -- file -+ "Projected datafolder: `%s' for %s (%s) exists and is not a directory", -+ dataFolder, -+ description.getFullName(), -+ file - )); - } - -@@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { - for (PluginClassLoader loader : loaders) { - try { - cachedClass = loader.findClass(name, false); -- } catch (ClassNotFoundException cnfe) {} -+ } catch (ClassNotFoundException cnfe) { -+ } - if (cachedClass != null) { - return cachedClass; - } -@@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { - Level.WARNING, - String.format( - "\"%s\" has registered a listener for %s on method \"%s\", but the event is Deprecated." + -- " \"%s\"; please notify the authors %s.", -+ " \"%s\"; please notify the authors %s.", - plugin.getDescription().getFullName(), - clazz.getName(), - method.toGenericString(), @@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { } catch (Throwable ex) { server.getLogger().log(Level.SEVERE, "Error occurred while enabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);