Browse Source

Formatting

pull/197/head
Decebal Suiu 7 years ago
parent
commit
a78fe6d7e6
  1. 2
      demo/plugins/plugin1/pom.xml
  2. 2
      demo/plugins/plugin2/pom.xml
  3. 12
      demo/plugins/pom.xml
  4. 10
      pf4j/src/main/java/org/pf4j/AbstractPluginManager.java

2
demo/plugins/plugin1/pom.xml

@ -18,7 +18,7 @@
<plugin.class>org.pf4j.demo.welcome.WelcomePlugin</plugin.class> <plugin.class>org.pf4j.demo.welcome.WelcomePlugin</plugin.class>
<plugin.version>0.0.1</plugin.version> <plugin.version>0.0.1</plugin.version>
<plugin.provider>Decebal Suiu</plugin.provider> <plugin.provider>Decebal Suiu</plugin.provider>
<plugin.dependencies /> <plugin.dependencies/>
</properties> </properties>
<dependencies> <dependencies>

2
demo/plugins/plugin2/pom.xml

@ -18,7 +18,7 @@
<plugin.class>org.pf4j.demo.hello.HelloPlugin</plugin.class> <plugin.class>org.pf4j.demo.hello.HelloPlugin</plugin.class>
<plugin.version>0.0.1</plugin.version> <plugin.version>0.0.1</plugin.version>
<plugin.provider>Decebal Suiu</plugin.provider> <plugin.provider>Decebal Suiu</plugin.provider>
<plugin.dependencies /> <plugin.dependencies/>
</properties> </properties>
</project> </project>

12
demo/plugins/pom.xml

@ -17,11 +17,13 @@
<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>
<plugin.id />
<plugin.class /> <!-- Override below properties in each plugin's pom.xml -->
<plugin.version /> <plugin.id/>
<plugin.provider /> <plugin.class/>
<plugin.dependencies /> <plugin.version/>
<plugin.provider/>
<plugin.dependencies/>
</properties> </properties>
<build> <build>

10
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