mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-31 21:37:39 +01: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:
parent
24bab712b3
commit
2e1a3720cf
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user