mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 11:45:52 -07:00
SPIGOT-6749: Library Loader does not correctly isolate dependencies
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -101,7 +101,12 @@ final class PluginClassLoader extends URLClassLoader {
|
|||||||
|
|
||||||
Class<?> loadClass0(@NotNull String name, boolean resolve, boolean checkGlobal, boolean checkLibraries) throws ClassNotFoundException {
|
Class<?> loadClass0(@NotNull String name, boolean resolve, boolean checkGlobal, boolean checkLibraries) throws ClassNotFoundException {
|
||||||
try {
|
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) {
|
} catch (ClassNotFoundException ex) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user