diff options
-rw-r--r-- | demo/plugins/plugin1/pom.xml | 2 | ||||
-rw-r--r-- | demo/plugins/plugin2/pom.xml | 2 | ||||
-rw-r--r-- | demo/plugins/pom.xml | 12 | ||||
-rw-r--r-- | pf4j/src/main/java/org/pf4j/AbstractPluginManager.java | 10 |
4 files changed, 15 insertions, 11 deletions
diff --git a/demo/plugins/plugin1/pom.xml b/demo/plugins/plugin1/pom.xml index 8c2f826..9fa107c 100644 --- a/demo/plugins/plugin1/pom.xml +++ b/demo/plugins/plugin1/pom.xml @@ -18,7 +18,7 @@ <plugin.class>org.pf4j.demo.welcome.WelcomePlugin</plugin.class> <plugin.version>0.0.1</plugin.version> <plugin.provider>Decebal Suiu</plugin.provider> - <plugin.dependencies /> + <plugin.dependencies/> </properties> <dependencies> diff --git a/demo/plugins/plugin2/pom.xml b/demo/plugins/plugin2/pom.xml index fb2d223..653f937 100644 --- a/demo/plugins/plugin2/pom.xml +++ b/demo/plugins/plugin2/pom.xml @@ -18,7 +18,7 @@ <plugin.class>org.pf4j.demo.hello.HelloPlugin</plugin.class> <plugin.version>0.0.1</plugin.version> <plugin.provider>Decebal Suiu</plugin.provider> - <plugin.dependencies /> + <plugin.dependencies/> </properties> </project> diff --git a/demo/plugins/pom.xml b/demo/plugins/pom.xml index 682ccfd..98162d7 100644 --- a/demo/plugins/pom.xml +++ b/demo/plugins/pom.xml @@ -17,11 +17,13 @@ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.7</java.version> - <plugin.id /> - <plugin.class /> - <plugin.version /> - <plugin.provider /> - <plugin.dependencies /> + + <!-- Override below properties in each plugin's pom.xml --> + <plugin.id/> + <plugin.class/> + <plugin.version/> + <plugin.provider/> + <plugin.dependencies/> </properties> <build> diff --git a/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java b/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java index 711d764..9f3471e 100644 --- a/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java +++ b/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java @@ -525,27 +525,29 @@ public abstract class AbstractPluginManager implements PluginManager { return pluginClassLoaders.get(pluginId); } + @SuppressWarnings("unchecked") @Override public <T> List<Class<T>> getExtensionClasses(Class<T> type) { List<ExtensionWrapper<T>> extensionsWrapper = extensionFinder.find(type); List<Class<T>> extensionClasses = new ArrayList<>(extensionsWrapper.size()); for (ExtensionWrapper<T> extensionWrapper : extensionsWrapper) { - @SuppressWarnings("unchecked") - Class<T> c = (Class<T>)extensionWrapper.getDescriptor().extensionClass; + Class<T> c = (Class<T>) extensionWrapper.getDescriptor().extensionClass; extensionClasses.add(c); } + return extensionClasses; } + @SuppressWarnings("unchecked") @Override public <T> List<Class<T>> getExtensionClasses(Class<T> type, String pluginId) { List<ExtensionWrapper<T>> extensionsWrapper = extensionFinder.find(type, pluginId); List<Class<T>> extensionClasses = new ArrayList<>(extensionsWrapper.size()); for (ExtensionWrapper<T> extensionWrapper : extensionsWrapper) { - @SuppressWarnings("unchecked") - Class<T> c = (Class<T>)extensionWrapper.getDescriptor().extensionClass; + Class<T> c = (Class<T>) extensionWrapper.getDescriptor().extensionClass; extensionClasses.add(c); } + return extensionClasses; } |