mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-13 19:25:49 -07:00
Be more resilient to asynchronous package loads like URLClassLoader
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -104,10 +104,16 @@ final class PluginClassLoader extends URLClassLoader {
|
||||
if (dot != -1) {
|
||||
String pkgName = name.substring(0, dot);
|
||||
if (getPackage(pkgName) == null) {
|
||||
if (manifest != null) {
|
||||
definePackage(pkgName, manifest, url);
|
||||
} else {
|
||||
definePackage(pkgName, null, null, null, null, null, null, null);
|
||||
try {
|
||||
if (manifest != null) {
|
||||
definePackage(pkgName, manifest, url);
|
||||
} else {
|
||||
definePackage(pkgName, null, null, null, null, null, null, null);
|
||||
}
|
||||
} catch (IllegalArgumentException ex) {
|
||||
if (getPackage(pkgName) == null) {
|
||||
throw new IllegalStateException("Cannot find package " + pkgName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user