From f80bc959c133ea10edb38510e0f3a4580b9358ac Mon Sep 17 00:00:00 2001 From: Decebal Suiu Date: Mon, 30 Apr 2018 10:26:14 +0300 Subject: [PATCH] Formatting --- .../java/org/pf4j/AbstractExtensionFinder.java | 18 +++++++++--------- .../java/org/pf4j/DefaultExtensionFactory.java | 6 +++--- .../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 List> find(Class type) { - log.debug("Finding extensions of extension point '{}'", type.getName()); + public List> find(Class type) { + log.debug("Finding extensions of extension point '{}'", type.getName()); Map> entries = getEntries(); List> 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 find(String pluginId) { + public List find(String pluginId) { log.debug("Finding extensions from plugin '{}'", pluginId); List result = new ArrayList<>(); - Set classNames = findClassNames(pluginId); + Set 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 implements Comparable> { 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 o) { - return (getOrdinal() - o.getOrdinal()); - } + @Override + public int compareTo(ExtensionWrapper o) { + return (getOrdinal() - o.getOrdinal()); + } }