From a163a7457c0fd7a166d67e05b661847e494d7c11 Mon Sep 17 00:00:00 2001 From: Decebal Suiu Date: Sat, 2 Jul 2016 00:01:38 +0300 Subject: [PATCH] Remove class loaders checking --- .../ro/fortsoft/pf4j/AbstractExtensionFinder.java | 14 -------------- .../java/ro/fortsoft/pf4j/PluginClassLoader.java | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java b/pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java index 900ebb9..6d3180b 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java @@ -70,20 +70,6 @@ public abstract class AbstractExtensionFinder implements ExtensionFinder, Plugin ClassLoader classLoader = (pluginId != null) ? pluginManager.getPluginClassLoader(pluginId) : getClass().getClassLoader(); - // performs some check - if (log.isTraceEnabled()) { // an alternative may be the use of a system property - ClassLoader typeClassLoader = type.getClassLoader(); - if (!classLoader.equals(typeClassLoader)) - { - // in this scenario the method 'isAssignableFrom' returns only FALSE - // see http://www.coderanch.com/t/557846/java/java/FWIW-FYI-isAssignableFrom-isInstance-differing - log.error("Different class loaders: '{}' (E) and '{}' (EP)", classLoader, typeClassLoader); - - // below line is commented because I wish to see the next log.trace line -// continue; - } - } - for (String className : entry.getValue()) { try { log.debug("Loading class '{}' using class loader '{}'", className, classLoader); diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/PluginClassLoader.java b/pf4j/src/main/java/ro/fortsoft/pf4j/PluginClassLoader.java index 34259af..093623b 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/PluginClassLoader.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/PluginClassLoader.java @@ -90,7 +90,7 @@ public class PluginClassLoader extends URLClassLoader { } // look in dependencies - log.trace("Look in dependencies for class '{}'", className); + log.trace("Search in dependencies for class '{}'", className); List dependencies = pluginDescriptor.getDependencies(); for (PluginDependency dependency : dependencies) { PluginClassLoader classLoader = pluginManager.getPluginClassLoader(dependency.getPluginId());