diff options
author | Decebal Suiu <decebal.suiu@gmail.com> | 2018-04-30 10:26:14 +0300 |
---|---|---|
committer | Decebal Suiu <decebal.suiu@gmail.com> | 2018-04-30 10:26:14 +0300 |
commit | f80bc959c133ea10edb38510e0f3a4580b9358ac (patch) | |
tree | bc3cd975005de9092f5d606773baa8e208993775 | |
parent | eb2d87ccb5aa6de521a7f0ffdc0792216b4c10f9 (diff) | |
download | pf4j-f80bc959c133ea10edb38510e0f3a4580b9358ac.tar.gz pf4j-f80bc959c133ea10edb38510e0f3a4580b9358ac.zip |
Formatting
-rw-r--r-- | pf4j/src/main/java/org/pf4j/AbstractExtensionFinder.java | 18 | ||||
-rw-r--r-- | pf4j/src/main/java/org/pf4j/DefaultExtensionFactory.java | 6 | ||||
-rw-r--r-- | pf4j/src/main/java/org/pf4j/ExtensionWrapper.java | 18 |
3 files changed, 21 insertions, 21 deletions
diff --git a/pf4j/src/main/java/org/pf4j/AbstractExtensionFinder.java b/pf4j/src/main/java/org/pf4j/AbstractExtensionFinder.java index 1f3851e..0159b2d 100644 --- a/pf4j/src/main/java/org/pf4j/AbstractExtensionFinder.java +++ b/pf4j/src/main/java/org/pf4j/AbstractExtensionFinder.java @@ -46,8 +46,8 @@ public abstract class AbstractExtensionFinder implements ExtensionFinder, Plugin @Override @SuppressWarnings("unchecked") - public <T> List<ExtensionWrapper<T>> find(Class<T> type) { - log.debug("Finding extensions of extension point '{}'", type.getName()); + public <T> List<ExtensionWrapper<T>> find(Class<T> type) { + log.debug("Finding extensions of extension point '{}'", type.getName()); Map<String, Set<String>> entries = getEntries(); List<ExtensionWrapper<T>> result = new ArrayList<>(); @@ -59,16 +59,16 @@ public abstract class AbstractExtensionFinder implements ExtensionFinder, Plugin } if (entries.isEmpty()) { - log.debug("No extensions found for extension point '{}'", type.getName()); + log.debug("No extensions found for extension point '{}'", type.getName()); } else { - log.debug("Found {} extensions for extension point '{}'", result.size(), type.getName()); + log.debug("Found {} extensions for extension point '{}'", result.size(), type.getName()); } // sort by "ordinal" property Collections.sort(result); - return result; - } + return result; + } @Override @SuppressWarnings("unchecked") @@ -129,11 +129,11 @@ public abstract class AbstractExtensionFinder implements ExtensionFinder, Plugin } @Override - public List<ExtensionWrapper> find(String pluginId) { + public List<ExtensionWrapper> find(String pluginId) { log.debug("Finding extensions from plugin '{}'", pluginId); List<ExtensionWrapper> result = new ArrayList<>(); - Set<String> classNames = findClassNames(pluginId); + Set<String> classNames = findClassNames(pluginId); if (classNames.isEmpty()) { return result; } @@ -182,7 +182,7 @@ public abstract class AbstractExtensionFinder implements ExtensionFinder, Plugin } @Override - public void pluginStateChanged(PluginStateEvent event) { + public void pluginStateChanged(PluginStateEvent event) { // TODO optimize (do only for some transitions) // clear cache entries = null; diff --git a/pf4j/src/main/java/org/pf4j/DefaultExtensionFactory.java b/pf4j/src/main/java/org/pf4j/DefaultExtensionFactory.java index a8c1fd1..bd67032 100644 --- a/pf4j/src/main/java/org/pf4j/DefaultExtensionFactory.java +++ b/pf4j/src/main/java/org/pf4j/DefaultExtensionFactory.java @@ -19,8 +19,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * The default implementation for ExtensionFactory. - * It uses Class.newInstance() method. + * The default implementation for {@link ExtensionFactory}. + * It uses {@link Class#newInstance} method. * * @author Decebal Suiu */ @@ -29,7 +29,7 @@ public class DefaultExtensionFactory implements ExtensionFactory { private static final Logger log = LoggerFactory.getLogger(DefaultExtensionFactory.class); /** - * Creates an extension instance. If an error occurs than that error is logged and the method returns null. + * Creates an extension instance. If an error occurs than that error is logged and the method returns {@code null}. * @param extensionClass * @return */ diff --git a/pf4j/src/main/java/org/pf4j/ExtensionWrapper.java b/pf4j/src/main/java/org/pf4j/ExtensionWrapper.java index 55a6aab..3899d5f 100644 --- a/pf4j/src/main/java/org/pf4j/ExtensionWrapper.java +++ b/pf4j/src/main/java/org/pf4j/ExtensionWrapper.java @@ -26,31 +26,31 @@ public class ExtensionWrapper<T> implements Comparable<ExtensionWrapper<T>> { private final ExtensionFactory extensionFactory; private T extension; // cache - public ExtensionWrapper(ExtensionDescriptor descriptor, ExtensionFactory extensionFactory) { + public ExtensionWrapper(ExtensionDescriptor descriptor, ExtensionFactory extensionFactory) { this.descriptor = descriptor; this.extensionFactory = extensionFactory; } - @SuppressWarnings("unchecked") + @SuppressWarnings("unchecked") public T getExtension() { if (extension == null) { extension = (T) extensionFactory.create(descriptor.extensionClass); } return extension; - } + } public ExtensionDescriptor getDescriptor() { return descriptor; } public int getOrdinal() { - return descriptor.ordinal; - } + return descriptor.ordinal; + } - @Override - public int compareTo(ExtensionWrapper<T> o) { - return (getOrdinal() - o.getOrdinal()); - } + @Override + public int compareTo(ExtensionWrapper<T> o) { + return (getOrdinal() - o.getOrdinal()); + } } |