mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-08 16:12:18 -07:00
SPIGOT-6502: Loading a class from a library of another plugin resulted in a ClassCastException.
By: blablubbabc <lukas@wirsindwir.de>
This commit is contained in:
@@ -113,9 +113,11 @@ final class PluginClassLoader extends URLClassLoader {
|
||||
}
|
||||
|
||||
if (checkGlobal) {
|
||||
// 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) {
|
||||
PluginDescriptionFile provider = ((PluginClassLoader) result.getClassLoader()).description;
|
||||
|
||||
if (provider != description
|
||||
|
Reference in New Issue
Block a user