Fix bad merge of SPIGOT-6502 fix

By: blablubbabc <lukas@wirsindwir.de>
This commit is contained in:
Bukkit/Spigot 2021-06-11 21:49:32 +10:00
parent 66524269f9
commit f034b5f0c2

View File

@ -116,8 +116,9 @@ final class PluginClassLoader extends URLClassLoader {
// This ignores the libraries of other plugins, unless they are transitive dependencies.
Class<?> result = loader.getClassByName(name, resolve, description);
if (result != null) {
// If the class was loaded from a library instead of a PluginClassLoader, we can assume that its associated plugin is a transitive dependency and can therefore skip this check.
if (result != null && result.getClassLoader() instanceof PluginClassLoader) {
if (result.getClassLoader() instanceof PluginClassLoader) {
PluginDescriptionFile provider = ((PluginClassLoader) result.getClassLoader()).description;
if (provider != description
@ -132,6 +133,7 @@ final class PluginClassLoader extends URLClassLoader {
loader.server.getLogger().log(Level.WARNING, "[{0}] Loaded class {1} from {2} which is not a depend, softdepend or loadbefore of this plugin.", new Object[]{description.getName(), name, provider.getFullName()});
}
}
}
return result;
}