aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDecebal Suiu <decebal.suiu@gmail.com>2024-10-28 21:59:18 +0200
committerDecebal Suiu <decebal.suiu@gmail.com>2024-10-28 22:20:20 +0200
commit1493fd706b0215ee057cfc1952ecb09ee047f499 (patch)
tree82f2f38e90684ffe5b9ee479e37e311399c058e7
parenta401c18650b70e5c1a526db68be9cc575da726a6 (diff)
downloadpf4j-1493fd706b0215ee057cfc1952ecb09ee047f499.tar.gz
pf4j-1493fd706b0215ee057cfc1952ecb09ee047f499.zip
Solve #594
-rw-r--r--pf4j/src/main/java/org/pf4j/AbstractExtensionFinder.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/pf4j/src/main/java/org/pf4j/AbstractExtensionFinder.java b/pf4j/src/main/java/org/pf4j/AbstractExtensionFinder.java
index 980594c..59488ba 100644
--- a/pf4j/src/main/java/org/pf4j/AbstractExtensionFinder.java
+++ b/pf4j/src/main/java/org/pf4j/AbstractExtensionFinder.java
@@ -107,7 +107,7 @@ public abstract class AbstractExtensionFinder implements ExtensionFinder, Plugin
// If optional dependencies are used, the class loader might not be able
// to load the extension class because of missing optional dependencies.
//
- // Therefore we're extracting the extension annotation via asm, in order
+ // Therefore, we're extracting the extension annotation via asm, in order
// to extract the required plugins for an extension. Only if all required
// plugins are currently available and started, the corresponding
// extension is loaded through the class loader.
@@ -146,9 +146,7 @@ public abstract class AbstractExtensionFinder implements ExtensionFinder, Plugin
log.debug("Added extension '{}' with ordinal {}", className, extensionWrapper.getOrdinal());
} else {
log.trace("'{}' is not an extension for extension point '{}'", className, type.getName());
- if (RuntimeMode.DEVELOPMENT.equals(pluginManager.getRuntimeMode())) {
- checkDifferentClassLoaders(type, extensionClass);
- }
+ checkDifferentClassLoaders(type, extensionClass);
}
} catch (ClassNotFoundException | NoClassDefFoundError e) {
log.error(e.getMessage(), e);
@@ -375,7 +373,9 @@ public abstract class AbstractExtensionFinder implements ExtensionFinder, Plugin
ClassLoader typeClassLoader = type.getClassLoader(); // class loader of extension point
ClassLoader extensionClassLoader = extensionClass.getClassLoader();
boolean match = ClassUtils.getAllInterfacesNames(extensionClass).contains(type.getSimpleName());
- if (match && !extensionClassLoader.equals(typeClassLoader)) {
+ if (!match) {
+ log.error("Extension '{}' does not implement extension point '{}'", extensionClass, type);
+ } else if (!extensionClassLoader.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)", extensionClassLoader, typeClassLoader);