mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-03 23:07:40 +01:00
Fix bad merge of SPIGOT-6502 fix
By: blablubbabc <lukas@wirsindwir.de>
This commit is contained in:
parent
66524269f9
commit
f034b5f0c2
@ -116,20 +116,22 @@ final class PluginClassLoader extends URLClassLoader {
|
|||||||
// This ignores the libraries of other plugins, unless they are transitive dependencies.
|
// This ignores the libraries of other plugins, unless they are transitive dependencies.
|
||||||
Class<?> result = loader.getClassByName(name, resolve, description);
|
Class<?> result = loader.getClassByName(name, resolve, description);
|
||||||
|
|
||||||
// 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) {
|
||||||
if (result != null && result.getClassLoader() instanceof PluginClassLoader) {
|
// 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.
|
||||||
PluginDescriptionFile provider = ((PluginClassLoader) result.getClassLoader()).description;
|
if (result.getClassLoader() instanceof PluginClassLoader) {
|
||||||
|
PluginDescriptionFile provider = ((PluginClassLoader) result.getClassLoader()).description;
|
||||||
|
|
||||||
if (provider != description
|
if (provider != description
|
||||||
&& !seenIllegalAccess.contains(provider.getName())
|
&& !seenIllegalAccess.contains(provider.getName())
|
||||||
&& !((SimplePluginManager) loader.server.getPluginManager()).isTransitiveDepend(description, provider)) {
|
&& !((SimplePluginManager) loader.server.getPluginManager()).isTransitiveDepend(description, provider)) {
|
||||||
|
|
||||||
seenIllegalAccess.add(provider.getName());
|
seenIllegalAccess.add(provider.getName());
|
||||||
if (plugin != null) {
|
if (plugin != null) {
|
||||||
plugin.getLogger().log(Level.WARNING, "Loaded class {0} from {1} which is not a depend, softdepend or loadbefore of this plugin.", new Object[]{name, provider.getFullName()});
|
plugin.getLogger().log(Level.WARNING, "Loaded class {0} from {1} which is not a depend, softdepend or loadbefore of this plugin.", new Object[]{name, provider.getFullName()});
|
||||||
} else {
|
} else {
|
||||||
// In case the bad access occurs on construction
|
// In case the bad access occurs on construction
|
||||||
loader.server.getLogger().log(Level.WARNING, "[{0}] Loaded class {1} from {2} which is not a depend, softdepend or loadbefore of this plugin.", new Object[]{description.getName(), name, provider.getFullName()});
|
loader.server.getLogger().log(Level.WARNING, "[{0}] Loaded class {1} from {2} which is not a depend, softdepend or loadbefore of this plugin.", new Object[]{description.getName(), name, provider.getFullName()});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user