Browse Source

fix a issue with PluginClassLoader and javax. package

pull/3/head
Decebal Suiu 12 years ago
parent
commit
16ff4a3173
  1. 7
      pf4j/src/main/java/ro/fortsoft/pf4j/PluginClassLoader.java

7
pf4j/src/main/java/ro/fortsoft/pf4j/PluginClassLoader.java

@ -23,8 +23,8 @@ import java.util.List;
*/ */
public class PluginClassLoader extends URLClassLoader { public class PluginClassLoader extends URLClassLoader {
private static final String JAVA_PACKAGE_PREFIX = "java."; // private static final String JAVA_PACKAGE_PREFIX = "java.";
private static final String JAVAX_PACKAGE_PREFIX = "javax."; // private static final String JAVAX_PACKAGE_PREFIX = "javax.";
private static final String PLUGIN_PACKAGE_PREFIX = "ro.fortsoft.pf4j."; private static final String PLUGIN_PACKAGE_PREFIX = "ro.fortsoft.pf4j.";
private PluginManager pluginManager; private PluginManager pluginManager;
@ -46,10 +46,13 @@ public class PluginClassLoader extends URLClassLoader {
public Class<?> loadClass(String className) throws ClassNotFoundException { public Class<?> loadClass(String className) throws ClassNotFoundException {
// System.out.println(">>>" + className); // System.out.println(">>>" + className);
/*
// javax.mail is not in JDK ?!
// first check whether it's a system class, delegate to the system loader // first check whether it's a system class, delegate to the system loader
if (className.startsWith(JAVA_PACKAGE_PREFIX) || className.startsWith(JAVAX_PACKAGE_PREFIX)) { if (className.startsWith(JAVA_PACKAGE_PREFIX) || className.startsWith(JAVAX_PACKAGE_PREFIX)) {
return findSystemClass(className); return findSystemClass(className);
} }
*/
// second check whether it's already been loaded // second check whether it's already been loaded
Class<?> loadedClass = findLoadedClass(className); Class<?> loadedClass = findLoadedClass(className);

Loading…
Cancel
Save