blueprint: final parameters 08/56908/4
authorStephen Kitt <skitt@redhat.com>
Thu, 11 May 2017 15:42:46 +0000 (17:42 +0200)
committerRobert Varga <nite@hq.sk>
Sat, 29 Jul 2017 14:42:29 +0000 (14:42 +0000)
This automatically-generated patch flags all appropriate parameters as
final (including caught exceptions).

Change-Id: I565047abcceb31a3da2ef8b2ebdee857e6623196
Signed-off-by: Stephen Kitt <skitt@redhat.com>
18 files changed:
opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/BlueprintBundleTracker.java
opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/BlueprintContainerRestartServiceImpl.java
opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/AbstractDependentComponentFactoryMetadata.java
opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/AbstractInvokableServiceMetadata.java
opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/ActionProviderBean.java
opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/BindingContext.java
opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/ComponentProcessor.java
opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/ConfigXMLReaderException.java
opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/DataStoreAppConfigDefaultXMLReader.java
opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/DataStoreAppConfigMetadata.java
opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/MandatoryServiceReferenceMetadata.java
opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/NotificationListenerBean.java
opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/RoutedRpcMetadata.java
opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/RoutedRpcRegistrationConverter.java
opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/RpcImplementationBean.java
opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/SpecificReferenceListMetadata.java
opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/StaticReferenceMetadata.java
opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/StaticServiceReferenceRecipe.java

index 404d78ac83c942e89eada582f123244039fb5a3a..bc84526d76b852033b5725adad05555f119e85f4 100644 (file)
@@ -71,7 +71,7 @@ public class BlueprintBundleTracker implements BundleActivator, BundleTrackerCus
      * Implemented from BundleActivator.
      */
     @Override
