Browse Source

Fix #116

pull/121/head
Decebal Suiu 8 years ago
parent
commit
d98f23c208
  1. 8
      pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java
  2. 2
      pf4j/src/main/java/ro/fortsoft/pf4j/Extension.java

8
pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java

@ -50,12 +50,9 @@ public abstract class AbstractExtensionFinder implements ExtensionFinder, Plugin
Map<String, Set<String>> entries = getEntries(); Map<String, Set<String>> entries = getEntries();
List<ExtensionWrapper<T>> result = new ArrayList<>(); List<ExtensionWrapper<T>> result = new ArrayList<>();
// add extensions found in classpath // add extensions found in classpath and plugins
List<ExtensionWrapper<T>> classpathExtensions = find(type, null);
result.addAll(classpathExtensions);
// add extensions found in each plugin
for (String pluginId : entries.keySet()) { for (String pluginId : entries.keySet()) {
// classpath's extensions <=> pluginId = null
List<ExtensionWrapper<T>> pluginExtensions = find(type, pluginId); List<ExtensionWrapper<T>> pluginExtensions = find(type, pluginId);
result.addAll(pluginExtensions); result.addAll(pluginExtensions);
} }
@ -78,6 +75,7 @@ public abstract class AbstractExtensionFinder implements ExtensionFinder, Plugin
log.debug("Finding extensions of extension point '{}' for plugin '{}'", type.getName(), pluginId); log.debug("Finding extensions of extension point '{}' for plugin '{}'", type.getName(), pluginId);
List<ExtensionWrapper<T>> result = new ArrayList<>(); List<ExtensionWrapper<T>> result = new ArrayList<>();
// classpath's extensions <=> pluginId = null
Set<String> classNames = findClassNames(pluginId); Set<String> classNames = findClassNames(pluginId);
if (classNames.isEmpty()) { if (classNames.isEmpty()) {
return result; return result;

2
pf4j/src/main/java/ro/fortsoft/pf4j/Extension.java

@ -32,6 +32,6 @@ import java.lang.annotation.Target;
@Documented @Documented
public @interface Extension { public @interface Extension {
int ordinal() default 0; int ordinal() default 0;
} }

Loading…
Cancel
Save