Browse Source

Formatting

pull/197/head
Decebal Suiu 7 years ago
parent
commit
a78fe6d7e6
  1. 2
      demo/plugins/pom.xml
  2. 6
      pf4j/src/main/java/org/pf4j/AbstractPluginManager.java

2
demo/plugins/pom.xml

@ -17,6 +17,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.7</java.version> <java.version>1.7</java.version>
<!-- Override below properties in each plugin's pom.xml -->
<plugin.id/> <plugin.id/>
<plugin.class/> <plugin.class/>
<plugin.version/> <plugin.version/>

6
pf4j/src/main/java/org/pf4j/AbstractPluginManager.java

@ -525,27 +525,29 @@ public abstract class AbstractPluginManager implements PluginManager {
return pluginClassLoaders.get(pluginId); return pluginClassLoaders.get(pluginId);
} }
@SuppressWarnings("unchecked")
@Override @Override
public <T> List<Class<T>> getExtensionClasses(Class<T> type) { public <T> List<Class<T>> getExtensionClasses(Class<T> type) {
List<ExtensionWrapper<T>> extensionsWrapper = extensionFinder.find(type); List<ExtensionWrapper<T>> extensionsWrapper = extensionFinder.find(type);
List<Class<T>> extensionClasses = new ArrayList<>(extensionsWrapper.size()); List<Class<T>> extensionClasses = new ArrayList<>(extensionsWrapper.size());
for (ExtensionWrapper<T> extensionWrapper : extensionsWrapper) { 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); extensionClasses.add(c);
} }
return extensionClasses; return extensionClasses;
} }
@SuppressWarnings("unchecked")
@Override @Override
public <T> List<Class<T>> getExtensionClasses(Class<T> type, String pluginId) { public <T> List<Class<T>> getExtensionClasses(Class<T> type, String pluginId) {
List<ExtensionWrapper<T>> extensionsWrapper = extensionFinder.find(type, pluginId); List<ExtensionWrapper<T>> extensionsWrapper = extensionFinder.find(type, pluginId);
List<Class<T>> extensionClasses = new ArrayList<>(extensionsWrapper.size()); List<Class<T>> extensionClasses = new ArrayList<>(extensionsWrapper.size());
for (ExtensionWrapper<T> extensionWrapper : extensionsWrapper) { 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); extensionClasses.add(c);
} }
return extensionClasses; return extensionClasses;
} }

Loading…
Cancel
Save