Add test fix for library classes being visible to non-dependent plugins

This commit is contained in:
md_5 2021-10-09 18:02:58 +11:00
parent 53ce6b93a2
commit 6613aaea95
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -63,7 +63,13 @@ final class PluginClassloader extends URLClassLoader
{ {
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 ( checkOther || result.getClassLoader() == this )
{
return result;
}
} catch ( ClassNotFoundException ex ) } catch ( ClassNotFoundException ex )
{ {
} }