diff options
author | decebal <decebal.suiu@asf.ro> | 2016-07-01 13:41:58 +0300 |
---|---|---|
committer | decebal <decebal.suiu@asf.ro> | 2016-07-01 13:41:58 +0300 |
commit | f79c200c213296aced61e8ab128bc3face7450df (patch) | |
tree | 2fca9ad1a90d1cd8149f546e0f8877fe2cabbd1d | |
parent | 89b598cb9f874d6e95926b755f79721737fa0c43 (diff) | |
download | pf4j-f79c200c213296aced61e8ab128bc3face7450df.tar.gz pf4j-f79c200c213296aced61e8ab128bc3face7450df.zip |
Resolve #97 and keep #98 safe
-rw-r--r-- | pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java b/pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java index b0552f7..62dee84 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java @@ -85,16 +85,13 @@ public abstract class AbstractExtensionFinder implements ExtensionFinder, Plugin extensionWrapper.setExtensionFactory(pluginManager.getExtensionFactory()); result.add(extensionWrapper); log.debug("Added extension '{}' with ordinal {}", className, ordinal); - } else { - // it's too verbose the below block (uncomment if you are in trouble) - /* - log.warn("'{}' is not an extension for extension point '{}'", className, type.getName()); - ClassLoader classLoader1 = type.getClassLoader(); - ClassLoader classLoader2 = extensionClass.getClassLoader(); - if (!classLoader1.equals(classLoader2)) { - log.warn("Different class loaders: '{}' and '{}'", classLoader1, classLoader2); + } else if (log.isTraceEnabled()) { // an alternative may be the use of a system property + log.trace("'{}' is not an extension for extension point '{}'", className, type.getName()); + ClassLoader typeClassLoader = type.getClassLoader(); + ClassLoader extensionClassLoader = extensionClass.getClassLoader(); + if (!typeClassLoader.equals(extensionClassLoader)) { + log.trace("Different class loaders: '{}' and '{}'", typeClassLoader, extensionClassLoader); } - */ } } catch (ClassNotFoundException e) { log.error(e.getMessage(), e); |