Reverted classloader changes by 1f0d89be27, now actually works! Again!

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
Bukkit/Spigot 2011-03-08 18:20:34 +00:00
parent bfad019c31
commit 97f4798d51

View file

@ -24,25 +24,17 @@ public class PluginClassLoader extends URLClassLoader {
Class<?> result = classes.get(name); Class<?> result = classes.get(name);
if (result == null) { if (result == null) {
ClassNotFoundException ex = null; result = loader.getClassByName(name);
try { if (result == null) {
result = super.findClass(name); result = super.findClass(name);
} catch (ClassNotFoundException e) {
ex = e; if (result != null) {
loader.setClass(name, result);
}
} }
if (result != null) { classes.put(name, result);
loader.setClass(name, result);
} else {
result = loader.getClassByName(name);
}
if (result != null ) {
classes.put(name, result);
} else {
throw ex;
}
} }
return result; return result;