SPIGOT-6749: Library Loader does not correctly isolate dependencies

This commit is contained in:
md_5 2021-10-13 08:12:16 +11:00
parent 6be36d3638
commit 9590b610cf
No known key found for this signature in database
GPG key ID: E8E901AC7C617C11

View file

@ -101,7 +101,12 @@ final class PluginClassLoader extends URLClassLoader {
Class<?> loadClass0(@NotNull String name, boolean resolve, boolean checkGlobal, boolean checkLibraries) throws ClassNotFoundException {
try {
return super.loadClass(name, resolve);
Class<?> result = super.loadClass(name, resolve);
// SPIGOT-6749: Library classes will appear in the above, but we don't want to return them to other plugins
if (checkGlobal || result.getClassLoader() == this) {
return result;
}
} catch (ClassNotFoundException ex) {
}