Cleanup last commit (Remember, always git diff!)

Because the one time you don't...
This commit is contained in:
Shane Freeder 2018-06-09 20:03:42 +01:00
parent 6812a948db
commit 50eaba9503

View file

@ -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<String, Class<?>> classes = new java.util.concurrent.ConcurrentHashMap<String, Class<?>>(); // Spigot
private final List<PluginClassLoader> loaders = new CopyOnWriteArrayList<PluginClassLoader>();
/**
* 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);