-    public void start(BundleContext context) {
+    public void start(final BundleContext context) {
         LOG.info("Starting {}", getClass().getSimpleName());
 
         restartService = new BlueprintContainerRestartServiceImpl();
@@ -88,7 +88,7 @@ public class BlueprintBundleTracker implements BundleActivator, BundleTrackerCus
                 new ServiceTrackerCustomizer<BlueprintExtenderService, BlueprintExtenderService>() {
                     @Override
                     public BlueprintExtenderService addingService(
-                            ServiceReference<BlueprintExtenderService> reference) {
+                            final ServiceReference<BlueprintExtenderService> reference) {
                         blueprintExtenderService = reference.getBundle().getBundleContext().getService(reference);
                         bundleTracker.open();
 
@@ -105,13 +105,13 @@ public class BlueprintBundleTracker implements BundleActivator, BundleTrackerCus
                     }
 
                     @Override
-                    public void modifiedService(ServiceReference<BlueprintExtenderService> reference,
-                            BlueprintExtenderService service) {
+                    public void modifiedService(final ServiceReference<BlueprintExtenderService> reference,
+                            final BlueprintExtenderService service) {
                     }
 
                     @Override
-                    public void removedService(ServiceReference<BlueprintExtenderService> reference,
-                            BlueprintExtenderService service) {
+                    public void removedService(final ServiceReference<BlueprintExtenderService> reference,
+                            final BlueprintExtenderService service) {
                     }
                 });
         blueprintExtenderServiceTracker.open();
@@ -120,7 +120,7 @@ public class BlueprintBundleTracker implements BundleActivator, BundleTrackerCus
                 new ServiceTrackerCustomizer<QuiesceParticipant, QuiesceParticipant>() {
                     @Override
                     public QuiesceParticipant addingService(
-                            ServiceReference<QuiesceParticipant> reference) {
+                            final ServiceReference<QuiesceParticipant> reference) {
                         quiesceParticipant = reference.getBundle().getBundleContext().getService(reference);
 
                         LOG.debug("Got QuiesceParticipant");
@@ -131,26 +131,26 @@ public class BlueprintBundleTracker implements BundleActivator, BundleTrackerCus
                     }
 
                     @Override
-                    public void modifiedService(ServiceReference<QuiesceParticipant> reference,
-                                                QuiesceParticipant service) {
+                    public void modifiedService(final ServiceReference<QuiesceParticipant> reference,
+                                                final QuiesceParticipant service) {
                     }
 
                     @Override
-                    public void removedService(ServiceReference<QuiesceParticipant> reference,
-                                               QuiesceParticipant service) {
+                    public void removedService(final ServiceReference<QuiesceParticipant> reference,
+                                               final QuiesceParticipant service) {
                     }
                 });
         quiesceParticipantTracker.open();
     }
 
-    private void registerNamespaceHandler(BundleContext context) {
+    private void registerNamespaceHandler(final BundleContext context) {
         Dictionary<String, Object> props = new Hashtable<>();
         props.put("osgi.service.blueprint.namespace", OpendaylightNamespaceHandler.NAMESPACE_1_0_0);
         namespaceReg = context.registerService(NamespaceHandler.class.getName(),
                 new OpendaylightNamespaceHandler(), props);
     }
 
-    private void registerBlueprintEventHandler(BundleContext context) {
+    private void registerBlueprintEventHandler(final BundleContext context) {
         Dictionary<String, Object> props = new Hashtable<>();
         props.put(org.osgi.service.event.EventConstants.EVENT_TOPIC,
                 new String[]{EventConstants.TOPIC_CREATED, EventConstants.TOPIC_FAILURE});
@@ -161,7 +161,7 @@ public class BlueprintBundleTracker implements BundleActivator, BundleTrackerCus
      * Implemented from BundleActivator.
      */
     @Override
-    public void stop(BundleContext context) {
+    public void stop(final BundleContext context) {
         bundleTracker.close();
         blueprintExtenderServiceTracker.close();
         quiesceParticipantTracker.close();
@@ -175,7 +175,7 @@ public class BlueprintBundleTracker implements BundleActivator, BundleTrackerCus
      * Implemented from SynchronousBundleListener.
      */
     @Override
-    public void bundleChanged(BundleEvent event) {
+    public void bundleChanged(final BundleEvent event) {
         // If the system bundle (id 0) is stopping, do an orderly shutdown of all blueprint containers. On
         // shutdown the system bundle is stopped first.
         if (event.getBundle().getBundleId() == SYSTEM_BUNDLE_ID && event.getType() == BundleEvent.STOPPING) {
@@ -187,7 +187,7 @@ public class BlueprintBundleTracker implements BundleActivator, BundleTrackerCus
      * Implemented from BundleActivator.
      */
     @Override
-    public Bundle addingBundle(Bundle bundle, BundleEvent event) {
+    public Bundle addingBundle(final Bundle bundle, final BundleEvent event) {
         modifiedBundle(bundle, event, bundle);
         return bundle;
     }
@@ -196,7 +196,7 @@ public class BlueprintBundleTracker implements BundleActivator, BundleTrackerCus
      * Implemented from BundleTrackerCustomizer.
      */
     @Override
-    public void modifiedBundle(Bundle bundle, BundleEvent event, Bundle object) {
+    public void modifiedBundle(final Bundle bundle, final BundleEvent event, final Bundle object) {
         if (shuttingDown) {
             return;
         }
@@ -216,7 +216,7 @@ public class BlueprintBundleTracker implements BundleActivator, BundleTrackerCus
      * Implemented from BundleTrackerCustomizer.
      */
     @Override
-    public void removedBundle(Bundle bundle, BundleEvent event, Bundle object) {
+    public void removedBundle(final Bundle bundle, final BundleEvent event, final Bundle object) {
         // BlueprintExtenderService will handle this.
     }
 
@@ -226,7 +226,7 @@ public class BlueprintBundleTracker implements BundleActivator, BundleTrackerCus
      * @param event the event to handle
      */
     @Override
-    public void handleEvent(Event event) {
+    public void handleEvent(final Event event) {
         if (EventConstants.TOPIC_CREATED.equals(event.getTopic())) {
             LOG.info("Blueprint container for bundle {} was successfully created",
                     event.getProperty(EventConstants.BUNDLE));
@@ -250,7 +250,7 @@ public class BlueprintBundleTracker implements BundleActivator, BundleTrackerCus
     }
 
     @SuppressWarnings({ "rawtypes", "unchecked" })
-    static List<Object> findBlueprintPaths(Bundle bundle) {
+    static List<Object> findBlueprintPaths(final Bundle bundle) {
         Enumeration<?> rntries = bundle.findEntries(BLUEPRINT_FILE_PATH, BLUEPRINT_FLE_PATTERN, false);
         if (rntries == null) {
             return Collections.emptyList();
@@ -288,7 +288,7 @@ public class BlueprintBundleTracker implements BundleActivator, BundleTrackerCus
         LOG.info("Shutdown of blueprint containers complete");
     }
 
-    private List<Bundle> getBundlesToDestroy(Collection<Bundle> containerBundles) {
+    private List<Bundle> getBundlesToDestroy(final Collection<Bundle> containerBundles) {
         List<Bundle> bundlesToDestroy = new ArrayList<>();
 
         // Find all container bundles that either have no registered services or whose services are no
@@ -356,12 +356,12 @@ public class BlueprintBundleTracker implements BundleActivator, BundleTrackerCus
         return bundlesToDestroy;
     }
 
-    private static int getServiceUsage(ServiceReference<?> ref) {
+    private static int getServiceUsage(final ServiceReference<?> ref) {
         Bundle[] usingBundles = ref.getUsingBundles();
         return usingBundles != null ? usingBundles.length : 0;
     }
 
-    private <T> T getOSGiService(Class<T> serviceInterface) {
+    private <T> T getOSGiService(final Class<T> serviceInterface) {
         try {
             ServiceReference<T> serviceReference = bundleContext.getServiceReference(serviceInterface);
             if (serviceReference == null) {
@@ -376,7 +376,7 @@ public class BlueprintBundleTracker implements BundleActivator, BundleTrackerCus
             }
 
             return service;
-        } catch (IllegalStateException e) {
+        } catch (final IllegalStateException e) {
             // This is thrown if the BundleContext is no longer valid which is possible on shutdown so we
             // log as debug.
             LOG.debug("Error obtaining OSGi service {}", serviceInterface.getSimpleName(), e);
index 7985c5bce00e2090016986394bc17287033b866e..4448c44287890c8fd2d785465bbb7b7749828044 100644 (file)
@@ -111,7 +111,7 @@ class BlueprintContainerRestartServiceImpl implements AutoCloseable, BlueprintCo
         restartExecutor.execute(() -> restartContainerAndDependentsInternal(bundle));
     }
 
-    private void restartContainerAndDependentsInternal(Bundle forBundle) {
+    private void restartContainerAndDependentsInternal(final Bundle forBundle) {
         Preconditions.checkNotNull(blueprintExtenderService);
         Preconditions.checkNotNull(quiesceParticipant);
 
@@ -151,7 +151,7 @@ class BlueprintContainerRestartServiceImpl implements AutoCloseable, BlueprintCo
                         containerBundles, containerBundles.size() - containerCreationComplete.getCount());
                 return;
             }
-        } catch (InterruptedException e) {
+        } catch (final InterruptedException e) {
             LOG.debug("CountDownLatch await was interrupted - returning");
             return;
         }
@@ -208,7 +208,7 @@ class BlueprintContainerRestartServiceImpl implements AutoCloseable, BlueprintCo
         }, Collections.singletonList(nextBundle));
     }
 
-    private void createContainers(List<Bundle> containerBundles) {
+    private void createContainers(final List<Bundle> containerBundles) {
         containerBundles.forEach(bundle -> {
             List<Object> paths = BlueprintBundleTracker.findBlueprintPaths(bundle);
 
@@ -218,7 +218,7 @@ class BlueprintContainerRestartServiceImpl implements AutoCloseable, BlueprintCo
         });
     }
 
-    private void restartConfigModules(BundleContext bundleContext, List<Entry<String,
+    private void restartConfigModules(final BundleContext bundleContext, final List<Entry<String,
             ModuleIdentifier>> configModules) {
         if (configModules.isEmpty()) {
             return;
@@ -249,8 +249,8 @@ class BlueprintContainerRestartServiceImpl implements AutoCloseable, BlueprintCo
 
     }
 
-    private void restartConfigModules(List<Entry<String, ModuleIdentifier>> configModules,
-            ConfigSubsystemFacade configFacade) throws ParserConfigurationException, DocumentedException,
+    private void restartConfigModules(final List<Entry<String, ModuleIdentifier>> configModules,
+            final ConfigSubsystemFacade configFacade) throws ParserConfigurationException, DocumentedException,
                     ValidationException, ConflictingVersionException {
 
         Document document = XmlUtil.newDocument();
@@ -274,7 +274,7 @@ class BlueprintContainerRestartServiceImpl implements AutoCloseable, BlueprintCo
                 Element moduleElement = configMapping.moduleToXml(moduleNamespace, moduleId.getFactoryName(),
                         moduleId.getInstanceName(), instanceON, document);
                 modulesElement.appendChild(moduleElement);
-            } catch (InstanceNotFoundException e) {
+            } catch (final InstanceNotFoundException e) {
                 LOG.warn("Error looking up config module: namespace {}, module name {}, instance {}",
                         moduleNamespace, moduleId.getFactoryName(), moduleId.getInstanceName(), e);
             }
@@ -300,8 +300,8 @@ class BlueprintContainerRestartServiceImpl implements AutoCloseable, BlueprintCo
      * @param containerBundles the current set of bundles containing blueprint containers
      * @param configModules the current set of bundles containing config modules
      */
-    private void findDependentContainersRecursively(Bundle bundle, Set<Bundle> containerBundles,
-            List<Entry<String, ModuleIdentifier>> configModules) {
+    private void findDependentContainersRecursively(final Bundle bundle, final Set<Bundle> containerBundles,
+            final List<Entry<String, ModuleIdentifier>> configModules) {
         if (!containerBundles.add(bundle)) {
             // Already seen this bundle...
             return;
@@ -324,8 +324,8 @@ class BlueprintContainerRestartServiceImpl implements AutoCloseable, BlueprintCo
         }
     }
 
-    private void possiblyAddConfigModuleIdentifier(ServiceReference<?> reference,
-            List<Entry<String, ModuleIdentifier>> configModules) {
+    private void possiblyAddConfigModuleIdentifier(final ServiceReference<?> reference,
+            final List<Entry<String, ModuleIdentifier>> configModules) {
         Object moduleNamespace = reference.getProperty(CONFIG_MODULE_NAMESPACE_PROP);
         if (moduleNamespace == null) {
             return;
@@ -347,8 +347,8 @@ class BlueprintContainerRestartServiceImpl implements AutoCloseable, BlueprintCo
     }
 
     @Nullable
-    private String getRequiredConfigModuleProperty(String propName, Object moduleNamespace,
-            ServiceReference<?> reference) {
+    private String getRequiredConfigModuleProperty(final String propName, final Object moduleNamespace,
+            final ServiceReference<?> reference) {
         Object value = reference.getProperty(propName);
         if (value == null) {
             LOG.warn(
@@ -360,7 +360,7 @@ class BlueprintContainerRestartServiceImpl implements AutoCloseable, BlueprintCo
         return value.toString();
     }
 
-    private ServiceRegistration<?> registerEventHandler(BundleContext bundleContext, EventHandler handler) {
+    private ServiceRegistration<?> registerEventHandler(final BundleContext bundleContext, final EventHandler handler) {
         Dictionary<String, Object> props = new Hashtable<>();
         props.put(org.osgi.service.event.EventConstants.EVENT_TOPIC,
                 new String[]{EventConstants.TOPIC_CREATED, EventConstants.TOPIC_FAILURE});
index 9bd51a460aa40ad7205e53a2eeffbdea7d058747..81b374d9fa43420af3a4f2fa670e702d0280d314 100644 (file)
@@ -239,7 +239,7 @@ abstract class AbstractDependentComponentFactoryMetadata implements DependentCom
             }
 
             return service;
-        } catch (IllegalStateException e) {
+        } catch (final IllegalStateException e) {
             // This is thrown if the BundleContext is no longer valid which is possible on shutdown so we
             // log as debug.
             log.debug("{}: Error obtaining {}", logName(), serviceInterface.getSimpleName(), e);
index 1c1f4cb8139ef9a4855d0a52a3a3759b44cab118..7f8afe64eb9da35f740f62bf3b5faee0bfa3640b 100644 (file)
@@ -51,7 +51,7 @@ abstract class AbstractInvokableServiceMetadata extends AbstractDependentCompone
         final Class<?> interfaceClass;
         try {
             interfaceClass = container().getBundleContext().getBundle().loadClass(interfaceName);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new ComponentDefinitionException(String.format("%s: Error obtaining interface class %s",
                     logName(), interfaceName), e);
         }
@@ -136,7 +136,7 @@ abstract class AbstractInvokableServiceMetadata extends AbstractDependentCompone
             log.debug("{}: create returning service {}", logName(), rpcService);
 
             return rpcService;
-        } catch (RuntimeException e) {
+        } catch (final RuntimeException e) {
             throw new ComponentDefinitionException("Error getting RPC service for " + interfaceName, e);
         }
     }
index 104571504e1afad816a2fa563a72b3160e2adac3..8c5b2b29b0d945ac63d2178b73ab058d2c86be52 100644 (file)
@@ -93,7 +93,7 @@ public class ActionProviderBean {
         if (reg != null) {
             try {
                 reg.close();
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 LOG.warn("{}: error while unregistering", ACTION_PROVIDER, e);
             } finally {
                 reg = null;
@@ -107,7 +107,7 @@ public class ActionProviderBean {
 
         try {
             iface = bundle.loadClass(interfaceName);
-        } catch (ClassNotFoundException e) {
+        } catch (final ClassNotFoundException e) {
             throw new ComponentDefinitionException(String.format(
                 "The specified \"interface\" for %s \"%s\" does not refer to an available class", interfaceName,
                 ACTION_PROVIDER), e);
index 91899301aa6879c3ce82a390b7757d7546540ba5..e4ae3fc0ef54fadfbdff03cb0fc9bf7b1214842a 100644 (file)
@@ -34,8 +34,8 @@ import org.w3c.dom.Element;
  */
 public abstract class BindingContext {
 
-    public static BindingContext create(String logName, Class<? extends DataObject> klass,
-            String appConfigListKeyValue) {
+    public static BindingContext create(final String logName, final Class<? extends DataObject> klass,
+            final String appConfigListKeyValue) {
         if (Identifiable.class.isAssignableFrom(klass)) {
             // The binding class corresponds to a yang list.
             if (Strings.isNullOrEmpty(appConfigListKeyValue)) {
index 14b3c2b849f64c6d9c63db0b588a11bec5cdeb5f..97f2fd2b0c92f8bbf59f15d900f8601fd17fc07e 100644 (file)
@@ -47,19 +47,19 @@ public class ComponentProcessor implements ComponentDefinitionRegistryProcessor
     private boolean restartDependentsOnUpdates;
     private boolean useDefaultForReferenceTypes;
 
-    public void setBundle(Bundle bundle) {
+    public void setBundle(final Bundle bundle) {
         this.bundle = bundle;
     }
 
-    public void setBlueprintContainerRestartService(BlueprintContainerRestartService restartService) {
+    public void setBlueprintContainerRestartService(final BlueprintContainerRestartService restartService) {
         this.blueprintContainerRestartService = restartService;
     }
 
-    public void setRestartDependentsOnUpdates(boolean restartDependentsOnUpdates) {
+    public void setRestartDependentsOnUpdates(final boolean restartDependentsOnUpdates) {
         this.restartDependentsOnUpdates = restartDependentsOnUpdates;
     }
 
-    public void setUseDefaultForReferenceTypes(boolean useDefaultForReferenceTypes) {
+    public void setUseDefaultForReferenceTypes(final boolean useDefaultForReferenceTypes) {
         this.useDefaultForReferenceTypes = useDefaultForReferenceTypes;
     }
 
@@ -70,7 +70,7 @@ public class ComponentProcessor implements ComponentDefinitionRegistryProcessor
     }
 
     @Override
-    public void process(ComponentDefinitionRegistry registry) {
+    public void process(final ComponentDefinitionRegistry registry) {
         LOG.debug("{}: In process",  logName());
 
         for (String name : registry.getComponentDefinitionNames()) {
@@ -83,7 +83,7 @@ public class ComponentProcessor implements ComponentDefinitionRegistryProcessor
         }
     }
 
-    private void processServiceReferenceMetadata(MutableServiceReferenceMetadata serviceRef) {
+    private void processServiceReferenceMetadata(final MutableServiceReferenceMetadata serviceRef) {
         if (!useDefaultForReferenceTypes) {
             return;
         }
@@ -103,7 +103,7 @@ public class ComponentProcessor implements ComponentDefinitionRegistryProcessor
         }
     }
 
-    private void processMutableBeanMetadata(MutableBeanMetadata bean) {
+    private void processMutableBeanMetadata(final MutableBeanMetadata bean) {
         if (restartDependentsOnUpdates && bean.getRuntimeClass() != null
                 && AbstractPropertyPlaceholder.class.isAssignableFrom(bean.getRuntimeClass())) {
             LOG.debug("{}: Found PropertyPlaceholder bean: {}, runtime {}", logName(), bean.getId(),
@@ -136,7 +136,7 @@ public class ComponentProcessor implements ComponentDefinitionRegistryProcessor
             private volatile boolean initialUpdate = true;
 
             @Override
-            public void updated(Dictionary<String, ?> properties) {
+            public void updated(final Dictionary<String, ?> properties) {
                 LOG.debug("{}: ManagedService updated for persistentId {}, properties: {}, initialUpdate: {}",
                         logName(), persistentId, properties, initialUpdate);
 
index 91da124386e6970f06af7980ecf5ef2a49061275..12a547e08f0531b3a58dd37c7bb3a435149546ae 100644 (file)
@@ -15,11 +15,11 @@ package org.opendaylight.controller.blueprint.ext;
 public class ConfigXMLReaderException extends Exception {
     private static final long serialVersionUID = 1L;
 
-    public ConfigXMLReaderException(String message) {
+    public ConfigXMLReaderException(final String message) {
         super(message);
     }
 
-    public ConfigXMLReaderException(String message, Throwable cause) {
+    public ConfigXMLReaderException(final String message, final Throwable cause) {
         super(message, cause);
     }
 
index 57f3abce85ea5b0da1bf3b66377a40c097d7f4f1..2d24c2146394b4d2421ef8687a6e58426090c03b 100644 (file)
@@ -60,12 +60,12 @@ public class DataStoreAppConfigDefaultXMLReader<T extends DataObject> {
     }
 
     public DataStoreAppConfigDefaultXMLReader(
-            String logName,
-            String defaultAppConfigFileName,
-            SchemaService schemaService,
-            BindingNormalizedNodeSerializer bindingSerializer,
-            BindingContext bindingContext,
-            ConfigURLProvider inputStreamProvider) {
+            final String logName,
+            final String defaultAppConfigFileName,
+            final SchemaService schemaService,
+            final BindingNormalizedNodeSerializer bindingSerializer,
+            final BindingContext bindingContext,
+            final ConfigURLProvider inputStreamProvider) {
 
         this.logName = logName;
         this.defaultAppConfigFileName = defaultAppConfigFileName;
@@ -76,17 +76,17 @@ public class DataStoreAppConfigDefaultXMLReader<T extends DataObject> {
     }
 
     public DataStoreAppConfigDefaultXMLReader(
-            Class<?> testClass,
-            String defaultAppConfigFileName,
-            SchemaService schemaService,
-            BindingNormalizedNodeSerializer bindingSerializer,
-            Class<T> klass) {
+            final Class<?> testClass,
+            final String defaultAppConfigFileName,
+            final SchemaService schemaService,
+            final BindingNormalizedNodeSerializer bindingSerializer,
+            final Class<T> klass) {
         this(testClass.getName(), defaultAppConfigFileName, schemaService, bindingSerializer,
             BindingContext.create(testClass.getName(), klass, null),
             appConfigFileName -> Optional.of(getURL(testClass, defaultAppConfigFileName)));
     }
 
-    private static URL getURL(Class<?> testClass, String defaultAppConfigFileName) {
+    private static URL getURL(final Class<?> testClass, final String defaultAppConfigFileName) {
         return Resources.getResource(testClass, defaultAppConfigFileName);
     }
 
@@ -98,7 +98,7 @@ public class DataStoreAppConfigDefaultXMLReader<T extends DataObject> {
     }
 
     @SuppressWarnings("unchecked")
-    public T createDefaultInstance(FallbackConfigProvider fallback) throws ConfigXMLReaderException {
+    public T createDefaultInstance(final FallbackConfigProvider fallback) throws ConfigXMLReaderException {
         YangInstanceIdentifier yangPath = bindingSerializer.toYangInstanceIdentifier(bindingContext.appConfigPath);
 
         LOG.debug("{}: Creating app config instance from path {}, Qname: {}", logName, yangPath,
@@ -157,13 +157,13 @@ public class DataStoreAppConfigDefaultXMLReader<T extends DataObject> {
             appConfigFileName = moduleName + "_" + bindingContext.bindingQName.getLocalName() + ".xml";
         }
 
-        DomToNormalizedNodeParserFactory parserFactory = DomToNormalizedNodeParserFactory.getInstance(
+        final DomToNormalizedNodeParserFactory parserFactory = DomToNormalizedNodeParserFactory.getInstance(
                 XmlUtils.DEFAULT_XML_CODEC_PROVIDER, schemaContext);
 
         Optional<URL> optionalURL;
         try {
             optionalURL = inputStreamProvider.getURL(appConfigFileName);
-        } catch (IOException e) {
+        } catch (final IOException e) {
             String msg = String.format("%s: Could not getURL()", logName);
             LOG.error(msg, e);
             throw new ConfigXMLReaderException(msg, e);
index bc4ebe2a64ea9ff3bf58e71e0dcba7fc86e5e2a1..f1024d7e4b7342e3f9f12139df9e332bdc78dd7a 100644 (file)
@@ -103,7 +103,7 @@ public class DataStoreAppConfigMetadata extends AbstractDependentComponentFactor
             }
 
             appConfigBindingClass = (Class<DataObject>) bindingClass;
-        } catch (ClassNotFoundException e) {
+        } catch (final ClassNotFoundException e) {
             throw new ComponentDefinitionException(String.format("%s: Error loading app config binding class %s",
                     logName(), appConfigBindingClassName), e);
         }
@@ -269,7 +269,7 @@ public class DataStoreAppConfigMetadata extends AbstractDependentComponentFactor
                 }
             });
 
-        } catch (ConfigXMLReaderException e) {
+        } catch (final ConfigXMLReaderException e) {
             if (e.getCause() == null) {
                 setFailureMessage(e.getMessage());
             } else {
index 52cfc9feb6a0286a035b137ad5eea008b42736f8..8139e1de52285dc76df7cb2daae020ed9e89ebdd 100644 (file)
@@ -23,7 +23,7 @@ class MandatoryServiceReferenceMetadata implements ServiceReferenceMetadata {
     private final String interfaceClass;
     private final String id;
 
-    MandatoryServiceReferenceMetadata(String id, String interfaceClass) {
+    MandatoryServiceReferenceMetadata(final String id, final String interfaceClass) {
         this.id = Preconditions.checkNotNull(id);
         this.interfaceClass = interfaceClass;
     }
index ccf6216d3da89e8a037567ccabcdc246415cff40..3a2a0b837b4e87d27427427a91542d130e7f17a4 100644 (file)
@@ -29,15 +29,15 @@ public class NotificationListenerBean {
     private NotificationListener notificationListener;
     private ListenerRegistration<?> registration;
 
-    public void setNotificationService(NotificationService notificationService) {
+    public void setNotificationService(final NotificationService notificationService) {
         this.notificationService = notificationService;
     }
 
-    public void setNotificationListener(NotificationListener notificationListener) {
+    public void setNotificationListener(final NotificationListener notificationListener) {
         this.notificationListener = notificationListener;
     }
 
-    public void setBundle(Bundle bundle) {
+    public void setBundle(final Bundle bundle) {
         this.bundle = bundle;
     }
 
index 04e6d30620e451c738033782bbdc41b556df395c..725e568785efd2bf2367335d7d9cc82210dc2417 100644 (file)
@@ -34,7 +34,7 @@ class RoutedRpcMetadata implements ComponentFactoryMetadata {
     private final String implementationRefId;
     private ExtendedBlueprintContainer container;
 
-    RoutedRpcMetadata(String id, String interfaceName, String implementationRefId) {
+    RoutedRpcMetadata(final String id, final String interfaceName, final String implementationRefId) {
         this.id = id;
         this.interfaceName = interfaceName;
         this.implementationRefId = implementationRefId;
@@ -56,7 +56,7 @@ class RoutedRpcMetadata implements ComponentFactoryMetadata {
     }
 
     @Override
-    public void init(ExtendedBlueprintContainer newContainer) {
+    public void init(final ExtendedBlueprintContainer newContainer) {
         this.container = newContainer;
 
         LOG.debug("{}: In init", logName());
@@ -94,16 +94,16 @@ class RoutedRpcMetadata implements ComponentFactoryMetadata {
                     implementation, rpcInterface);
 
             return rpcRegistry.addRoutedRpcImplementation(rpcInterface, (RpcService)implementation);
-        } catch (ComponentDefinitionException e) {
+        } catch (final ComponentDefinitionException e) {
             throw e;
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new ComponentDefinitionException(String.format(
                     "Error processing \"%s\" for %s", ROUTED_RPC_IMPLEMENTATION, implementation.getClass()), e);
         }
     }
 
     @Override
-    public void destroy(Object instance) {
+    public void destroy(final Object instance) {
         LOG.debug("{}: In destroy: instance: {}", logName(), instance);
 
         ((RoutedRpcRegistration<?>)instance).close();
index 5ae9a1cf72179563a532b3aea3f1e78ebf0cb677..66174438b23a89fc670aa464f1fc67eb5e7fd734 100644 (file)
@@ -22,13 +22,13 @@ import org.osgi.service.blueprint.container.ReifiedType;
  */
 public class RoutedRpcRegistrationConverter implements Converter {
     @Override
-    public boolean canConvert(Object sourceObject, ReifiedType targetType) {
+    public boolean canConvert(final Object sourceObject, final ReifiedType targetType) {
         return sourceObject instanceof RoutedRpcRegistration
                 && RoutedRpcRegistration.class.isAssignableFrom(targetType.getRawClass());
     }
 
     @Override
-    public Object convert(Object sourceObject, ReifiedType targetType) {
+    public Object convert(final Object sourceObject, final ReifiedType targetType) {
         return sourceObject;
     }
 }
index 3144328c99566fa1da6fe158d841a8aef0f060a7..338d0a2a2c33619d528b7f0440891511f9741178 100644 (file)
@@ -35,19 +35,19 @@ public class RpcImplementationBean {
     private RpcService implementation;
     private final List<RpcRegistration<RpcService>> rpcRegistrations = new ArrayList<>();
 
-    public void setRpcRegistry(RpcProviderRegistry rpcRegistry) {
+    public void setRpcRegistry(final RpcProviderRegistry rpcRegistry) {
         this.rpcRegistry = rpcRegistry;
     }
 
-    public void setBundle(Bundle bundle) {
+    public void setBundle(final Bundle bundle) {
         this.bundle = bundle;
     }
 
-    public void setInterfaceName(String interfaceName) {
+    public void setInterfaceName(final String interfaceName) {
         this.interfaceName = interfaceName;
     }
 
-    public void setImplementation(RpcService implementation) {
+    public void setImplementation(final RpcService implementation) {
         this.implementation = implementation;
     }
 
@@ -63,9 +63,9 @@ public class RpcImplementationBean {
             for (Class<RpcService> rpcInterface : rpcInterfaces) {
                 rpcRegistrations.add(rpcRegistry.addRpcImplementation(rpcInterface, implementation));
             }
-        } catch (ComponentDefinitionException e) {
+        } catch (final ComponentDefinitionException e) {
             throw e;
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new ComponentDefinitionException(String.format(
                     "Error processing \"%s\" for %s", RPC_IMPLEMENTATION, implementation.getClass()), e);
         }
@@ -78,8 +78,9 @@ public class RpcImplementationBean {
     }
 
     @SuppressWarnings("unchecked")
-    static List<Class<RpcService>> getImplementedRpcServiceInterfaces(String interfaceName,
-            Class<?> implementationClass, Bundle bundle, String logName) throws ClassNotFoundException {
+    static List<Class<RpcService>> getImplementedRpcServiceInterfaces(final String interfaceName,
+            final Class<?> implementationClass, final Bundle bundle, final String logName)
+            throws ClassNotFoundException {
         if (!Strings.isNullOrEmpty(interfaceName)) {
             Class<?> rpcInterface = bundle.loadClass(interfaceName);
 
index 9a0bd29a09d6ba552e0778a82381a72cbbfcd46b..e781ddd16a9172f4c04f5fd425f4c8acf415643b 100644 (file)
@@ -52,7 +52,7 @@ class SpecificReferenceListMetadata extends AbstractDependentComponentFactoryMet
     private volatile BundleTracker<Bundle> bundleTracker;
     private volatile ServiceTracker<Object, Object> serviceTracker;
 
-    SpecificReferenceListMetadata(String id, String interfaceName) {
+    SpecificReferenceListMetadata(final String id, final String interfaceName) {
         super(id);
         this.interfaceName = interfaceName;
         serviceResourcePath = "META-INF/services/" + interfaceName;
@@ -62,17 +62,17 @@ class SpecificReferenceListMetadata extends AbstractDependentComponentFactoryMet
     protected void startTracking() {
         BundleTrackerCustomizer<Bundle> bundleListener = new BundleTrackerCustomizer<Bundle>() {
             @Override
-            public Bundle addingBundle(Bundle bundle, BundleEvent event) {
+            public Bundle addingBundle(final Bundle bundle, final BundleEvent event) {
                 bundleAdded(bundle);
                 return bundle;
             }
 
             @Override
-            public void modifiedBundle(Bundle bundle, BundleEvent event, Bundle object) {
+            public void modifiedBundle(final Bundle bundle, final BundleEvent event, final Bundle object) {
             }
 
             @Override
-            public void removedBundle(Bundle bundle, BundleEvent event, Bundle object) {
+            public void removedBundle(final Bundle bundle, final BundleEvent event, final Bundle object) {
             }
         };
 
@@ -89,16 +89,16 @@ class SpecificReferenceListMetadata extends AbstractDependentComponentFactoryMet
 
         ServiceTrackerCustomizer<Object, Object> serviceListener = new ServiceTrackerCustomizer<Object, Object>() {
             @Override
-            public Object addingService(ServiceReference<Object> reference) {
+            public Object addingService(final ServiceReference<Object> reference) {
                 return serviceAdded(reference);
             }
 
             @Override
-            public void modifiedService(ServiceReference<Object> reference, Object service) {
+            public void modifiedService(final ServiceReference<Object> reference, final Object service) {
             }
 
             @Override
-            public void removedService(ServiceReference<Object> reference, Object service) {
+            public void removedService(final ServiceReference<Object> reference, final Object service) {
                 container().getBundleContext().ungetService(reference);
             }
         };
@@ -109,7 +109,7 @@ class SpecificReferenceListMetadata extends AbstractDependentComponentFactoryMet
         serviceTracker.open();
     }
 
-    private void bundleAdded(Bundle bundle) {
+    private void bundleAdded(final Bundle bundle) {
         URL resource = bundle.getEntry(serviceResourcePath);
         if (resource == null) {
             return;
@@ -133,13 +133,13 @@ class SpecificReferenceListMetadata extends AbstractDependentComponentFactoryMet
                 LOG.debug("{}: Retrieved service type {}", logName(), serviceType);
                 expectedServiceTypes.add(serviceType);
             }
-        } catch (IOException e) {
+        } catch (final IOException e) {
             setFailure(String.format("%s: Error reading resource %s from bundle %s", logName(), resource,
                     bundle.getSymbolicName()), e);
         }
     }
 
-    private Object serviceAdded(ServiceReference<Object> reference) {
+    private Object serviceAdded(final ServiceReference<Object> reference) {
         Object service = container().getBundleContext().getService(reference);
         String serviceType = (String) reference.getProperty(OpendaylightNamespaceHandler.TYPE_ATTR);
 
@@ -196,7 +196,7 @@ class SpecificReferenceListMetadata extends AbstractDependentComponentFactoryMet
     }
 
     @Override
-    public void destroy(Object instance) {
+    public void destroy(final Object instance) {
         super.destroy(instance);
 
         if (bundleTracker != null) {
index 693f518e158ecbbd7cd3e927056cefb8053d7822..97c04af56f8e1eebfebe7cd2703c8b42944adcf1 100644 (file)
@@ -24,7 +24,7 @@ class StaticReferenceMetadata extends AbstractDependentComponentFactoryMetadata
     private final String interfaceName;
     private volatile Object retrievedService;
 
-    StaticReferenceMetadata(String id, String interfaceName) {
+    StaticReferenceMetadata(final String id, final String interfaceName) {
         super(id);
         this.interfaceName = interfaceName;
     }
index 368980565525c600bad52cd378302a3262400a25..8f3ca2446ac01da4158441e5d00668d138d2c54c 100644 (file)
@@ -35,26 +35,26 @@ class StaticServiceReferenceRecipe extends AbstractServiceReferenceRecipe {
     private volatile Object trackedService;
     private Consumer<Object> serviceSatisfiedCallback;
 
-    StaticServiceReferenceRecipe(String name, ExtendedBlueprintContainer blueprintContainer,
-            String interfaceClass) {
+    StaticServiceReferenceRecipe(final String name, final ExtendedBlueprintContainer blueprintContainer,
+            final String interfaceClass) {
         super(name, blueprintContainer, new MandatoryServiceReferenceMetadata(name, interfaceClass), null, null,
                 Collections.emptyList());
     }
 
-    void startTracking(Consumer<Object> newServiceSatisfiedCallback) {
+    void startTracking(final Consumer<Object> newServiceSatisfiedCallback) {
         this.serviceSatisfiedCallback = newServiceSatisfiedCallback;
         super.start(NOOP_LISTENER);
     }
 
     @SuppressWarnings("rawtypes")
     @Override
-    protected void track(ServiceReference reference) {
+    protected void track(final ServiceReference reference) {
         retrack();
     }
 
     @SuppressWarnings("rawtypes")
     @Override
-    protected void untrack(ServiceReference reference) {
+    protected void untrack(final ServiceReference reference) {
         LOG.debug("{}: In untrack {}", getName(), reference);
 
         if (trackedServiceReference == reference) {
@@ -84,7 +84,7 @@ class StaticServiceReferenceRecipe extends AbstractServiceReferenceRecipe {
         if (trackedServiceReference != null && trackedService != null) {
             try {
                 getBundleContextForServiceLookup().ungetService(trackedServiceReference);
-            } catch (IllegalStateException e) {
+            } catch (final IllegalStateException e) {
                 // In case the service no longer exists, ignore.
             }