summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/plugin/java/PluginClassLoader.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index 9fc6bd77..7e41e79a 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -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);
+ }
}
}
}