]> source.dussan.org Git - pf4j.git/commitdiff
fix an issue that occurs when the plugin developer put the pf4j jar in the plugin...
authorDecebal Suiu <decebal.suiu@gmail.com>
Mon, 2 Jun 2014 13:05:30 +0000 (16:05 +0300)
committerDecebal Suiu <decebal.suiu@gmail.com>
Mon, 2 Jun 2014 13:05:30 +0000 (16:05 +0300)
pf4j/src/main/java/ro/fortsoft/pf4j/PluginClassLoader.java

index 557370353e86d248ccf0a476e1792789f6035d32..055c16357b5b9a7af2ad8a31b2e422ad74472575 100644 (file)
@@ -60,6 +60,15 @@ public class PluginClassLoader extends URLClassLoader {
                }
                */
 
+        // if the class it's a part of the plugin engine use parent class loader
+        if (className.startsWith(PLUGIN_PACKAGE_PREFIX)) {
+            try {
+                return PluginClassLoader.class.getClassLoader().loadClass(className);
+            } catch (ClassNotFoundException e) {
+                // try next step
+            }
+        }
+
         // second check whether it's already been loaded
         Class<?> loadedClass = findLoadedClass(className);
         if (loadedClass != null) {
@@ -73,15 +82,6 @@ public class PluginClassLoader extends URLClassLoader {
                // try next step
         }
 
-        // if the class it's a part of the plugin engine use parent class loader
-        if (className.startsWith(PLUGIN_PACKAGE_PREFIX)) {
-               try {
-                       return PluginClassLoader.class.getClassLoader().loadClass(className);
-               } catch (ClassNotFoundException e) {
-                       // try next step
-               }
-        }
-
         // look in dependencies
         List<PluginDependency> dependencies = pluginDescriptor.getDependencies();
         for (PluginDependency dependency : dependencies) {