Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wagyourtail committed Dec 21, 2023
1 parent 8382fa3 commit 462960e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

public final class ClasspathPluginClassLoader extends URLClassLoader {
private final ClasspathPluginLoader loader;
private final Map<String, Class<?>> classes = new HashMap();
private final Map<String, Class<?>> classes = new HashMap<>();
private final PluginDescriptionFile description;
private final File dataFolder;
private final Manifest manifest;
Expand Down Expand Up @@ -80,16 +80,11 @@ public final class ClasspathPluginClassLoader extends URLClassLoader {
@Override
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
synchronized (this.getClassLoadingLock(name)) {
// has the class loaded already?
Class<?> loadedClass = findLoadedClass(name);
if (loadedClass == null) {
try {
// find the class from given jar urls
loadedClass = findClass(name);
} catch (ClassNotFoundException e) {
// Hmmm... class does not exist in the given urls.
// Let's try finding it in our parent classloader.
// this'll throw ClassNotFoundException in failure.
loadedClass = super.loadClass(name, resolve);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import org.bukkit.event.server.PluginDisableEvent;
import org.bukkit.event.server.PluginEnableEvent;
import org.bukkit.plugin.*;
import org.bukkit.plugin.java.ClasspathPluginClassLoader;
import org.bukkit.plugin.java.JavaPlugin;
import org.yaml.snakeyaml.error.YAMLException;
import xyz.wagyourtail.unimined.cpl.SimplePluginManagerAccessor;

Expand Down Expand Up @@ -51,8 +49,8 @@ public List<Plugin> loadAll() {
}
List<Plugin> plugins = new ArrayList<>();

for (String group : pluginFolderGroups.split("::")) {
String[] files = group.split(":");
for (String group : pluginFolderGroups.split(File.pathSeparator + File.pathSeparator)) {
String[] files = group.split(File.pathSeparator);
File[] pluginFiles = new File[files.length];
for (int i = 0; i < files.length; i++) {
pluginFiles[i] = new File(files[i]);
Expand Down

0 comments on commit 462960e

Please sign in to comment.