Browse Source

Remove isExtensionPoint check in AbstractExtensionFinder so a Service from a ServiceProvider is seen as an extension point

pull/85/head
Decebal Suiu 9 years ago
parent
commit
6533d2258c
  1. 11
      pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java

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

@ -45,13 +45,6 @@ public abstract class AbstractExtensionFinder implements ExtensionFinder, Plugin
@Override
public <T> List<ExtensionWrapper<T>> find(Class<T> type) {
log.debug("Checking extension point '{}'", type.getName());
if (!isExtensionPoint(type)) {
log.warn("'{}' is not an extension point", type.getName());
return Collections.emptyList(); // or return null ?!
}
log.debug("Finding extensions for extension point '{}'", type.getName());
Map<String, Set<String>> entries = getEntries();
@ -133,10 +126,6 @@ public abstract class AbstractExtensionFinder implements ExtensionFinder, Plugin
return result;
}
private boolean isExtensionPoint(Class<?> type) {
return ExtensionPoint.class.isAssignableFrom(type);
}
private Map<String, Set<String>> getEntries() {
if (entries == null) {
entries = readStorages();

Loading…
Cancel
Save