config-manager: final parameters 25/56925/2
authorStephen Kitt <skitt@redhat.com>
Fri, 12 May 2017 09:54:20 +0000 (11:54 +0200)
committerTom Pantelis <tompantelis@gmail.com>
Mon, 15 May 2017 11:56:28 +0000 (11:56 +0000)
This automatically-generated patch flags all appropriate parameters as
final (including caught exceptions).

Change-Id: I78de8a8a8f9766a654432e8ba5a0497f06c4438a
Signed-off-by: Stephen Kitt <skitt@redhat.com>
60 files changed:
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/CommitInfo.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigRegistryImpl.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionControllerImpl.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionLookupRegistry.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ModuleInternalInfo.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ServiceReferenceRegistryImpl.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/TransactionIdentifier.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DependencyResolverManager.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DestroyedModule.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/ModuleInternalTransactionalInfo.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AbstractDynamicWrapper.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AnnotationsHelper.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AttributeHolder.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicReadableWrapper.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicWritableWrapper.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/ReadOnlyAtomicBoolean.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/factoriesresolver/HierarchicalConfigMBeanFactoriesHolder.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/HierarchicalRuntimeBeanRegistrationImpl.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/InternalJMXRegistrator.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/RootRuntimeBeanRegistratorImpl.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReference.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReferenceMXBeanImpl.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReferenceRegistrator.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/TransactionModuleJMXRegistrator.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BeanToOsgiServiceManager.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BlankTransactionServiceTracker.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BundleContextBackedModuleFactoriesResolver.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ExtensibleBundleTracker.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ModuleFactoryBundleTracker.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/mapping/ModuleInfoBundleTracker.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/LookupBeansUtil.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/ModuleQNameUtil.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/OsgiRegistrationUtil.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/ConfigRegistryImplTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/AbstractMockedModule.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/ClassBasedModuleFactory.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionManagerImplTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AnnotationsTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicReadableWrapperTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicWritableWrapperTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/factoriesresolver/HardcodedModuleFactoriesResolver.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/osgi/BundleContextBackedModuleFactoriesResolverTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/osgi/ModuleFactoryBundleTrackerTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/runtimembean/RuntimeBeanRegistratorImplTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPImpl.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModule.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModuleFactory.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/AbstractParallelAPSPTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/DependentWiringTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/MockedDependenciesTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolImpl.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolModule.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolModuleFactory.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/test/RuntimeBeanTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/test/TwoInterfacesExportTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPool.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPoolModule.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPoolModuleFactory.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/test/SimpleConfigurationTest.java

index c0447bfb32c3705d435a51f18e58617bb473f905..ae78c83754696388198f417acf389e599fbaf28f 100644 (file)
@@ -25,8 +25,8 @@ public class CommitInfo {
     private final List<DestroyedModule> destroyedFromPreviousTransactions;
     private final Map<ModuleIdentifier, ModuleInternalTransactionalInfo> commitMap;
 
-    public CommitInfo(List<DestroyedModule> destroyedFromPreviousTransactions,
-            Map<ModuleIdentifier, ModuleInternalTransactionalInfo> commitMap) {
+    public CommitInfo(final List<DestroyedModule> destroyedFromPreviousTransactions,
+            final Map<ModuleIdentifier, ModuleInternalTransactionalInfo> commitMap) {
         this.destroyedFromPreviousTransactions = Collections
                 .unmodifiableList(destroyedFromPreviousTransactions);
         this.commitMap = Collections.unmodifiableMap(commitMap);
index 763ed66cb10d947f4ef5aa95d4a6178acf8d009e..369e7ed2a5c1b26bb6b0152cdfe35f5ab47ff1ec 100644 (file)
@@ -120,16 +120,16 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
             ServiceReferenceRegistryImpl.createInitialSRLookupRegistry();
 
     // constructor
-    public ConfigRegistryImpl(ModuleFactoriesResolver resolver,
-                              MBeanServer configMBeanServer, BindingContextProvider bindingContextProvider) {
+    public ConfigRegistryImpl(final ModuleFactoriesResolver resolver,
+                              final MBeanServer configMBeanServer, final BindingContextProvider bindingContextProvider) {
         this(resolver, configMBeanServer,
                 new BaseJMXRegistrator(configMBeanServer), bindingContextProvider);
     }
 
     // constructor
-    public ConfigRegistryImpl(ModuleFactoriesResolver resolver,
-                              MBeanServer configMBeanServer,
-                              BaseJMXRegistrator baseJMXRegistrator, BindingContextProvider bindingContextProvider) {
+    public ConfigRegistryImpl(final ModuleFactoriesResolver resolver,
+                              final MBeanServer configMBeanServer,
+                              final BaseJMXRegistrator baseJMXRegistrator, final BindingContextProvider bindingContextProvider) {
         this.resolver = resolver;
         this.beanToOsgiServiceManager = new BeanToOsgiServiceManager();
         this.configMBeanServer = configMBeanServer;
@@ -153,7 +153,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
      * @param blankTransaction true if this transaction is created automatically by
      *                         org.opendaylight.controller.config.manager.impl.osgi.BlankTransactionServiceTracker
      */
-    public ObjectName beginConfig(boolean blankTransaction) {
+    public ObjectName beginConfig(final boolean blankTransaction) {
         // If we're closed or in the process of closing then all modules are destroyed or being destroyed
         // so there's no point in trying to acquire the lock and beginning an actual transaction. Also we want
         // to avoid trying to lock as it may block the shutdown process if there is an outstanding transaction
@@ -175,7 +175,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
                     LOG.debug("Timed out trying to obtain configTransactionLock");
                     return NOOP_TX_NAME;
                 }
-            } catch(InterruptedException e) {
+            } catch(final InterruptedException e) {
                 LOG.debug("Interrupted trying to obtain configTransactionLock", e);
                 Thread.currentThread().interrupt();
                 return NOOP_TX_NAME;
@@ -192,7 +192,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
     }
 
     @GuardedBy("configTransactionLock")
-    private ConfigTransactionControllerInternal beginConfigSafe(boolean blankTransaction) {
+    private ConfigTransactionControllerInternal beginConfigSafe(final boolean blankTransaction) {
         versionCounter++;
         final String transactionName = "ConfigTransaction-" + version + "-" + versionCounter;
 
@@ -229,7 +229,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
                 configMBeanServer, blankTransaction, writableRegistry);
         try {
             txLookupRegistry.registerMBean(transactionController, transactionController.getControllerObjectName());
-        } catch (InstanceAlreadyExistsException e) {
+        } catch (final InstanceAlreadyExistsException e) {
             throw new IllegalStateException(e);
         }
         transactionController.copyExistingModulesAndProcessFactoryDiff(currentConfig.getEntries(), lastListOfFactories);
@@ -242,7 +242,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
      * @throws ConflictingVersionException
      */
     @Override
-    public CommitStatus commitConfig(ObjectName transactionControllerON)
+    public CommitStatus commitConfig(final ObjectName transactionControllerON)
             throws ValidationException, ConflictingVersionException {
         if(NOOP_TX_NAME.equals(transactionControllerON) || closed.get()) {
             return new CommitStatus(Collections.emptyList(), Collections.emptyList(), Collections.emptyList());
@@ -257,7 +257,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
     }
 
     @GuardedBy("configTransactionLock")
-    private CommitStatus commitConfigSafe(ObjectName transactionControllerON)
+    private CommitStatus commitConfigSafe(final ObjectName transactionControllerON)
             throws ConflictingVersionException, ValidationException {
         final String transactionName = ObjectNameUtil
                 .getTransactionName(transactionControllerON);
@@ -288,7 +288,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
             return secondPhaseCommit(configTransactionController, commitInfo, configTransactionControllerEntry.getValue());
             // some libs throw Errors: e.g.
             // javax.xml.ws.spi.FactoryFinder$ConfigurationError
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             isHealthy = false;
             LOG.error("Configuration Transaction failed on 2PC, server is unhealthy", t);
             throw Throwables.propagate(t);
@@ -296,8 +296,8 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
     }
 
     @GuardedBy("configTransactionLock")
-    private CommitStatus secondPhaseCommit(ConfigTransactionControllerInternal configTransactionController,
-                                           CommitInfo commitInfo, ConfigTransactionLookupRegistry txLookupRegistry) {
+    private CommitStatus secondPhaseCommit(final ConfigTransactionControllerInternal configTransactionController,
+                                           final CommitInfo commitInfo, final ConfigTransactionLookupRegistry txLookupRegistry) {
 
         // close instances which were destroyed by the user, including
         // (hopefully) runtime beans
@@ -424,7 +424,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
             // register to JMX
             try {
                 newModuleJMXRegistrator.registerMBean(newReadableConfigBean, primaryReadOnlyON);
-            } catch (InstanceAlreadyExistsException e) {
+            } catch (final InstanceAlreadyExistsException e) {
                 throw new IllegalStateException("Possible code error, already registered:" + primaryReadOnlyON,e);
             }
 
@@ -502,7 +502,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
             try {
                 configTransactionControllerEntry.getValue().close();
                 configTransactionController.abortConfig();
-            } catch (RuntimeException e) {
+            } catch (final RuntimeException e) {
                 LOG.debug("Ignoring exception while aborting {}", configTransactionController, e);
             }
         }
@@ -563,7 +563,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
      * {@inheritDoc}
      */
     @Override
-    public Set<ObjectName> lookupConfigBeans(String moduleName) {
+    public Set<ObjectName> lookupConfigBeans(final String moduleName) {
         return lookupConfigBeans(moduleName, "*");
     }
 
@@ -571,7 +571,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
      * {@inheritDoc}
      */
     @Override
-    public ObjectName lookupConfigBean(String moduleName, String instanceName)
+    public ObjectName lookupConfigBean(final String moduleName, final String instanceName)
             throws InstanceNotFoundException {
         return LookupBeansUtil.lookupConfigBean(this, moduleName, instanceName);
     }
@@ -580,8 +580,8 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
      * {@inheritDoc}
      */
     @Override
-    public Set<ObjectName> lookupConfigBeans(String moduleName,
-                                             String instanceName) {
+    public Set<ObjectName> lookupConfigBeans(final String moduleName,
+                                             final String instanceName) {
         ObjectName namePattern = ObjectNameUtil.createModulePattern(moduleName,
                 instanceName);
         return baseJMXRegistrator.queryNames(namePattern, null);
@@ -599,8 +599,8 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
      * {@inheritDoc}
      */
     @Override
-    public Set<ObjectName> lookupRuntimeBeans(String moduleName,
-                                              String instanceName) {
+    public Set<ObjectName> lookupRuntimeBeans(final String moduleName,
+                                              final String instanceName) {
         String finalModuleName = moduleName == null ? "*" : moduleName;
         String finalInstanceName = instanceName == null ? "*" : instanceName;
         ObjectName namePattern = ObjectNameUtil.createRuntimeBeanPattern(
@@ -609,7 +609,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
     }
 
     @Override
-    public void checkConfigBeanExists(ObjectName objectName) throws InstanceNotFoundException {
+    public void checkConfigBeanExists(final ObjectName objectName) throws InstanceNotFoundException {
         ObjectNameUtil.checkDomain(objectName);
         ObjectNameUtil.checkType(objectName, ObjectNameUtil.TYPE_MODULE);
         String transactionName = ObjectNameUtil.getTransactionName(objectName);
@@ -622,7 +622,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
 
     // service reference functionality:
     @Override
-    public ObjectName lookupConfigBeanByServiceInterfaceName(String serviceInterfaceQName, String refName) {
+    public ObjectName lookupConfigBeanByServiceInterfaceName(final String serviceInterfaceQName, final String refName) {
         synchronized(readableSRRegistryLock) {
             return readableSRRegistry.lookupConfigBeanByServiceInterfaceName(serviceInterfaceQName, refName);
         }
@@ -636,35 +636,35 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
     }
 
     @Override
-    public Map<String, ObjectName> lookupServiceReferencesByServiceInterfaceName(String serviceInterfaceQName) {
+    public Map<String, ObjectName> lookupServiceReferencesByServiceInterfaceName(final String serviceInterfaceQName) {
         synchronized(readableSRRegistryLock) {
             return readableSRRegistry.lookupServiceReferencesByServiceInterfaceName(serviceInterfaceQName);
         }
     }
 
     @Override
-    public Set<String> lookupServiceInterfaceNames(ObjectName objectName) throws InstanceNotFoundException {
+    public Set<String> lookupServiceInterfaceNames(final ObjectName objectName) throws InstanceNotFoundException {
         synchronized(readableSRRegistryLock) {
             return readableSRRegistry.lookupServiceInterfaceNames(objectName);
         }
     }
 
     @Override
-    public String getServiceInterfaceName(String namespace, String localName) {
+    public String getServiceInterfaceName(final String namespace, final String localName) {
         synchronized(readableSRRegistryLock) {
             return readableSRRegistry.getServiceInterfaceName(namespace, localName);
         }
     }
 
     @Override
-    public void checkServiceReferenceExists(ObjectName objectName) throws InstanceNotFoundException {
+    public void checkServiceReferenceExists(final ObjectName objectName) throws InstanceNotFoundException {
         synchronized(readableSRRegistryLock) {
             readableSRRegistry.checkServiceReferenceExists(objectName);
         }
     }
 
     @Override
-    public ObjectName getServiceReference(String serviceInterfaceQName, String refName) throws InstanceNotFoundException {
+    public ObjectName getServiceReference(final String serviceInterfaceQName, final String refName) throws InstanceNotFoundException {
         synchronized(readableSRRegistryLock) {
             return readableSRRegistry.getServiceReference(serviceInterfaceQName, refName);
         }
@@ -694,7 +694,7 @@ class ConfigHolder {
      * Add all modules to the internal map. Also add service instance to OSGi
      * Service Registry.
      */
-    public void addAll(Collection<ModuleInternalInfo> configInfos) {
+    public void addAll(final Collection<ModuleInternalInfo> configInfos) {
         if (!currentConfig.isEmpty()) {
             throw new IllegalStateException(
                     "Error - some config entries were not removed: "
@@ -705,7 +705,7 @@ class ConfigHolder {
         }
     }
 
-    private void add(ModuleInternalInfo configInfo) {
+    private void add(final ModuleInternalInfo configInfo) {
         ModuleInternalInfo oldValue = currentConfig.putIfAbsent(configInfo.getIdentifier(), configInfo);
         if (oldValue != null) {
             throw new IllegalStateException(
@@ -717,7 +717,7 @@ class ConfigHolder {
     /**
      * Remove entry from current config.
      */
-    public void remove(ModuleIdentifier name) {
+    public void remove(final ModuleIdentifier name) {
         ModuleInternalInfo removed = currentConfig.remove(name);
         if (removed == null) {
             throw new IllegalStateException(
@@ -755,8 +755,8 @@ class TransactionsHolder {
     private final ConcurrentMap<String /* transactionName */,
             Entry<ConfigTransactionControllerInternal, ConfigTransactionLookupRegistry>> transactions = new ConcurrentHashMap<>();
 
-    public void add(String transactionName,
-                    ConfigTransactionControllerInternal transactionController, ConfigTransactionLookupRegistry txLookupRegistry) {
+    public void add(final String transactionName,
+                    final ConfigTransactionControllerInternal transactionController, final ConfigTransactionLookupRegistry txLookupRegistry) {
         Object oldValue = transactions.putIfAbsent(transactionName,
                 Maps.immutableEntry(transactionController, txLookupRegistry));
         if (oldValue != null) {
index ad64288ab203a0e9c00d6bbe5964dff33fedf520..97c42803ef618662efacb522244762088eb4f13a 100644 (file)
@@ -86,11 +86,11 @@ class ConfigTransactionControllerImpl implements
     @GuardedBy("this")
     private final SearchableServiceReferenceWritableRegistry writableSRRegistry;
 
-    public ConfigTransactionControllerImpl(ConfigTransactionLookupRegistry txLookupRegistry,
-                                           long parentVersion, BindingContextProvider bindingContextProvider, long currentVersion,
-                                           Map<String, Entry<ModuleFactory, BundleContext>> currentlyRegisteredFactories,
-                                           MBeanServer transactionsMBeanServer, MBeanServer configMBeanServer,
-                                           boolean blankTransaction, SearchableServiceReferenceWritableRegistry  writableSRRegistry) {
+    public ConfigTransactionControllerImpl(final ConfigTransactionLookupRegistry txLookupRegistry,
+                                           final long parentVersion, final BindingContextProvider bindingContextProvider, final long currentVersion,
+                                           final Map<String, Entry<ModuleFactory, BundleContext>> currentlyRegisteredFactories,
+                                           final MBeanServer transactionsMBeanServer, final MBeanServer configMBeanServer,
+                                           final boolean blankTransaction, final SearchableServiceReferenceWritableRegistry  writableSRRegistry) {
         this.txLookupRegistry = txLookupRegistry;
         String transactionName = txLookupRegistry.getTransactionIdentifier().getName();
         this.controllerON = ObjectNameUtil.createTransactionControllerON(transactionName);
@@ -108,19 +108,19 @@ class ConfigTransactionControllerImpl implements
     }
 
     @Override
-    public void copyExistingModulesAndProcessFactoryDiff(Collection<ModuleInternalInfo> existingModules, List<ModuleFactory> lastListOfFactories) {
+    public void copyExistingModulesAndProcessFactoryDiff(final Collection<ModuleInternalInfo> existingModules, final List<ModuleFactory> lastListOfFactories) {
         // copy old configuration to this server
         for (ModuleInternalInfo oldConfigInfo : existingModules) {
             try {
                 copyExistingModule(oldConfigInfo);
-            } catch (InstanceAlreadyExistsException e) {
+            } catch (final InstanceAlreadyExistsException e) {
                 throw new IllegalStateException("Error while copying " + oldConfigInfo, e);
             }
         }
         processDefaultBeans(lastListOfFactories);
     }
 
-    private synchronized void processDefaultBeans(List<ModuleFactory> lastListOfFactories) {
+    private synchronized void processDefaultBeans(final List<ModuleFactory> lastListOfFactories) {
         transactionStatus.checkNotCommitStarted();
         transactionStatus.checkNotAborted();
 
@@ -152,7 +152,7 @@ class ConfigTransactionControllerImpl implements
                     boolean defaultBean = true;
                     objectName = putConfigBeanToJMXAndInternalMaps(module.getIdentifier(), module, moduleFactory, null,
                             dependencyResolver, defaultBean, bundleContext);
-                } catch (InstanceAlreadyExistsException e) {
+                } catch (final InstanceAlreadyExistsException e) {
                     throw new IllegalStateException(e);
                 }
 
@@ -161,7 +161,7 @@ class ConfigTransactionControllerImpl implements
                 for (String qname : InterfacesHelper.getQNames(serviceInterfaceAnnotations)) {
                     try {
                         saveServiceReference(qname, module.getIdentifier().getInstanceName(), objectName);
-                    } catch (InstanceNotFoundException e) {
+                    } catch (final InstanceNotFoundException e) {
                         throw new IllegalStateException("Unable to register default module instance " + module + " as a service of " + qname, e);
                     }
                 }
@@ -178,7 +178,7 @@ class ConfigTransactionControllerImpl implements
                 for (String qname : InterfacesHelper.getQNames(serviceInterfaceAnnotations)) {
                     try {
                         removeServiceReference(qname, name.getInstanceName());
-                    } catch (InstanceNotFoundException e) {
+                    } catch (final InstanceNotFoundException e) {
                         throw new IllegalStateException("Unable to UNregister default module instance " + name + " as a service of " + qname, e);
                     }
                 }
@@ -190,7 +190,7 @@ class ConfigTransactionControllerImpl implements
     }
 
 
-    private synchronized void copyExistingModule(ModuleInternalInfo oldConfigBeanInfo)
+    private synchronized void copyExistingModule(final ModuleInternalInfo oldConfigBeanInfo)
             throws InstanceAlreadyExistsException {
 
         transactionStatus.checkNotCommitStarted();
@@ -203,7 +203,7 @@ class ConfigTransactionControllerImpl implements
         try {
             moduleFactory = factoriesHolder.findByModuleName(moduleIdentifier.getFactoryName());
             bc = getModuleFactoryBundleContext(moduleFactory.getImplementationName());
-        } catch (ModuleFactoryNotFoundException e) {
+        } catch (final ModuleFactoryNotFoundException e) {
             throw new IllegalStateException(e);
         }
 
@@ -214,7 +214,7 @@ class ConfigTransactionControllerImpl implements
             module = moduleFactory.createModule(
                     moduleIdentifier.getInstanceName(), dependencyResolver,
                     oldConfigBeanInfo.getReadableModule(), bc);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new IllegalStateException(String.format(
                     "Error while copying old configuration from %s to %s",
                     oldConfigBeanInfo, moduleFactory), e);
@@ -224,7 +224,7 @@ class ConfigTransactionControllerImpl implements
     }
 
     @Override
-    public synchronized ObjectName createModule(String factoryName, String instanceName)
+    public synchronized ObjectName createModule(final String factoryName, final String instanceName)
             throws InstanceAlreadyExistsException {
 
         transactionStatus.checkNotCommitStarted();
@@ -245,7 +245,7 @@ class ConfigTransactionControllerImpl implements
     }
 
     @Override
-    public synchronized void reCreateModule(ObjectName objectName) throws InstanceNotFoundException {
+    public synchronized void reCreateModule(final ObjectName objectName) throws InstanceNotFoundException {
         transactionStatus.checkNotCommitStarted();
         transactionStatus.checkNotAborted();
         checkTransactionName(objectName);
@@ -260,10 +260,10 @@ class ConfigTransactionControllerImpl implements
     }
 
     private synchronized ObjectName putConfigBeanToJMXAndInternalMaps(
-            ModuleIdentifier moduleIdentifier, Module module,
-            ModuleFactory moduleFactory,
-            @Nullable ModuleInternalInfo maybeOldConfigBeanInfo, DependencyResolver dependencyResolver,
-            boolean isDefaultBean, BundleContext bundleContext)
+            final ModuleIdentifier moduleIdentifier, final Module module,
+            final ModuleFactory moduleFactory,
+            @Nullable final ModuleInternalInfo maybeOldConfigBeanInfo, final DependencyResolver dependencyResolver,
+            final boolean isDefaultBean, final BundleContext bundleContext)
             throws InstanceAlreadyExistsException {
 
         LOG.debug("Adding module {} to transaction {}", moduleIdentifier, this);
@@ -293,7 +293,7 @@ class ConfigTransactionControllerImpl implements
     }
 
     @Override
-    public synchronized void destroyModule(ObjectName objectName) throws InstanceNotFoundException {
+    public synchronized void destroyModule(final ObjectName objectName) throws InstanceNotFoundException {
         checkTransactionName(objectName);
         ObjectNameUtil.checkDomain(objectName);
         ModuleIdentifier moduleIdentifier = ObjectNameUtil.fromON(objectName,
@@ -301,7 +301,7 @@ class ConfigTransactionControllerImpl implements
         destroyModule(moduleIdentifier);
     }
 
-    private void checkTransactionName(ObjectName objectName) {
+    private void checkTransactionName(final ObjectName objectName) {
         String foundTransactionName = ObjectNameUtil
                 .getTransactionName(objectName);
         if (!getTransactionIdentifier().getName().equals(foundTransactionName)) {
@@ -310,7 +310,7 @@ class ConfigTransactionControllerImpl implements
         }
     }
 
-    private synchronized void destroyModule(ModuleIdentifier moduleIdentifier) {
+    private synchronized void destroyModule(final ModuleIdentifier moduleIdentifier) {
         LOG.debug("Destroying module {} in transaction {}", moduleIdentifier, this);
         transactionStatus.checkNotAborted();
 
@@ -324,7 +324,7 @@ class ConfigTransactionControllerImpl implements
         try {
             writableSRRegistry.removeServiceReferences(
                     ObjectNameUtil.createTransactionModuleON(getTransactionName(), moduleIdentifier));
-        } catch (InstanceNotFoundException e) {
+        } catch (final InstanceNotFoundException e) {
             LOG.error("Possible code error: cannot find {} in {}", moduleIdentifier, writableSRRegistry);
             throw new IllegalStateException("Possible code error: cannot find " + moduleIdentifier, e);
         }
@@ -368,7 +368,7 @@ class ConfigTransactionControllerImpl implements
             Module module = entry.getValue();
             try {
                 module.validate();
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 LOG.warn("Validation exception in {}", getTransactionName(),
                         e);
                 collectedExceptions.add(ValidationException
@@ -397,7 +397,7 @@ class ConfigTransactionControllerImpl implements
         configBeanModificationDisabled.set(true);
         try {
             validateNoLocks();
-        } catch (ValidationException e) {
+        } catch (final ValidationException e) {
             LOG.trace("Commit failed on validation");
             // recoverable error
             configBeanModificationDisabled.set(false);
@@ -438,7 +438,7 @@ class ConfigTransactionControllerImpl implements
                         moduleIdentifier, getTransactionIdentifier());
                 AutoCloseable instance = module.getInstance();
                 Preconditions.checkNotNull(instance, "Instance is null:{} in transaction {}", moduleIdentifier, getTransactionIdentifier());
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 LOG.error("Commit failed on {} in transaction {}", moduleIdentifier,
                         getTransactionIdentifier(), e);
                 internalAbort();
@@ -495,7 +495,7 @@ class ConfigTransactionControllerImpl implements
      * {@inheritDoc}
      */
     @Override
-    public Set<ObjectName> lookupConfigBeans(String moduleName) {
+    public Set<ObjectName> lookupConfigBeans(final String moduleName) {
         return txLookupRegistry.lookupConfigBeans(moduleName);
     }
 
@@ -503,7 +503,7 @@ class ConfigTransactionControllerImpl implements
      * {@inheritDoc}
      */
     @Override
-    public ObjectName lookupConfigBean(String moduleName, String instanceName)
+    public ObjectName lookupConfigBean(final String moduleName, final String instanceName)
             throws InstanceNotFoundException {
         return txLookupRegistry.lookupConfigBean(moduleName, instanceName);
     }
@@ -512,7 +512,7 @@ class ConfigTransactionControllerImpl implements
      * {@inheritDoc}
      */
     @Override
-    public Set<ObjectName> lookupConfigBeans(String moduleName, String instanceName) {
+    public Set<ObjectName> lookupConfigBeans(final String moduleName, final String instanceName) {
         return txLookupRegistry.lookupConfigBeans(moduleName, instanceName);
     }
 
@@ -520,7 +520,7 @@ class ConfigTransactionControllerImpl implements
      * {@inheritDoc}
      */
     @Override
-    public void checkConfigBeanExists(ObjectName objectName) throws InstanceNotFoundException {
+    public void checkConfigBeanExists(final ObjectName objectName) throws InstanceNotFoundException {
         txLookupRegistry.checkConfigBeanExists(objectName);
     }
 
@@ -537,8 +537,8 @@ class ConfigTransactionControllerImpl implements
      * {@inheritDoc}
      */
     @Override
-    public Set<ObjectName> lookupRuntimeBeans(String moduleName,
-                                              String instanceName) {
+    public Set<ObjectName> lookupRuntimeBeans(final String moduleName,
+                                              final String instanceName) {
         return txLookupRegistry.lookupRuntimeBeans(moduleName, instanceName);
     }
 
@@ -586,7 +586,7 @@ class ConfigTransactionControllerImpl implements
     }
 
     @Override
-    public BundleContext getModuleFactoryBundleContext(String factoryName) {
+    public BundleContext getModuleFactoryBundleContext(final String factoryName) {
         Map.Entry<ModuleFactory, BundleContext> factoryBundleContextEntry = this.currentlyRegisteredFactories.get(factoryName);
         if (factoryBundleContextEntry == null || factoryBundleContextEntry.getValue() == null) {
             throw new NullPointerException("Bundle context of " + factoryName + " ModuleFactory not found.");
@@ -598,7 +598,7 @@ class ConfigTransactionControllerImpl implements
 
 
     @Override
-    public synchronized ObjectName lookupConfigBeanByServiceInterfaceName(String serviceInterfaceQName, String refName) {
+    public synchronized ObjectName lookupConfigBeanByServiceInterfaceName(final String serviceInterfaceQName, final String refName) {
         return writableSRRegistry.lookupConfigBeanByServiceInterfaceName(serviceInterfaceQName, refName);
     }
 
@@ -608,27 +608,27 @@ class ConfigTransactionControllerImpl implements
     }
 
     @Override
-    public synchronized Map<String, ObjectName> lookupServiceReferencesByServiceInterfaceName(String serviceInterfaceQName) {
+    public synchronized Map<String, ObjectName> lookupServiceReferencesByServiceInterfaceName(final String serviceInterfaceQName) {
         return writableSRRegistry.lookupServiceReferencesByServiceInterfaceName(serviceInterfaceQName);
     }
 
     @Override
-    public synchronized Set<String> lookupServiceInterfaceNames(ObjectName objectName) throws InstanceNotFoundException {
+    public synchronized Set<String> lookupServiceInterfaceNames(final ObjectName objectName) throws InstanceNotFoundException {
         return writableSRRegistry.lookupServiceInterfaceNames(objectName);
     }
 
     @Override
-    public synchronized String getServiceInterfaceName(String namespace, String localName) {
+    public synchronized String getServiceInterfaceName(final String namespace, final String localName) {
         return writableSRRegistry.getServiceInterfaceName(namespace, localName);
     }
 
     @Override
-    public synchronized ObjectName saveServiceReference(String serviceInterfaceName, String refName, ObjectName moduleON) throws InstanceNotFoundException {
+    public synchronized ObjectName saveServiceReference(final String serviceInterfaceName, final String refName, final ObjectName moduleON) throws InstanceNotFoundException {
         return writableSRRegistry.saveServiceReference(serviceInterfaceName, refName, moduleON);
     }
 
     @Override
-    public synchronized void removeServiceReference(String serviceInterfaceName, String refName) throws InstanceNotFoundException {
+    public synchronized void removeServiceReference(final String serviceInterfaceName, final String refName) throws InstanceNotFoundException {
         writableSRRegistry.removeServiceReference(serviceInterfaceName, refName);
     }
 
@@ -638,7 +638,7 @@ class ConfigTransactionControllerImpl implements
     }
 
     @Override
-    public boolean removeServiceReferences(ObjectName objectName) throws InstanceNotFoundException {
+    public boolean removeServiceReferences(final ObjectName objectName) throws InstanceNotFoundException {
         return writableSRRegistry.removeServiceReferences(objectName);
     }
 
@@ -658,12 +658,12 @@ class ConfigTransactionControllerImpl implements
     }
 
     @Override
-    public void checkServiceReferenceExists(ObjectName objectName) throws InstanceNotFoundException {
+    public void checkServiceReferenceExists(final ObjectName objectName) throws InstanceNotFoundException {
         writableSRRegistry.checkServiceReferenceExists(objectName);
     }
 
     @Override
-    public ObjectName getServiceReference(String serviceInterfaceQName, String refName) throws InstanceNotFoundException {
+    public ObjectName getServiceReference(final String serviceInterfaceQName, final String refName) throws InstanceNotFoundException {
         return writableSRRegistry.getServiceReference(serviceInterfaceQName, refName);
     }
 }
index 79bffb49da25873cec2f99d17f19ea3dd25f2351..4780f965104621bc4a8d99520880573c2a1e90ac 100644 (file)
@@ -33,15 +33,15 @@ class ConfigTransactionLookupRegistry  implements LookupRegistry, Closeable {
     private final TransactionModuleJMXRegistrator txModuleJMXRegistrator;
     private final Map<String, Map.Entry<ModuleFactory, BundleContext>> allCurrentFactories;
 
-    ConfigTransactionLookupRegistry(TransactionIdentifier transactionIdentifier,
-                                    TransactionJMXRegistratorFactory factory, Map<String, Entry<ModuleFactory, BundleContext>> allCurrentFactories) {
+    ConfigTransactionLookupRegistry(final TransactionIdentifier transactionIdentifier,
+                                    final TransactionJMXRegistratorFactory factory, final Map<String, Entry<ModuleFactory, BundleContext>> allCurrentFactories) {
         this.transactionIdentifier = transactionIdentifier;
         this.transactionJMXRegistrator = factory.create();
         this.txModuleJMXRegistrator = transactionJMXRegistrator.createTransactionModuleJMXRegistrator();
         this.allCurrentFactories = allCurrentFactories;
     }
 
-    private void checkTransactionName(ObjectName objectName) {
+    private void checkTransactionName(final ObjectName objectName) {
         String foundTransactionName = ObjectNameUtil
                 .getTransactionName(objectName);
         if (!transactionIdentifier.getName().equals(foundTransactionName)) {
@@ -62,7 +62,7 @@ class ConfigTransactionLookupRegistry  implements LookupRegistry, Closeable {
      * {@inheritDoc}
      */
     @Override
-    public Set<ObjectName> lookupConfigBeans(String moduleName) {
+    public Set<ObjectName> lookupConfigBeans(final String moduleName) {
         return lookupConfigBeans(moduleName, "*");
     }
 
@@ -70,7 +70,7 @@ class ConfigTransactionLookupRegistry  implements LookupRegistry, Closeable {
      * {@inheritDoc}
      */
     @Override
-    public ObjectName lookupConfigBean(String moduleName, String instanceName)
+    public ObjectName lookupConfigBean(final String moduleName, final String instanceName)
             throws InstanceNotFoundException {
         return LookupBeansUtil.lookupConfigBean(this, moduleName, instanceName);
     }
@@ -79,15 +79,15 @@ class ConfigTransactionLookupRegistry  implements LookupRegistry, Closeable {
      * {@inheritDoc}
      */
     @Override
-    public Set<ObjectName> lookupConfigBeans(String moduleName,
-                                             String instanceName) {
+    public Set<ObjectName> lookupConfigBeans(final String moduleName,
+                                             final String instanceName) {
         ObjectName namePattern = ObjectNameUtil.createModulePattern(moduleName,
                 instanceName, transactionIdentifier.getName());
         return txModuleJMXRegistrator.queryNames(namePattern, null);
     }
 
     @Override
-    public void checkConfigBeanExists(ObjectName objectName) throws InstanceNotFoundException {
+    public void checkConfigBeanExists(final ObjectName objectName) throws InstanceNotFoundException {
         ObjectNameUtil.checkDomain(objectName);
         ObjectNameUtil.checkType(objectName, ObjectNameUtil.TYPE_MODULE);
         checkTransactionName(objectName);
@@ -108,7 +108,7 @@ class ConfigTransactionLookupRegistry  implements LookupRegistry, Closeable {
         transactionJMXRegistrator.close();
     }
 
-    public void registerMBean(ConfigTransactionControllerInternal transactionController, ObjectName controllerObjectName) throws InstanceAlreadyExistsException {
+    public void registerMBean(final ConfigTransactionControllerInternal transactionController, final ObjectName controllerObjectName) throws InstanceAlreadyExistsException {
         transactionJMXRegistrator.registerMBean(transactionController, controllerObjectName);
     }
 
@@ -129,8 +129,8 @@ class ConfigTransactionLookupRegistry  implements LookupRegistry, Closeable {
      * {@inheritDoc}
      */
     @Override
-    public Set<ObjectName> lookupRuntimeBeans(String moduleName,
-                                              String instanceName) {
+    public Set<ObjectName> lookupRuntimeBeans(final String moduleName,
+                                              final String instanceName) {
         String finalModuleName = moduleName == null ? "*" : moduleName;
         String finalInstanceName = instanceName == null ? "*" : instanceName;
         ObjectName namePattern = ObjectNameUtil.createRuntimeBeanPattern(
index 20e5fe658411f2b694885496b948217a4e59ef48..af58dd2746efe47dc7329ab12f43929545afe8bf 100644 (file)
@@ -29,13 +29,13 @@ public class DeadlockMonitor implements AutoCloseable {
     @GuardedBy("this")
     private ModuleIdentifierWithNanos top = ModuleIdentifierWithNanos.empty;
 
-    public DeadlockMonitor(TransactionIdentifier transactionIdentifier) {
+    public DeadlockMonitor(final TransactionIdentifier transactionIdentifier) {
         this.transactionIdentifier = transactionIdentifier;
         thread = new DeadlockMonitorRunnable();
         thread.start();
     }
 
-    public synchronized void setCurrentlyInstantiatedModule(ModuleIdentifier currentlyInstantiatedModule) {
+    public synchronized void setCurrentlyInstantiatedModule(final ModuleIdentifier currentlyInstantiatedModule) {
 
         boolean popping = currentlyInstantiatedModule == null;
         if (popping) {
@@ -95,7 +95,7 @@ public class DeadlockMonitor implements AutoCloseable {
                 }
                 try {
                     sleep(WARN_AFTER_MILLIS);
-                } catch (InterruptedException e) {
+                } catch (final InterruptedException e) {
                     interrupt();
                 }
             }
@@ -119,18 +119,18 @@ public class DeadlockMonitor implements AutoCloseable {
             this((ModuleIdentifier)null);
         }
 
-        private ModuleIdentifierWithNanos(ModuleIdentifier moduleIdentifier) {
+        private ModuleIdentifierWithNanos(final ModuleIdentifier moduleIdentifier) {
             this.moduleIdentifier = moduleIdentifier;
             nanoTime = System.nanoTime();
         }
 
-        private ModuleIdentifierWithNanos(ModuleIdentifierWithNanos copy) {
+        private ModuleIdentifierWithNanos(final ModuleIdentifierWithNanos copy) {
             moduleIdentifier = copy.moduleIdentifier;
             nanoTime = copy.nanoTime;
         }
 
         @Override
-        public boolean equals(Object o) {
+        public boolean equals(final Object o) {
             if (this == o) {
                 return true;
             }
index 267e504f859fe3bd024bf5eb2d098fdb4904e935..a64d8c33b865e18337b2433a388bfc0e6fff98a5 100644 (file)
@@ -41,12 +41,12 @@ public class ModuleInternalInfo implements Comparable<ModuleInternalInfo>,
     private final ModuleFactory moduleFactory;
     private final BundleContext bundleContext;
 
-    public ModuleInternalInfo(ModuleIdentifier name,
-            @Nullable DynamicReadableWrapper readableModule,
-            OsgiRegistration osgiRegistration,
-            @Nullable RootRuntimeBeanRegistratorImpl runtimeBeanRegistrator,
-            ModuleJMXRegistrator moduleJMXRegistrator, int orderingIdx,
-            boolean isDefaultBean, ModuleFactory moduleFactory, BundleContext bundleContext) {
+    public ModuleInternalInfo(final ModuleIdentifier name,
+            @Nullable final DynamicReadableWrapper readableModule,
+            final OsgiRegistration osgiRegistration,
+            @Nullable final RootRuntimeBeanRegistratorImpl runtimeBeanRegistrator,
+            final ModuleJMXRegistrator moduleJMXRegistrator, final int orderingIdx,
+            final boolean isDefaultBean, final ModuleFactory moduleFactory, final BundleContext bundleContext) {
 
         if (osgiRegistration == null) {
             throw new IllegalArgumentException(
@@ -103,7 +103,7 @@ public class ModuleInternalInfo implements Comparable<ModuleInternalInfo>,
      * Compare using orderingIdx
      */
     @Override
-    public int compareTo(ModuleInternalInfo o) {
+    public int compareTo(final ModuleInternalInfo o) {
         return Integer.compare(orderingIdx, o.orderingIdx);
     }
 
index 85f0af7e54a0343161a13d3682ba3e387f5524ba..baa02edf3c355411cd2561a264dd2ba90a940c82 100644 (file)
@@ -230,7 +230,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
             try {
                 boolean skipChecks = true;
                 newRegistry.saveServiceReference(refNameEntry.getKey(), currentImplementation, skipChecks);
-            } catch (InstanceNotFoundException e) {
+            } catch (final InstanceNotFoundException e) {
                 LOG.error("Cannot save service reference({}, {})", refNameEntry.getKey(), currentImplementation);
                 throw new IllegalStateException("Possible code error", e);
             }
@@ -304,7 +304,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
         ObjectName on;
         try {
             on = lookupRegistry.lookupConfigBean(moduleIdentifier.getFactoryName(), moduleIdentifier.getInstanceName());
-        } catch (InstanceNotFoundException e) {
+        } catch (final InstanceNotFoundException e) {
             LOG.error("Cannot find instance {}", moduleIdentifier);
             throw new IllegalStateException("Cannot find instance " + moduleIdentifier, e);
         }
@@ -411,7 +411,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
             ServiceReferenceJMXRegistration dummyMXBeanRegistration;
             try {
                 dummyMXBeanRegistration = serviceReferenceRegistrator.registerMBean(dummyMXBean, result);
-            } catch (InstanceAlreadyExistsException e) {
+            } catch (final InstanceAlreadyExistsException e) {
                 throw new IllegalStateException("Possible error in code. Cannot register " + result, e);
             }
             mBeans.put(serviceReference, new SimpleImmutableEntry<>(dummyMXBean, dummyMXBeanRegistration));
@@ -473,7 +473,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
         for (ServiceReference serviceReference: mBeans.keySet()) {
             try {
                 removeServiceReference(serviceReference);
-            } catch (InstanceNotFoundException e) {
+            } catch (final InstanceNotFoundException e) {
                 throw new IllegalStateException("Possible error in code", e);
             }
         }
index 15c69bf25fe4db456ae9a7890ad389f8f953251a..5fc5182db39cd1b6f73844a127e12c25cf7e20a0 100644 (file)
@@ -13,7 +13,7 @@ public class TransactionIdentifier implements Identifier {
     private static final long serialVersionUID = 1L;
     private final String name;
 
-    public TransactionIdentifier(String name) {
+    public TransactionIdentifier(final String name) {
         this.name = name;
     }
 
@@ -27,7 +27,7 @@ public class TransactionIdentifier implements Identifier {
     }
 
     @Override
-    public boolean equals(Object o) {
+    public boolean equals(final Object o) {
         if (this == o) {
             return true;
         }
index f8906735b6c12aa70ca80307ba2b40941bbb6a9b..ef4aaddf358cc92e40c47bc5883594728ab3793d 100644 (file)
@@ -150,7 +150,7 @@ public class DependencyResolverManager implements DependencyResolverFactory, Aut
                     cachedInstance = response;
                 }
                 return response;
-            } catch(InvocationTargetException e) {
+            } catch(final InvocationTargetException e) {
                 throw e.getCause();
             } finally {
                 if (isGetInstance) {
index dae6cb27e4b9777e77497a805565a5c57284791c..d449e28dfe9b8a1268dfd40240932e7df6018b03 100644 (file)
@@ -33,9 +33,9 @@ public class DestroyedModule implements AutoCloseable,
     private final int orderingIdx;
     private RootRuntimeBeanRegistratorImpl runtimeBeanRegistrator;
 
-    public DestroyedModule(ModuleIdentifier identifier, AutoCloseable instance,
-                           ModuleJMXRegistrator oldJMXRegistrator,
-                           OsgiRegistration osgiRegistration, int orderingIdx,
+    public DestroyedModule(final ModuleIdentifier identifier, final AutoCloseable instance,
+                           final ModuleJMXRegistrator oldJMXRegistrator,
+                           final OsgiRegistration osgiRegistration, final int orderingIdx,
                            final RootRuntimeBeanRegistratorImpl runtimeBeanRegistrator) {
         this.identifier = identifier;
         this.instance = instance;
@@ -50,30 +50,30 @@ public class DestroyedModule implements AutoCloseable,
         LOG.trace("Destroying {}", identifier);
         try {
             instance.close();
-        } catch (Exception e) {
+        } catch (final Exception e) {
             LOG.error("Error while closing instance of {}", identifier, e);
         }
         try {
             oldJMXRegistrator.close();
-        } catch (Exception e) {
+        } catch (final Exception e) {
             LOG.error("Error while closing jmx registrator of {}", identifier, e);
         }
         try {
             if (runtimeBeanRegistrator != null) {
                 runtimeBeanRegistrator.close();
             }
-        } catch (Exception e) {
+        } catch (final Exception e) {
             LOG.error("Error while closing runtime bean jmx registrator of {}", identifier, e);
         }
         try {
             osgiRegistration.close();
-        } catch (Exception e) {
+        } catch (final Exception e) {
             LOG.error("Error while closing osgi registration of {}", identifier, e);
         }
     }
 
     @Override
-    public int compareTo(DestroyedModule o) {
+    public int compareTo(final DestroyedModule o) {
         return Integer.compare(orderingIdx, o.orderingIdx);
     }
 
index b8d6c26f35363bc3f9c7b29d69b6b2d96ffdb353..3a58b01b405387a6cba60467d170f76c8661d8c0 100644 (file)
@@ -30,11 +30,11 @@ public class ModuleInternalTransactionalInfo implements Identifiable<ModuleIdent
     private final BundleContext bundleContext;
     @Nullable private ModuleInternalInfo maybeOldInternalInfo;
 
-    public ModuleInternalTransactionalInfo(ModuleIdentifier name, Module proxiedModule,
-                                           ModuleFactory moduleFactory,
-                                           ModuleInternalInfo maybeOldInternalInfo,
-                                           TransactionModuleJMXRegistration transactionModuleJMXRegistration,
-                                           boolean isDefaultBean, Module realModule, BundleContext bundleContext) {
+    public ModuleInternalTransactionalInfo(final ModuleIdentifier name, final Module proxiedModule,
+                                           final ModuleFactory moduleFactory,
+                                           final ModuleInternalInfo maybeOldInternalInfo,
+                                           final TransactionModuleJMXRegistration transactionModuleJMXRegistration,
+                                           final boolean isDefaultBean, final Module realModule, final BundleContext bundleContext) {
         this.name = name;
         this.proxiedModule = proxiedModule;
         this.moduleFactory = moduleFactory;
index 25f7e2de9f425e4124e4ae0cd2a1233efbfca0cc..638165a46c709c142c873c834014faf34ebf1572 100644 (file)
@@ -133,7 +133,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
         try {
             configMBeanServer.addNotificationListener(
                     MBeanServerDelegate.DELEGATE_NAME, listener, null, null);
-        } catch (InstanceNotFoundException e) {
+        } catch (final InstanceNotFoundException e) {
             throw new RuntimeException("Could not add notification listener", e);
         }
         return listener;
@@ -201,7 +201,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
                 try {
                     setter = module.getClass().getMethod(method.getName(),
                             method.getParameterTypes());
-                } catch (NoSuchMethodException e) {
+                } catch (final NoSuchMethodException e) {
                     throw new RuntimeException("No such method on "
                             + moduleIdentifier, e);
                 }
@@ -240,7 +240,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
         try {
             obj = internalServer
                     .getAttribute(objectNameInternal, attributeName);
-        } catch (InstanceNotFoundException e) {
+        } catch (final InstanceNotFoundException e) {
             new MBeanException(e);
         }
 
@@ -315,7 +315,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
                 Object value = getAttribute(attributeName);
                 result.add(new Attribute(attributeName, value));
 
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 LOG.debug("Getting attribute {} failed", attributeName, e);
             }
         }
@@ -329,7 +329,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
                 && signature[0].equals(String.class.getName())) {
             try {
                 return getAttribute((String) params[0]);
-            } catch (AttributeNotFoundException e) {
+            } catch (final AttributeNotFoundException e) {
                 throw new MBeanException(e, "Attribute not found on "
                         + moduleIdentifier);
             }
index 6859e4caf3f37dd086a512651146290e8306b53a..e4a427746d45990ca4dcf94dd6066b0c22372a6f 100644 (file)
@@ -46,7 +46,7 @@ public class AnnotationsHelper {
                 // we need to go deeper
                 inspectedClass = inspectedClass.getSuperclass();
                 // no need to go further
-            } catch (NoSuchMethodException e) {
+            } catch (final NoSuchMethodException e) {
                 inspectedClass = Object.class;
             }
         } while (!inspectedClass.equals(Object.class));
@@ -63,7 +63,7 @@ public class AnnotationsHelper {
                 if (annotation != null) {
                     result.add(annotation);
                 }
-            } catch (NoSuchMethodException e) {
+            } catch (final NoSuchMethodException e) {
 
             }
         }
index 1a6192290712efedd11ed79fba48dfc413fb4c75..11d421c3b467e2993fb7b6c889399795c0449ab8 100644 (file)
@@ -38,10 +38,10 @@ class AttributeHolder {
         PERMITTED_PARAMETER_TYPES_FOR_DEPENDENCY_SETTER.add(List.class);
     }
 
-    public AttributeHolder(String name, Object object, String returnType,
-                           boolean writable,
-                           @Nullable RequireInterface requireInterfaceAnnotation,
-                           String description) {
+    public AttributeHolder(final String name, final Object object, final String returnType,
+                           final boolean writable,
+                           @Nullable final RequireInterface requireInterfaceAnnotation,
+                           final String description) {
         if (name == null) {
             throw new NullPointerException();
         }
@@ -98,7 +98,7 @@ class AttributeHolder {
      * @return empty string if no annotation is found, or list of descriptions
      * separated by newline
      */
-    static String findDescription(Method setter, Set<Class<?>> jmxInterfaces) {
+    static String findDescription(final Method setter, final Set<Class<?>> jmxInterfaces) {
         List<Description> descriptions = AnnotationsHelper
                 .findMethodAnnotationInSuperClassesAndIfcs(setter, Description.class, jmxInterfaces);
         return AnnotationsHelper.aggregateDescriptions(descriptions);
@@ -115,7 +115,7 @@ class AttributeHolder {
      * @throws IllegalArgumentException if set of exported interfaces contains non interface type
      */
     static RequireInterface findRequireInterfaceAnnotation(final Method setter,
-                                                           Set<Class<?>> inspectedInterfaces) {
+                                                           final Set<Class<?>> inspectedInterfaces) {
 
         // only allow setX(ObjectName y) or setX(ObjectName[] y) or setX(List<ObjectName> y) to continue
 
index 38c677ce351a4018faad395e9f4302201ea04085..1a43d6f8842229671fb7a52439f938bf5d03a9eb 100644 (file)
@@ -33,9 +33,9 @@ public class DynamicReadableWrapper extends AbstractDynamicWrapper implements
      *            for recreating Module.
      *
      */
-    public DynamicReadableWrapper(Module module, AutoCloseable instance,
-            ModuleIdentifier moduleIdentifier, MBeanServer internalServer,
-            MBeanServer configMBeanServer) {
+    public DynamicReadableWrapper(final Module module, final AutoCloseable instance,
+            final ModuleIdentifier moduleIdentifier, final MBeanServer internalServer,
+            final MBeanServer configMBeanServer) {
         super(module, false, moduleIdentifier, ObjectNameUtil
                 .createReadOnlyModuleON(moduleIdentifier),
                 getEmptyOperations(), internalServer, configMBeanServer);
@@ -53,7 +53,7 @@ public class DynamicReadableWrapper extends AbstractDynamicWrapper implements
     }
 
     @Override
-    public Object invoke(String actionName, Object[] params, String[] signature)
+    public Object invoke(final String actionName, final Object[] params, final String[] signature)
             throws MBeanException, ReflectionException {
         if ("getInstance".equals(actionName)
                 && (params == null || params.length == 0)
@@ -64,7 +64,7 @@ public class DynamicReadableWrapper extends AbstractDynamicWrapper implements
     }
 
     @Override
-    public Object getAttribute(String attributeName)
+    public Object getAttribute(final String attributeName)
             throws AttributeNotFoundException, MBeanException,
             ReflectionException {
         if ("getInstance".equals(attributeName)) {
@@ -74,7 +74,7 @@ public class DynamicReadableWrapper extends AbstractDynamicWrapper implements
     }
 
     @Override
-    public void setAttribute(Attribute attribute)
+    public void setAttribute(final Attribute attribute)
             throws AttributeNotFoundException, InvalidAttributeValueException,
             MBeanException, ReflectionException {
         throw new UnsupportedOperationException(
@@ -82,7 +82,7 @@ public class DynamicReadableWrapper extends AbstractDynamicWrapper implements
     }
 
     @Override
-    public AttributeList setAttributes(AttributeList attributes) {
+    public AttributeList setAttributes(final AttributeList attributes) {
         throw new UnsupportedOperationException(
                 "setAttributes is not supported on " + moduleIdentifier);
     }
index 67ed296f6182d5bab86611f63d5ce2cd39455ad2..90cc62358a80d641d60871b0ba824c104ab96c00 100644 (file)
@@ -52,11 +52,11 @@ public class DynamicWritableWrapper extends AbstractDynamicWrapper {
 
     private final ReadOnlyAtomicBoolean configBeanModificationDisabled;
 
-    public DynamicWritableWrapper(Module module,
-                                  ModuleIdentifier moduleIdentifier,
-                                  String transactionIdentifier,
-                                  ReadOnlyAtomicBoolean configBeanModificationDisabled,
-                                  MBeanServer internalServer, MBeanServer configMBeanServer) {
+    public DynamicWritableWrapper(final Module module,
+                                  final ModuleIdentifier moduleIdentifier,
+                                  final String transactionIdentifier,
+                                  final ReadOnlyAtomicBoolean configBeanModificationDisabled,
+                                  final MBeanServer internalServer, final MBeanServer configMBeanServer) {
         super(module, true, moduleIdentifier, ObjectNameUtil
                         .createTransactionModuleON(transactionIdentifier, moduleIdentifier), getOperations(moduleIdentifier),
                 internalServer, configMBeanServer);
@@ -64,18 +64,18 @@ public class DynamicWritableWrapper extends AbstractDynamicWrapper {
     }
 
     private static MBeanOperationInfo[] getOperations(
-            ModuleIdentifier moduleIdentifier) {
+            final ModuleIdentifier moduleIdentifier) {
         Method validationMethod;
         try {
             validationMethod = DynamicWritableWrapper.class.getMethod("validate");
-        } catch (NoSuchMethodException e) {
+        } catch (final NoSuchMethodException e) {
             throw new IllegalStateException("No such method exception on " + moduleIdentifier, e);
         }
         return new MBeanOperationInfo[]{new MBeanOperationInfo("Validation", validationMethod)};
     }
 
     @Override
-    public synchronized void setAttribute(Attribute attribute)
+    public synchronized void setAttribute(final Attribute attribute)
             throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException {
         Attribute newAttribute = attribute;
         if (configBeanModificationDisabled.get()) {
@@ -95,13 +95,13 @@ public class DynamicWritableWrapper extends AbstractDynamicWrapper {
             }
 
             internalServer.setAttribute(objectNameInternal, newAttribute);
-        } catch (InstanceNotFoundException e) {
+        } catch (final InstanceNotFoundException e) {
             throw new MBeanException(e);
         }
 
     }
 
-    private Attribute fixDependencyListAttribute(Attribute attribute) {
+    private Attribute fixDependencyListAttribute(final Attribute attribute) {
         Attribute newAttribute = attribute;
         AttributeHolder attributeHolder = attributeHolderMap.get(newAttribute.getName());
         if (attributeHolder.getRequireInterfaceOrNull() != null) {
@@ -110,7 +110,7 @@ public class DynamicWritableWrapper extends AbstractDynamicWrapper {
         return newAttribute;
     }
 
-    private Attribute fixDependencyAttribute(Attribute attribute) {
+    private Attribute fixDependencyAttribute(final Attribute attribute) {
         Attribute newAttribute = attribute;
         AttributeHolder attributeHolder = attributeHolderMap.get(newAttribute.getName());
         if (attributeHolder.getRequireInterfaceOrNull() != null) {
@@ -121,7 +121,7 @@ public class DynamicWritableWrapper extends AbstractDynamicWrapper {
         return newAttribute;
     }
 
-    private ObjectName[] fixObjectNames(ObjectName[] dependencies) {
+    private ObjectName[] fixObjectNames(final ObjectName[] dependencies) {
         int i = 0;
 
         for (ObjectName dependencyOn : dependencies) {
@@ -132,14 +132,14 @@ public class DynamicWritableWrapper extends AbstractDynamicWrapper {
     }
 
     @Override
-    public AttributeList setAttributes(AttributeList attributes) {
+    public AttributeList setAttributes(final AttributeList attributes) {
         AttributeList result = new AttributeList();
         for (Object attributeObject : attributes) {
             Attribute attribute = (Attribute) attributeObject;
             try {
                 setAttribute(attribute);
                 result.add(attribute);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 LOG.warn("Setting attribute {} failed on {}", attribute.getName(), moduleIdentifier, e);
                 throw new IllegalArgumentException(
                         "Setting attribute failed - " + attribute.getName()
@@ -150,14 +150,14 @@ public class DynamicWritableWrapper extends AbstractDynamicWrapper {
     }
 
     @Override
-    public Object invoke(String actionName, Object[] params, String[] signature)
+    public Object invoke(final String actionName, final Object[] params, final String[] signature)
             throws MBeanException, ReflectionException {
         if ("validate".equals(actionName)
                 && (params == null || params.length == 0)
                 && (signature == null || signature.length == 0)) {
             try {
                 validate();
-            } catch (Exception e) {
+            } catch (final Exception e) {
 
                 throw new MBeanException(ValidationException.createForSingleException(
                         moduleIdentifier, e));
index 583e8b46e8ab8402cd23765bac5506c3dbbb1121..8abb635755e64136df06548c82656a5d017f3329 100644 (file)
@@ -16,7 +16,7 @@ public interface ReadOnlyAtomicBoolean {
             ReadOnlyAtomicBoolean {
         private final AtomicBoolean atomicBoolean;
 
-        public ReadOnlyAtomicBooleanImpl(AtomicBoolean atomicBoolean) {
+        public ReadOnlyAtomicBooleanImpl(final AtomicBoolean atomicBoolean) {
             super();
             this.atomicBoolean = atomicBoolean;
         }
index 02d1d97677b04064b3890984795807a7d0963ff0..63be03f8ad228c5cd8ac08b0f2f926d482f343a9 100644 (file)
@@ -35,7 +35,7 @@ public class HierarchicalConfigMBeanFactoriesHolder {
      *             if unique constraint on module names is violated
      */
     public HierarchicalConfigMBeanFactoriesHolder(
-            Map<String, Map.Entry<ModuleFactory, BundleContext>> factoriesMap) {
+            final Map<String, Map.Entry<ModuleFactory, BundleContext>> factoriesMap) {
         this.moduleNamesToConfigBeanFactories = Collections
                 .unmodifiableMap(factoriesMap);
         moduleNames = Collections.unmodifiableSet(new TreeSet<>(
@@ -54,7 +54,7 @@ public class HierarchicalConfigMBeanFactoriesHolder {
      * @throws IllegalArgumentException
      *             if factory is not found
      */
-    public ModuleFactory findByModuleName(String moduleName) {
+    public ModuleFactory findByModuleName(final String moduleName) {
         Map.Entry<ModuleFactory, BundleContext> result = moduleNamesToConfigBeanFactories.get(moduleName);
         if (result == null) {
             throw new ModuleFactoryNotFoundException(moduleName);
index 2b0e525656723d7ffc3d0082b6c5744c41516eda..f621392e79bc7cf74fe0fd3dd841611ed629b5bc 100644 (file)
@@ -23,9 +23,9 @@ public class HierarchicalRuntimeBeanRegistrationImpl implements
     private final Map<String, String> properties;
 
     public HierarchicalRuntimeBeanRegistrationImpl(
-            ModuleIdentifier moduleIdentifier,
-            InternalJMXRegistrator internalJMXRegistrator,
-            Map<String, String> properties) {
+            final ModuleIdentifier moduleIdentifier,
+            final InternalJMXRegistrator internalJMXRegistrator,
+            final Map<String, String> properties) {
         this.moduleIdentifier = moduleIdentifier;
         this.internalJMXRegistrator = internalJMXRegistrator;
         this.properties = properties;
@@ -39,8 +39,8 @@ public class HierarchicalRuntimeBeanRegistrationImpl implements
     }
 
     @Override
-    public HierarchicalRuntimeBeanRegistrationImpl register(String key,
-            String value, RuntimeBean mxBean) {
+    public HierarchicalRuntimeBeanRegistrationImpl register(final String key,
+            final String value, final RuntimeBean mxBean) {
         Map<String, String> currentProperties = new HashMap<>(properties);
         currentProperties.put(key, value);
         ObjectName on = ObjectNameUtil.createRuntimeBeanName(
@@ -49,7 +49,7 @@ public class HierarchicalRuntimeBeanRegistrationImpl implements
         InternalJMXRegistrator child = internalJMXRegistrator.createChild();
         try {
             child.registerMBean(mxBean, on);
-        } catch (InstanceAlreadyExistsException e) {
+        } catch (final InstanceAlreadyExistsException e) {
             throw RootRuntimeBeanRegistratorImpl.sanitize(e, moduleIdentifier,
                     on);
         }
index 71656c27bcc0559c91a42bb1049faad30da5077d..147d6ee36994739f577bad8b144a8627ddaed135 100644 (file)
@@ -75,9 +75,9 @@ abstract class InternalJMXRegistrator implements AutoCloseable {
             throws InstanceAlreadyExistsException {
         try {
             getMBeanServer().registerMBean(object, on);
-        } catch (NotCompliantMBeanException e) {
+        } catch (final NotCompliantMBeanException e) {
             throw new IllegalArgumentException("Object does not comply to JMX", e);
-        } catch (MBeanRegistrationException e) {
+        } catch (final MBeanRegistrationException e) {
             throw new IllegalStateException("Failed to register " + on, e);
         }
 
@@ -92,9 +92,9 @@ abstract class InternalJMXRegistrator implements AutoCloseable {
 
         try {
             getMBeanServer().unregisterMBean(on);
-        } catch (InstanceNotFoundException e) {
+        } catch (final InstanceNotFoundException e) {
             LOG.warn("MBean {} not found on server", on, e);
-        } catch (MBeanRegistrationException e) {
+        } catch (final MBeanRegistrationException e) {
             throw new IllegalStateException("Failed to unregister MBean " + on, e);
         }
     }
@@ -159,7 +159,7 @@ abstract class InternalJMXRegistrator implements AutoCloseable {
         for (ObjectName on : registeredObjectNames) {
             try {
                 getMBeanServer().unregisterMBean(on);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 LOG.warn("Ignoring error while unregistering {}", on, e);
             }
         }
index 8bccef3b8168c6030964017a5b29ba927c8e6166..1f29a656045282cf0989baa2125b56ca31b9c247 100644 (file)
@@ -36,7 +36,7 @@ public class RootRuntimeBeanRegistratorImpl implements
     public HierarchicalRuntimeBeanRegistrationImpl registerRoot(final RuntimeBean mxBean) {
         try {
             internalJMXRegistrator.registerMBean(mxBean, defaultRuntimeON);
-        } catch (InstanceAlreadyExistsException e) {
+        } catch (final InstanceAlreadyExistsException e) {
             throw sanitize(e, moduleIdentifier, defaultRuntimeON);
         }
         return new HierarchicalRuntimeBeanRegistrationImpl(moduleIdentifier,
index 3455569ee8a579bc2cdfbe3a9fe401cb897b7317..9388b8e567d256eea035047da2d5552f0bc7b17f 100644 (file)
@@ -11,7 +11,7 @@ public class ServiceReference {
     private final String serviceInterfaceName;
     private final String refName;
 
-    public ServiceReference(String serviceInterfaceName, String refName) {
+    public ServiceReference(final String serviceInterfaceName, final String refName) {
         this.serviceInterfaceName = serviceInterfaceName;
         this.refName = refName;
     }
@@ -25,7 +25,7 @@ public class ServiceReference {
     }
 
     @Override
-    public boolean equals(Object o) {
+    public boolean equals(final Object o) {
         if (this == o) {
             return true;
         }
index ba6676b927bb554d296b2ebaa9efd3205bdebc4c..b4938f32fb9b9bcc5fa8c5ada2170cc29f3cd26c 100644 (file)
@@ -13,7 +13,7 @@ import org.opendaylight.controller.config.api.jmx.ServiceReferenceMXBean;
 public class ServiceReferenceMXBeanImpl implements ServiceReferenceMXBean {
     private ObjectName currentImplementation;
 
-    public ServiceReferenceMXBeanImpl(ObjectName currentImplementation) {
+    public ServiceReferenceMXBeanImpl(final ObjectName currentImplementation) {
         this.currentImplementation = currentImplementation;
     }
 
@@ -22,7 +22,7 @@ public class ServiceReferenceMXBeanImpl implements ServiceReferenceMXBean {
         return currentImplementation;
     }
 
-    public void setCurrentImplementation(ObjectName currentImplementation) {
+    public void setCurrentImplementation(final ObjectName currentImplementation) {
         this.currentImplementation = currentImplementation;
     }
 }
index fa0c52699a7b1242a13caec363c43af2483c34d7..e9db0715e5758f239bc2cffa397e5846f5a3e1cd 100644 (file)
@@ -24,7 +24,7 @@ public interface ServiceReferenceRegistrator extends AutoCloseable {
     class ServiceReferenceJMXRegistration implements AutoCloseable {
         private final InternalJMXRegistration registration;
 
-        ServiceReferenceJMXRegistration(InternalJMXRegistration registration) {
+        ServiceReferenceJMXRegistration(final InternalJMXRegistration registration) {
             this.registration = registration;
         }
 
@@ -42,7 +42,7 @@ public interface ServiceReferenceRegistrator extends AutoCloseable {
         private final InternalJMXRegistrator currentJMXRegistrator;
         private final String nullableTransactionName;
 
-        public ServiceReferenceRegistratorImpl(NestableJMXRegistrator parentRegistrator, String nullableTransactionName){
+        public ServiceReferenceRegistratorImpl(final NestableJMXRegistrator parentRegistrator, final String nullableTransactionName){
             currentJMXRegistrator = parentRegistrator.createChild();
             this.nullableTransactionName = nullableTransactionName;
         }
@@ -54,8 +54,8 @@ public interface ServiceReferenceRegistrator extends AutoCloseable {
 
 
         @Override
-        public ServiceReferenceJMXRegistration registerMBean(ServiceReferenceMXBeanImpl object,
-                                                             ObjectName on) throws InstanceAlreadyExistsException {
+        public ServiceReferenceJMXRegistration registerMBean(final ServiceReferenceMXBeanImpl object,
+                                                             final ObjectName on) throws InstanceAlreadyExistsException {
             String actualTransactionName = ObjectNameUtil.getTransactionName(on);
             boolean broken = false;
             broken |= (nullableTransactionName == null) != (actualTransactionName == null);
@@ -85,13 +85,13 @@ public interface ServiceReferenceRegistrator extends AutoCloseable {
         private final NestableJMXRegistrator parentRegistrator;
         private final String nullableTransactionName;
 
-        public ServiceReferenceTransactionRegistratorFactoryImpl(TransactionModuleJMXRegistrator parentRegistrator,
-                                                             String nullableTransactionName) {
+        public ServiceReferenceTransactionRegistratorFactoryImpl(final TransactionModuleJMXRegistrator parentRegistrator,
+                                                             final String nullableTransactionName) {
             this.parentRegistrator = parentRegistrator;
             this.nullableTransactionName = nullableTransactionName;
         }
 
-        public ServiceReferenceTransactionRegistratorFactoryImpl(BaseJMXRegistrator baseJMXRegistrator) {
+        public ServiceReferenceTransactionRegistratorFactoryImpl(final BaseJMXRegistrator baseJMXRegistrator) {
             this.parentRegistrator = baseJMXRegistrator;
             this.nullableTransactionName = null;
         }
index 81e5ae6e2236dd90f3cc3552cd7d506f56957ccb..dbffe4cc9040bf2f4c8aeea165956c5b9dc2b2b4 100644 (file)
@@ -19,8 +19,8 @@ public class TransactionModuleJMXRegistrator implements Closeable, NestableJMXRe
     private final String transactionName;
 
     public TransactionModuleJMXRegistrator(
-            InternalJMXRegistrator internalJMXRegistrator,
-            String transactionName) {
+            final InternalJMXRegistrator internalJMXRegistrator,
+            final String transactionName) {
         this.currentJMXRegistrator = internalJMXRegistrator.createChild();
         this.transactionName = transactionName;
     }
@@ -29,7 +29,7 @@ public class TransactionModuleJMXRegistrator implements Closeable, NestableJMXRe
             AutoCloseable {
         private final InternalJMXRegistration registration;
 
-        TransactionModuleJMXRegistration(InternalJMXRegistration registration) {
+        TransactionModuleJMXRegistration(final InternalJMXRegistration registration) {
             this.registration = registration;
         }
 
@@ -39,8 +39,8 @@ public class TransactionModuleJMXRegistrator implements Closeable, NestableJMXRe
         }
     }
 
-    public TransactionModuleJMXRegistration registerMBean(Object object,
-            ObjectName on) throws InstanceAlreadyExistsException {
+    public TransactionModuleJMXRegistration registerMBean(final Object object,
+            final ObjectName on) throws InstanceAlreadyExistsException {
         if (!transactionName.equals(ObjectNameUtil.getTransactionName(on))) {
             throw new IllegalArgumentException("Transaction name mismatch between expected "
                             + transactionName + " " + "and " + on);
@@ -50,7 +50,7 @@ public class TransactionModuleJMXRegistrator implements Closeable, NestableJMXRe
                 currentJMXRegistrator.registerMBean(object, on));
     }
 
-    public Set<ObjectName> queryNames(ObjectName name, QueryExp query) {
+    public Set<ObjectName> queryNames(final ObjectName name, final QueryExp query) {
         return currentJMXRegistrator.queryNames(name, query);
     }
 
index 51f99403148ba7b40301e52b63b391ae98c0134e..ff504dafdcac22176d798569836bfe6e5ce460c7 100644 (file)
@@ -34,9 +34,9 @@ public class BeanToOsgiServiceManager {
      * It is expected that before using this method OSGi service registry will
      * be cleaned from previous registrations.
      */
-    public OsgiRegistration registerToOsgi(AutoCloseable instance, ModuleIdentifier moduleIdentifier,
-                                           BundleContext bundleContext,
-                                           Map<ServiceInterfaceAnnotation, String /* service ref name */> serviceNamesToAnnotations) {
+    public OsgiRegistration registerToOsgi(final AutoCloseable instance, final ModuleIdentifier moduleIdentifier,
+                                           final BundleContext bundleContext,
+                                           final Map<ServiceInterfaceAnnotation, String /* service ref name */> serviceNamesToAnnotations) {
         return new OsgiRegistration(instance, moduleIdentifier, bundleContext, serviceNamesToAnnotations);
     }
 
@@ -51,17 +51,17 @@ public class BeanToOsgiServiceManager {
         @GuardedBy("this")
         private final Map<ServiceInterfaceAnnotation, String /* service ref name */> serviceNamesToAnnotations;
 
-        public OsgiRegistration(AutoCloseable instance, ModuleIdentifier moduleIdentifier,
-                                BundleContext bundleContext,
-                                Map<ServiceInterfaceAnnotation, String /* service ref name */> serviceNamesToAnnotations) {
+        public OsgiRegistration(final AutoCloseable instance, final ModuleIdentifier moduleIdentifier,
+                                final BundleContext bundleContext,
+                                final Map<ServiceInterfaceAnnotation, String /* service ref name */> serviceNamesToAnnotations) {
             this.instance = instance;
             this.moduleIdentifier = moduleIdentifier;
             this.serviceNamesToAnnotations = serviceNamesToAnnotations;
             this.serviceRegistrations = registerToSR(instance, bundleContext, serviceNamesToAnnotations);
         }
 
-        private static Set<ServiceRegistration<?>> registerToSR(AutoCloseable instance, BundleContext bundleContext,
-                                                                Map<ServiceInterfaceAnnotation, String /* service ref name */> serviceNamesToAnnotations) {
+        private static Set<ServiceRegistration<?>> registerToSR(final AutoCloseable instance, final BundleContext bundleContext,
+                                                                final Map<ServiceInterfaceAnnotation, String /* service ref name */> serviceNamesToAnnotations) {
             Set<ServiceRegistration<?>> serviceRegistrations = new HashSet<>();
             for (Entry<ServiceInterfaceAnnotation, String /* service ref name */> entry : serviceNamesToAnnotations.entrySet()) {
                 ServiceInterfaceAnnotation annotation = entry.getKey();
@@ -87,15 +87,15 @@ public class BeanToOsgiServiceManager {
             for (ServiceRegistration<?> serviceRegistration : serviceRegistrations) {
                 try {
                     serviceRegistration.unregister();
-                } catch(IllegalStateException e) {
+                } catch(final IllegalStateException e) {
                     LOG.trace("Cannot unregister {}", serviceRegistration, e);
                 }
             }
             serviceRegistrations.clear();
         }
 
-        public synchronized void updateRegistrations(Map<ServiceInterfaceAnnotation, String /* service ref name */> newAnnotationMapping,
-                                                     BundleContext bundleContext, AutoCloseable newInstance) {
+        public synchronized void updateRegistrations(final Map<ServiceInterfaceAnnotation, String /* service ref name */> newAnnotationMapping,
+                                                     final BundleContext bundleContext, final AutoCloseable newInstance) {
             boolean notEquals = !this.instance.equals(newInstance);
             notEquals |= !newAnnotationMapping.equals(serviceNamesToAnnotations);
             if (notEquals) {
@@ -110,7 +110,7 @@ public class BeanToOsgiServiceManager {
             }
         }
 
-        private static Dictionary<String, String> createProps(String serviceName) {
+        private static Dictionary<String, String> createProps(final String serviceName) {
             Hashtable<String, String> result = new Hashtable<>();
             result.put(SERVICE_NAME_OSGI_PROP, serviceName);
             return result;
index a15820556c4a9a76ac45f80ccf89a317df646d53..8ec44a14ba5219a98b7f486112535a4286b2c959 100644 (file)
@@ -57,7 +57,7 @@ public class BlankTransactionServiceTracker implements ServiceTrackerCustomizer<
     }
 
     @Override
-    public Object addingService(ServiceReference<ModuleFactory> moduleFactoryServiceReference) {
+    public Object addingService(final ServiceReference<ModuleFactory> moduleFactoryServiceReference) {
         blankTransactionAsync();
         return null;
     }
@@ -75,16 +75,16 @@ public class BlankTransactionServiceTracker implements ServiceTrackerCustomizer<
                 CommitStatus commitStatus = blankTransaction.hit();
                 LOG.debug("Committed blank transaction with status {}", commitStatus);
                 return;
-            } catch (ConflictingVersionException e) {
+            } catch (final ConflictingVersionException e) {
                 lastException = e;
                 try {
                     Thread.sleep(1000);
-                } catch (InterruptedException interruptedException) {
+                } catch (final InterruptedException interruptedException) {
                     Thread.currentThread().interrupt();
                     LOG.debug("blankTransactionSync was interrupted");
                     return;
                 }
-            } catch (ValidationException e) {
+            } catch (final ValidationException e) {
                 LOG.error("Validation exception while running blank transaction indicates programming error", e);
             }
         }
@@ -94,12 +94,12 @@ public class BlankTransactionServiceTracker implements ServiceTrackerCustomizer<
     }
 
     @Override
-    public void modifiedService(ServiceReference <ModuleFactory> moduleFactoryServiceReference, Object o) {
+    public void modifiedService(final ServiceReference <ModuleFactory> moduleFactoryServiceReference, final Object o) {
         blankTransactionAsync();
     }
 
     @Override
-    public void removedService(ServiceReference<ModuleFactory> moduleFactoryServiceReference, Object o) {
+    public void removedService(final ServiceReference<ModuleFactory> moduleFactoryServiceReference, final Object o) {
         blankTransactionAsync();
     }
 
index 0cbbbab912d3cce521fda7de34837092613b9a47..1926c6b9af3e4adbed9acf27bb9cd44007ed2e3e 100644 (file)
@@ -36,7 +36,7 @@ public class BundleContextBackedModuleFactoriesResolver implements ModuleFactori
         Collection<ServiceReference<ModuleFactory>> serviceReferences;
         try {
             serviceReferences = bundleContext.getServiceReferences(ModuleFactory.class, null);
-        } catch (InvalidSyntaxException e) {
+        } catch (final InvalidSyntaxException e) {
             throw new IllegalStateException(e);
         }
         Map<String, Map.Entry<ModuleFactory, BundleContext>> result = new HashMap<>(serviceReferences.size());
index 6969a3b6570435248ecd03fb3fb48bdc7dc9d8ce..5841acfde8683541efdb3de605f548627a0593bc 100644 (file)
@@ -80,7 +80,7 @@ public final class ExtensibleBundleTracker<T> extends BundleTracker<Future<T>> {
                 forEachAdditionalBundle(tracker -> tracker.addingBundle(bundle, event));
                 LOG.trace("AddingBundle for {} and event {} finished successfully",bundle,event);
                 return primaryTrackerRetVal;
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 LOG.error("Failed to add bundle {}", bundle, e);
                 throw e;
             }
@@ -106,7 +106,7 @@ public final class ExtensibleBundleTracker<T> extends BundleTracker<Future<T>> {
             primaryTracker.removedBundle(bundle, event, object.get());
             forEachAdditionalBundle(tracker -> tracker.removedBundle(bundle, event, null));
             LOG.trace("Removed bundle event for {} finished successfully.",bundle);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             LOG.error("Failed to remove bundle {}", bundle, e);
         }
     }
index 8ca5da282511b88ee4cf5e7ea2887ecfba634b4b..5e706250afe1c9d04df04d371d5d096eaca2f475 100644 (file)
@@ -33,12 +33,12 @@ public class ModuleFactoryBundleTracker implements BundleTrackerCustomizer<Boole
     private final BlankTransactionServiceTracker blankTransactionServiceTracker;
     private static final Logger LOG = LoggerFactory.getLogger(ModuleFactoryBundleTracker.class);
 
-    public ModuleFactoryBundleTracker(BlankTransactionServiceTracker blankTransactionServiceTracker) {
+    public ModuleFactoryBundleTracker(final BlankTransactionServiceTracker blankTransactionServiceTracker) {
         this.blankTransactionServiceTracker = blankTransactionServiceTracker;
     }
 
     @Override
-    public Boolean addingBundle(Bundle bundle, BundleEvent event) {
+    public Boolean addingBundle(final Bundle bundle, final BundleEvent event) {
         URL resource = bundle.getEntry("META-INF/services/" + ModuleFactory.class.getName());
         LOG.trace("Got addingBundle event of bundle {}, resource {}, event {}",
                 bundle, resource, event);
@@ -49,7 +49,7 @@ public class ModuleFactoryBundleTracker implements BundleTrackerCustomizer<Boole
                 }
 
                 return Boolean.TRUE;
-            } catch (IOException e) {
+            } catch (final IOException e) {
                 LOG.error("Error while reading {}", resource, e);
                 throw new RuntimeException(e);
             }
@@ -59,12 +59,12 @@ public class ModuleFactoryBundleTracker implements BundleTrackerCustomizer<Boole
     }
 
     @Override
-    public void modifiedBundle(Bundle bundle, BundleEvent event, Boolean hasFactory) {
+    public void modifiedBundle(final Bundle bundle, final BundleEvent event, final Boolean hasFactory) {
         // NOOP
     }
 
     @Override
-    public void removedBundle(Bundle bundle, BundleEvent event, Boolean hasFactory) {
+    public void removedBundle(final Bundle bundle, final BundleEvent event, final Boolean hasFactory) {
         if(hasFactory) {
             // workaround for service tracker not getting removed service event
             blankTransactionServiceTracker.blankTransactionSync();
@@ -72,7 +72,7 @@ public class ModuleFactoryBundleTracker implements BundleTrackerCustomizer<Boole
     }
 
     @VisibleForTesting
-    protected static ServiceRegistration<?> registerFactory(String factoryClassName, Bundle bundle) {
+    protected static ServiceRegistration<?> registerFactory(final String factoryClassName, final Bundle bundle) {
         String errorMessage;
         Exception ex = null;
         try {
@@ -84,12 +84,12 @@ public class ModuleFactoryBundleTracker implements BundleTrackerCustomizer<Boole
                     return bundle.getBundleContext().registerService(
                             ModuleFactory.class.getName(), clazz.newInstance(),
                             null);
-                } catch (InstantiationException e) {
+                } catch (final InstantiationException e) {
                     errorMessage = logMessage(
                             "Could not instantiate {} in bundle {}, reason {}",
                             factoryClassName, bundle, e);
                     ex = e;
-                } catch (IllegalAccessException e) {
+                } catch (final IllegalAccessException e) {
                     errorMessage = logMessage(
                             "Illegal access during instantiation of class {} in bundle {}, reason {}",
                             factoryClassName, bundle, e);
@@ -100,7 +100,7 @@ public class ModuleFactoryBundleTracker implements BundleTrackerCustomizer<Boole
                         "Class {} does not implement {} in bundle {}", clazz,
                         ModuleFactory.class, bundle);
             }
-        } catch (ClassNotFoundException e) {
+        } catch (final ClassNotFoundException e) {
             errorMessage = logMessage(
                     "Could not find class {} in bundle {}, reason {}",
                     factoryClassName, bundle, e);
@@ -110,7 +110,7 @@ public class ModuleFactoryBundleTracker implements BundleTrackerCustomizer<Boole
         throw ex == null ? new IllegalStateException(errorMessage) : new IllegalStateException(errorMessage, ex);
     }
 
-    public static String logMessage(String slfMessage, Object... params) {
+    public static String logMessage(final String slfMessage, final Object... params) {
         LOG.info(slfMessage, params);
         String formatMessage = slfMessage.replaceAll("\\{\\}", "%s");
         return String.format(formatMessage, params);
index c6597071f734851f2038f0130f828c599fbb8624..169d1e6ec84e8f9f27bc7bd13c120c1c3dbcdd39 100644 (file)
@@ -90,9 +90,9 @@ public final class ModuleInfoBundleTracker implements AutoCloseable,
             if(!starting) {
                 moduleInfoRegistry.updateService();
             }
-        } catch (IOException e) {
+        } catch (final IOException e) {
             LOG.error("Error while reading {} from bundle {}", resource, bundle, e);
-        } catch (RuntimeException e) {
+        } catch (final RuntimeException e) {
             LOG.error("Failed to process {} for bundle {}", resource, bundle, e);
         }
 
@@ -115,7 +115,7 @@ public final class ModuleInfoBundleTracker implements AutoCloseable,
         for (ObjectRegistration<YangModuleInfo> reg : regs) {
             try {
                 reg.close();
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 LOG.error("Unable to unregister YangModuleInfo {}", reg.getInstance(), e);
             }
         }
@@ -134,10 +134,10 @@ public final class ModuleInfoBundleTracker implements AutoCloseable,
         try {
             Object instanceObj = clazz.newInstance();
             instance = YangModelBindingProvider.class.cast(instanceObj);
-        } catch (InstantiationException e) {
+        } catch (final InstantiationException e) {
             errorMessage = logMessage("Could not instantiate {} in bundle {}, reason {}", moduleInfoClass, bundle, e);
             throw new IllegalStateException(errorMessage, e);
-        } catch (IllegalAccessException e) {
+        } catch (final IllegalAccessException e) {
             errorMessage = logMessage("Illegal access during instantiation of class {} in bundle {}, reason {}",
                     moduleInfoClass, bundle, e);
             throw new IllegalStateException(errorMessage, e);
@@ -153,7 +153,7 @@ public final class ModuleInfoBundleTracker implements AutoCloseable,
     private static Class<?> loadClass(final String moduleInfoClass, final Bundle bundle) {
         try {
             return bundle.loadClass(moduleInfoClass);
-        } catch (ClassNotFoundException e) {
+        } catch (final ClassNotFoundException e) {
             String errorMessage = logMessage("Could not find class {} in bundle {}, reason {}", moduleInfoClass,
                 bundle, e);
             throw new IllegalStateException(errorMessage);
index 0572bd9350c4a0e9beaf9536d53fbb42314626dd..fd1e37a98f795300444132f85ebecab30e2b988e 100644 (file)
@@ -17,8 +17,8 @@ public class LookupBeansUtil {
     private LookupBeansUtil() {
     }
 
-    public static ObjectName lookupConfigBean(LookupRegistry lookupRegistry,
-            String moduleName, String instanceName)
+    public static ObjectName lookupConfigBean(final LookupRegistry lookupRegistry,
+            final String moduleName, final String instanceName)
             throws InstanceNotFoundException {
         Set<ObjectName> objectNames = lookupRegistry.lookupConfigBeans(
                 moduleName, instanceName);
index e5858ac2ee1231170b99f89ce8044d0a40dc1f21..1fa97acd2fe403f0dc13228b3acdab180d6a2f4e 100644 (file)
@@ -21,9 +21,9 @@ public class ModuleQNameUtil {
     private ModuleQNameUtil() {
     }
 
-    public static Set<String> getQNames(Map<String, Entry<ModuleFactory, BundleContext>> resolved) {
-        Set<String> result = new HashSet<>();
-        for (Entry<ModuleFactory, BundleContext> entry : resolved.values()) {
+    public static Set<String> getQNames(final Map<String, Entry<ModuleFactory, BundleContext>> resolved) {
+        final Set<String> result = new HashSet<>();
+        for (final Entry<ModuleFactory, BundleContext> entry : resolved.values()) {
             Class<?> inspected = entry.getKey().getClass();
             if (inspected.isInterface()) {
                 throw new IllegalArgumentException("Unexpected interface " + inspected);
index 7c02019544977b8e33d4ecd08ad91d2ab6af3642..607cf49db9c02cf770a747a839cce715a52ade5a 100644 (file)
@@ -64,7 +64,7 @@ public class OsgiRegistrationUtil {
                 AutoCloseable ac = it.previous();
                 try {
                     ac.close();
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     LOG.warn("Exception while closing {}", ac, e);
                     if (firstException == null) {
                         firstException = e;
index ee47316f8d546716872c34aff2680cd03233acc2..5fc5884531413de103d51ea32d4db8f4166c8a15 100644 (file)
@@ -43,7 +43,7 @@ public class ConfigRegistryImplTest extends
 
             configRegistry.beginConfig();
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertTrue(
                     e.getMessage(),
                     e.getMessage()
@@ -53,7 +53,7 @@ public class ConfigRegistryImplTest extends
         } finally {
             try {
                 configRegistry.close();
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // ignore
                 LOG.warn("Ignoring exception", e);
             }
index a6e24e9a495fe0df079952144ee440e02732cea0..7681b00d90a509a0710eeda2283e0807aa4e080c 100644 (file)
@@ -18,13 +18,13 @@ public abstract class AbstractMockedModule implements Module {
 
     protected abstract AutoCloseable prepareMockedInstance() throws Exception;
 
-    public AbstractMockedModule(DynamicMBeanWithInstance old, ModuleIdentifier id) {
+    public AbstractMockedModule(final DynamicMBeanWithInstance old, final ModuleIdentifier id) {
         if(old!=null)
             instance = old.getInstance();
         else
             try {
                 instance = prepareMockedInstance();
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new RuntimeException(e);
             }
 
@@ -33,7 +33,7 @@ public abstract class AbstractMockedModule implements Module {
 
 
     @Override
-    public boolean canReuse(Module oldModule) {
+    public boolean canReuse(final Module oldModule) {
         return instance!=null;
     }
 
index 170878a6ed4614cef12a833362f91c6fef920d81..451d85f7805030ee363554ea3b007e455914133c 100644 (file)
@@ -42,8 +42,8 @@ public class ClassBasedModuleFactory implements ModuleFactory {
      *            This class must implement Module interface and all exported
      *            interfaces.
      */
-    public ClassBasedModuleFactory(String implementationName,
-            Class<? extends Module> configBeanClass) {
+    public ClassBasedModuleFactory(final String implementationName,
+            final Class<? extends Module> configBeanClass) {
         this.implementationName = implementationName;
         this.configBeanClass = configBeanClass;
     }
@@ -54,20 +54,20 @@ public class ClassBasedModuleFactory implements ModuleFactory {
     }
 
     @Override
-    public Module createModule(String instanceName,
-            DependencyResolver dependencyResolver, DynamicMBeanWithInstance old, BundleContext bundleContext)
+    public Module createModule(final String instanceName,
+            final DependencyResolver dependencyResolver, final DynamicMBeanWithInstance old, final BundleContext bundleContext)
             throws Exception {
         Preconditions.checkNotNull(old);
         return constructModule(instanceName, dependencyResolver, old);
     }
 
-    private Module constructModule(String instanceName, DependencyResolver dependencyResolver, DynamicMBeanWithInstance old) throws InstantiationException, IllegalAccessException, InvocationTargetException {
+    private Module constructModule(final String instanceName, final DependencyResolver dependencyResolver, final DynamicMBeanWithInstance old) throws InstantiationException, IllegalAccessException, InvocationTargetException {
         Preconditions.checkNotNull(dependencyResolver);
         ModuleIdentifier moduleIdentifier = new ModuleIdentifier(implementationName, instanceName);
         Constructor<? extends Module> declaredConstructor;
         try {
             declaredConstructor = configBeanClass.getDeclaredConstructor(DynamicMBeanWithInstance.class, ModuleIdentifier.class);
-        } catch (NoSuchMethodException e) {
+        } catch (final NoSuchMethodException e) {
             throw new IllegalStateException(
                     "Did not find constructor with parameters (DynamicMBeanWithInstance) in "
                             + configBeanClass, e);
@@ -77,8 +77,8 @@ public class ClassBasedModuleFactory implements ModuleFactory {
     }
 
     @Override
-    public Module createModule(String instanceName,
-            DependencyResolver dependencyResolver, BundleContext bundleContext) {
+    public Module createModule(final String instanceName,
+            final DependencyResolver dependencyResolver, final BundleContext bundleContext) {
         try {
             return constructModule(instanceName, dependencyResolver, null);
         } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
@@ -88,7 +88,7 @@ public class ClassBasedModuleFactory implements ModuleFactory {
 
     @Override
     public boolean isModuleImplementingServiceInterface(
-            Class<? extends AbstractServiceInterface> serviceInterface) {
+            final Class<? extends AbstractServiceInterface> serviceInterface) {
         Class<?>[] classes = configBeanClass.getInterfaces();
         List<Class<?>> ifc = Arrays.asList(classes);
         if (ifc.contains(serviceInterface)) {
@@ -104,7 +104,7 @@ public class ClassBasedModuleFactory implements ModuleFactory {
     }
 
     @Override
-    public Set<Module> getDefaultModules(DependencyResolverFactory dependencyResolverFactory, BundleContext bundleContext) {
+    public Set<Module> getDefaultModules(final DependencyResolverFactory dependencyResolverFactory, final BundleContext bundleContext) {
         return new HashSet<>();
     }
 
index 3b7bbcd26739dcce3d1f8309adea4391968921a8..cc4d3cad3602032d59ba001c3e32131e39690a74 100644 (file)
@@ -32,7 +32,7 @@ public class ConfigTransactionManagerImplTest extends
         try {
             configRegistryJMXRegistrator.registerToJMX(mockedRegistry);
             fail();
-        } catch (Exception e) {
+        } catch (final Exception e) {
             assertTrue(e instanceof InstanceAlreadyExistsException);
         }
     }
index 018fea86ed1b0c779fd48e8a27ca773c982f12c9..854b40eb241382bd46c863f3ddc651db6e3bacf8 100644 (file)
@@ -50,7 +50,7 @@ public class AnnotationsTest {
         Method setter;
         try {
             setter = clazz.getMethod(methodName, new Class[] { ObjectName.class });
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw Throwables.propagate(e);
         }
         return setter;
@@ -175,7 +175,7 @@ public class AnnotationsTest {
             assertRequireInterfaceAnnotationHasCorrectValue(SubClassWithAnnotation.class, setSomethingString,
                 emptySetOfInterfaces(), SubSI2.class);
             fail();
-        } catch (IllegalStateException e) {
+        } catch (final IllegalStateException e) {
             assertTrue(e.getMessage(),
                 e.getMessage().startsWith("Error finding @RequireInterface. More than one value specified"));
         }
index 4299bb4e881c1e2443ea8836375944fcc67946e2..ed8e588d238fd006523535d01be6cca3a4972cb8 100644 (file)
@@ -14,8 +14,8 @@ import org.opendaylight.controller.config.spi.Module;
 public class DynamicReadableWrapperTest extends AbstractDynamicWrapperTest {
 
     @Override
-    protected AbstractDynamicWrapper getDynamicWrapper(Module module,
-            ModuleIdentifier moduleIdentifier) {
+    protected AbstractDynamicWrapper getDynamicWrapper(final Module module,
+            final ModuleIdentifier moduleIdentifier) {
         return new DynamicReadableWrapper(module, null, moduleIdentifier,
                 internalServer, ManagementFactory.getPlatformMBeanServer());
     }
index bd8211377f816991b2c73d1c3676f24f4cc94378..100ed62b82bbeb1bd0c9472d9aaea2384ead9d5a 100644 (file)
@@ -33,8 +33,8 @@ public class DynamicWritableWrapperTest extends AbstractDynamicWrapperTest {
             atomicBoolean);
 
     @Override
-    protected AbstractDynamicWrapper getDynamicWrapper(Module module,
-            ModuleIdentifier moduleIdentifier) {
+    protected AbstractDynamicWrapper getDynamicWrapper(final Module module,
+            final ModuleIdentifier moduleIdentifier) {
         return new DynamicWritableWrapper(module, moduleIdentifier,
                 "transaction-1",
                 readOnlyAtomicBoolean, MBeanServerFactory.createMBeanServer(),
@@ -103,7 +103,7 @@ public class DynamicWritableWrapperTest extends AbstractDynamicWrapperTest {
         }
     }
 
-    private void setNumberOfThreads(int numberOfThreads) throws Exception {
+    private void setNumberOfThreads(final int numberOfThreads) throws Exception {
         DynamicMBean proxy = JMX.newMBeanProxy(platformMBeanServer,
                 threadPoolDynamicWrapperON, DynamicMBean.class);
 
@@ -118,7 +118,7 @@ public class DynamicWritableWrapperTest extends AbstractDynamicWrapperTest {
         try {
             setNumberOfThreads(newThreadCount);
             fail();
-        } catch (IllegalStateException e) {
+        } catch (final IllegalStateException e) {
             assertEquals("Operation is not allowed now", e.getMessage());
         } finally {
             atomicBoolean.set(false);
index e7e10e884ff3087aab7f0099822ba976a9c791b7..b313049d7d405156df4aa74dd99ad2afd8ed1308 100644 (file)
@@ -28,7 +28,7 @@ import org.osgi.framework.ServiceRegistration;
 public class HardcodedModuleFactoriesResolver implements ModuleFactoriesResolver {
     private Map<String, Map.Entry<ModuleFactory, BundleContext>> factories;
 
-    public HardcodedModuleFactoriesResolver(BundleContext bundleContext, ModuleFactory... list) {
+    public HardcodedModuleFactoriesResolver(final BundleContext bundleContext, final ModuleFactory... list) {
         List<ModuleFactory> factoryList = Arrays.asList(list);
         this.factories = new HashMap<>(factoryList.size());
         for (ModuleFactory moduleFactory : list) {
index 72d65262252247d7aed93b3055b87fa4c070f095..cf50098e09de8b0a4f13fcab8595af9c6cfcabd1 100644 (file)
@@ -83,7 +83,7 @@ public class BundleContextBackedModuleFactoriesResolverTest {
         doReturn(f1).when(bundleContext).getService(s2);
         try {
             resolver.getAllFactories();
-        } catch (Exception e) {
+        } catch (final Exception e) {
             assertThat(e.getMessage(), containsString(f1.getImplementationName()));
             assertThat(e.getMessage(), containsString("unique"));
             return;
index 9930a887c526e4f66759664c3ad9a047ab49600d..d694e981d6ed3af673c2223fd4307c9df6af9801 100644 (file)
@@ -71,7 +71,7 @@ public class ModuleFactoryBundleTrackerTest {
     public void testRegisterFactoryInstantiateEx() throws Exception {
         try {
             ModuleFactoryBundleTracker.registerFactory(WrongConstructorTestingFactory.class.getName(), bundle);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             verifyZeroInteractions(context);
             assertNotNull(e.getCause());
             assertEquals(InstantiationException.class, e.getCause().getClass());
@@ -85,7 +85,7 @@ public class ModuleFactoryBundleTrackerTest {
     public void testRegisterFactoryInstantiateExAccess() throws Exception {
         try {
             ModuleFactoryBundleTracker.registerFactory(NoAccessConstructorTestingFactory.class.getName(), bundle);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             verifyZeroInteractions(context);
             assertNotNull(e.getCause());
             assertEquals(IllegalAccessException.class, e.getCause().getClass());
@@ -99,7 +99,7 @@ public class ModuleFactoryBundleTrackerTest {
     public void testRegisterFactoryNotExtending() throws Exception {
         try {
             ModuleFactoryBundleTracker.registerFactory(NotExtendingTestingFactory.class.getName(), bundle);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             verifyZeroInteractions(context);
             return;
         }
@@ -111,7 +111,7 @@ public class ModuleFactoryBundleTrackerTest {
     public void testRegisterFactoryNotExisting() throws Exception {
         try {
             ModuleFactoryBundleTracker.registerFactory("Unknown class", bundle);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             verifyZeroInteractions(context);
             assertNotNull(e.getCause());
             assertEquals(ClassNotFoundException.class, e.getCause().getClass());
@@ -138,7 +138,7 @@ public class ModuleFactoryBundleTrackerTest {
         doReturn(getClass().getResource("/module-factories/module-factory-fail")).when(bundle).getEntry(anyString());
         try {
             tracker.addingBundle(bundle, mock(BundleEvent.class));
-        } catch (Exception e) {
+        } catch (final Exception e) {
             verifyZeroInteractions(context);
             return;
         }
index fd225f1b93f01fd1d5c1f5105d1f36c357090624..5b19f615bc5b6659c3e87099ff67b2d9bacf4688 100644 (file)
@@ -65,7 +65,7 @@ public class RuntimeBeanRegistratorImplTest extends
         try {
             platformMBeanServer.getMBeanInfo(on);
             fail();
-        } catch (InstanceNotFoundException e) {
+        } catch (final InstanceNotFoundException e) {
 
         }
     }
@@ -137,7 +137,7 @@ public class RuntimeBeanRegistratorImplTest extends
         try {
             createRoot();
             fail();
-        } catch (IllegalStateException e) {
+        } catch (final IllegalStateException e) {
             assertThat(e.getMessage(), containsString(rootRegistration
                     .getObjectName().toString()));
             assertThat(e.getMessage(),
index 65b36deb43e579a26eea8f50d1e4408e9d4bbcad..2b012a750c24af12e0a1030ccdb52b332dc74c4d 100644 (file)
@@ -21,8 +21,8 @@ public class TestingParallelAPSPImpl implements TestingAPSP, Closeable {
     private TestingThreadPoolIfc threadPool;
     private String someParam;
 
-    public TestingParallelAPSPImpl(TestingThreadPoolIfc threadPool,
-            String someParam) {
+    public TestingParallelAPSPImpl(final TestingThreadPoolIfc threadPool,
+            final String someParam) {
         checkArgument(
                 threadPool.getMaxNumberOfThreads() >= MINIMAL_NUMBER_OF_THREADS,
                 "Parameter 'threadPool' has not enough threads");
@@ -46,7 +46,7 @@ public class TestingParallelAPSPImpl implements TestingAPSP, Closeable {
         return threadPool;
     }
 
-    void setSomeParam(String s) {
+    void setSomeParam(final String s) {
         checkArgument(Strings.isNullOrEmpty(someParam) == false,
                 "Parameter 'someParam' is blank");
         this.someParam = s;
index 1857aaa22f70fbaa5acd7e807b8d9cefc14a1a15..774ddac4e82be0a93ba8f95c7cc1a4a484cb0a32 100644 (file)
@@ -43,10 +43,10 @@ public class TestingParallelAPSPModule implements Module,
     private TestingParallelAPSPImpl instance;
     private String someParam;
 
-    public TestingParallelAPSPModule(ModuleIdentifier identifier,
-            DependencyResolver dependencyResolver,
-            @Nullable AutoCloseable oldCloseable,
-            @Nullable TestingParallelAPSPImpl oldInstance) {
+    public TestingParallelAPSPModule(final ModuleIdentifier identifier,
+            final DependencyResolver dependencyResolver,
+            @Nullable final AutoCloseable oldCloseable,
+            @Nullable final TestingParallelAPSPImpl oldInstance) {
         this.identifier = identifier;
         this.dependencyResolver = dependencyResolver;
         this.oldCloseable = oldCloseable;
@@ -60,7 +60,7 @@ public class TestingParallelAPSPModule implements Module,
 
     @RequireInterface(TestingThreadPoolServiceInterface.class)
     @Override
-    public void setThreadPool(ObjectName threadPoolName) {
+    public void setThreadPool(final ObjectName threadPoolName) {
         this.threadPoolON = threadPoolName;
     }
 
@@ -70,7 +70,7 @@ public class TestingParallelAPSPModule implements Module,
     }
 
     @Override
-    public void setSomeParam(String someParam) {
+    public void setSomeParam(final String someParam) {
         this.someParam = someParam;
     }
 
@@ -98,7 +98,7 @@ public class TestingParallelAPSPModule implements Module,
             dependencyResolver.resolveInstance(TestingThreadPoolIfc.class,
                     threadPoolON, threadPoolONJMXAttribute);
             throw new RuntimeException("fail");
-        } catch (IllegalStateException e) {
+        } catch (final IllegalStateException e) {
             checkState("Commit was not triggered".equals(e.getMessage()),
                     e.getMessage());
         }
@@ -107,7 +107,7 @@ public class TestingParallelAPSPModule implements Module,
         int threadCount;
         try {
             threadCount = (Integer)dependencyResolver.getAttribute(threadPoolON, "ThreadCount");
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new IllegalStateException(e);
         }
         checkState(threadCount > 0);
@@ -135,7 +135,7 @@ public class TestingParallelAPSPModule implements Module,
                 if (oldCloseable != null) {
                     try {
                         oldCloseable.close();
-                    } catch (Exception e) {
+                    } catch (final Exception e) {
                         throw new RuntimeException(e);
                     }
                 }
index b08cdcb20d2e11e804576688858957eaecf17172..3fc07fe571a9fe1323eab1a1a1e943a7872d9ec9 100644 (file)
@@ -32,20 +32,20 @@ public class TestingParallelAPSPModuleFactory implements ModuleFactory {
     }
 
     @Override
-    public TestingParallelAPSPModule createModule(String instanceName,
-            DependencyResolver dependencyResolver, BundleContext bundleContext) {
+    public TestingParallelAPSPModule createModule(final String instanceName,
+            final DependencyResolver dependencyResolver, final BundleContext bundleContext) {
         return new TestingParallelAPSPModule(new ModuleIdentifier(NAME,
                 instanceName), dependencyResolver, null, null);
     }
 
     @Override
-    public TestingParallelAPSPModule createModule(String instanceName,
-            DependencyResolver dependencyResolver, DynamicMBeanWithInstance old, BundleContext context)
+    public TestingParallelAPSPModule createModule(final String instanceName,
+            final DependencyResolver dependencyResolver, final DynamicMBeanWithInstance old, final BundleContext context)
             throws Exception {
         TestingParallelAPSPImpl oldInstance;
         try {
             oldInstance = (TestingParallelAPSPImpl) old.getInstance();
-        } catch (ClassCastException e) {
+        } catch (final ClassCastException e) {
             oldInstance = null;
         }
         TestingParallelAPSPModule result = new TestingParallelAPSPModule(
@@ -61,12 +61,12 @@ public class TestingParallelAPSPModuleFactory implements ModuleFactory {
 
     @Override
     public boolean isModuleImplementingServiceInterface(
-            Class<? extends AbstractServiceInterface> serviceInterface) {
+            final Class<? extends AbstractServiceInterface> serviceInterface) {
         return false;
     }
 
     @Override
-    public Set<Module> getDefaultModules(DependencyResolverFactory dependencyResolverFactory, BundleContext context) {
+    public Set<Module> getDefaultModules(final DependencyResolverFactory dependencyResolverFactory, final BundleContext context) {
         return new HashSet<>();
     }
 
index 6fdc8fef412989ec1c8c1ef385820f594eff2774..4f1664ad46665a170e8f00fb695b455dfd93fd07 100644 (file)
@@ -22,7 +22,7 @@ public abstract class AbstractParallelAPSPTest extends AbstractConfigTest {
     protected abstract String getThreadPoolImplementationName();
 
     protected ObjectName createParallelAPSP(
-            ConfigTransactionJMXClient transaction, ObjectName threadPoolON)
+            final ConfigTransactionJMXClient transaction, final ObjectName threadPoolON)
             throws InstanceAlreadyExistsException {
         ObjectName apspName = transaction.createModule(
                 TestingParallelAPSPModuleFactory.NAME, apsp1);
@@ -33,8 +33,8 @@ public abstract class AbstractParallelAPSPTest extends AbstractConfigTest {
         return apspName;
     }
 
-    protected ObjectName createFixed1(ConfigTransactionJMXClient transaction,
-            int numberOfThreads) throws InstanceAlreadyExistsException {
+    protected ObjectName createFixed1(final ConfigTransactionJMXClient transaction,
+            final int numberOfThreads) throws InstanceAlreadyExistsException {
 
         ObjectName name = transaction.createModule(
                 getThreadPoolImplementationName(), fixed1);
index 7b4a9f335a2b2b110f57da07ff7adb8591e8f05c..9c550966e62228e0bcc5414758fc7db9fa753d99 100644 (file)
@@ -69,7 +69,7 @@ public class DependentWiringTest extends AbstractParallelAPSPTest {
             try {
                 transaction.validateConfig();
                 fail();
-            } catch (ValidationException e) {
+            } catch (final ValidationException e) {
                 for (Map.Entry<String, Map<String, ExceptionMessageWithStackTrace>> exception : e
                         .getFailedValidations().entrySet()) {
                     for (Map.Entry<String, ExceptionMessageWithStackTrace> entry : exception
@@ -85,7 +85,7 @@ public class DependentWiringTest extends AbstractParallelAPSPTest {
             try {
                 transaction.commit();
                 fail();
-            } catch (ValidationException e) {
+            } catch (final ValidationException e) {
                 for (Map.Entry<String, Map<String, ExceptionMessageWithStackTrace>> exception : e
                         .getFailedValidations().entrySet()) {
                     for (Map.Entry<String, ExceptionMessageWithStackTrace> entry : exception
index 6d151c4788bef7b5ca791c66ebbcf48f617df24f..1e0bebbf06b512508aefdbd86e37081a07c88248 100644 (file)
@@ -53,7 +53,7 @@ public class MockedDependenciesTest extends AbstractParallelAPSPTest {
         int threadCount;
 
         public MockedThreadPoolModule(
-                DynamicMBeanWithInstance dynamicMBeanWithInstance, ModuleIdentifier moduleIdentifier) {
+                final DynamicMBeanWithInstance dynamicMBeanWithInstance, final ModuleIdentifier moduleIdentifier) {
             // no reconfiguration / reuse is supported
             this.moduleIdentifier = moduleIdentifier;
         }
@@ -64,7 +64,7 @@ public class MockedDependenciesTest extends AbstractParallelAPSPTest {
         }
 
         @Override
-        public void setThreadCount(int threadCount) {
+        public void setThreadCount(final int threadCount) {
             this.threadCount = threadCount;
         }
 
@@ -74,7 +74,7 @@ public class MockedDependenciesTest extends AbstractParallelAPSPTest {
         }
 
         @Override
-        public boolean canReuse(Module oldModule) {
+        public boolean canReuse(final Module oldModule) {
             return false;
         }
 
@@ -93,7 +93,7 @@ public class MockedDependenciesTest extends AbstractParallelAPSPTest {
             Closeable {
         private final int threadCount;
 
-        public MockedThreadPool(int threadCount) {
+        public MockedThreadPool(final int threadCount) {
             this.threadCount = threadCount;
         }
 
index 0e60db899ded465a14dd3ba6aa8f810baae60fb1..9c0f56b1206c65b854b658b844b0a6a1224feb43 100644 (file)
@@ -28,7 +28,7 @@ public class TestingScheduledThreadPoolImpl implements TestingThreadPoolIfc,
             .newLinkedList();
 
     public TestingScheduledThreadPoolImpl(
-            RootRuntimeBeanRegistrator runtimeBeanRegistrator, int corePoolSize) {
+            final RootRuntimeBeanRegistrator runtimeBeanRegistrator, final int corePoolSize) {
         this.runtimeBeanRegistrator = runtimeBeanRegistrator;
         executor = new ScheduledThreadPoolExecutor(corePoolSize);
         allExecutors.add(executor);
index 8c6cd03cde8c919a65934de336825e74509b9a6b..cf0d9d17df07566306ff26f834fa303fe8fcdf31 100644 (file)
@@ -39,9 +39,9 @@ public class TestingScheduledThreadPoolModule implements Module,
     private RootRuntimeBeanRegistrator runtimeBeanRegistrator;
     private boolean recreate;
 
-    public TestingScheduledThreadPoolModule(ModuleIdentifier identifier,
-            @Nullable AutoCloseable oldCloseable,
-            @Nullable TestingScheduledThreadPoolImpl oldInstance) {
+    public TestingScheduledThreadPoolModule(final ModuleIdentifier identifier,
+            @Nullable final AutoCloseable oldCloseable,
+            @Nullable final TestingScheduledThreadPoolImpl oldInstance) {
         this.identifier = identifier;
         this.oldCloseable = oldCloseable;
         this.oldInstance = oldInstance;
@@ -49,7 +49,7 @@ public class TestingScheduledThreadPoolModule implements Module,
 
     @Override
     public void setRuntimeBeanRegistrator(
-            RootRuntimeBeanRegistrator runtimeBeanRegistrator) {
+            final RootRuntimeBeanRegistrator runtimeBeanRegistrator) {
         this.runtimeBeanRegistrator = runtimeBeanRegistrator;
     }
 
@@ -73,7 +73,7 @@ public class TestingScheduledThreadPoolModule implements Module,
     }
 
     @Override
-    public void setThreadCount(int threadCount) {
+    public void setThreadCount(final int threadCount) {
         this.threadCount = threadCount;
     }
 
@@ -89,7 +89,7 @@ public class TestingScheduledThreadPoolModule implements Module,
                 if (oldCloseable != null) {
                     try {
                         oldCloseable.close();
-                    } catch (Exception e) {
+                    } catch (final Exception e) {
                         throw new RuntimeException(e);
                     }
                 }
@@ -108,7 +108,7 @@ public class TestingScheduledThreadPoolModule implements Module,
     }
 
     @Override
-    public void setRecreate(boolean recreate) {
+    public void setRecreate(final boolean recreate) {
         this.recreate = recreate;
     }
 
index 295d348503869899cc3a844beded7633042f4f75..7428776b76852c60d375880bb0978b97d3560394 100644 (file)
@@ -53,7 +53,7 @@ public class TestingScheduledThreadPoolModuleFactory implements ModuleFactory {
         TestingScheduledThreadPoolImpl oldInstance;
         try {
             oldInstance = (TestingScheduledThreadPoolImpl) old.getInstance();
-        } catch (ClassCastException e) {// happens after OSGi update
+        } catch (final ClassCastException e) {// happens after OSGi update
             oldInstance = null;
         }
 
index 451980c3ef9bafdd6c57e51dc2100f6b0a7c0b45..7b975ceb20bdc5a70f1696be468516bc7e0292a7 100644 (file)
@@ -85,7 +85,7 @@ public class RuntimeBeanTest extends AbstractScheduledTest {
         try {
             checkRuntimeBean(on);
             fail();
-        } catch (InstanceNotFoundException e) {
+        } catch (final InstanceNotFoundException e) {
             // No-op
         }
     }
index 0e6a54fdc9b1b9cee4d74fda75fa8154db8a9866..2a7876255fed3c1f6a492472cdd113b4c6de0b2f 100644 (file)
@@ -64,14 +64,14 @@ public class TwoInterfacesExportTest extends AbstractScheduledTest {
             try {
                 transaction.lookupConfigBean(moduleName, instanceName);
                 fail();
-            } catch (InstanceNotFoundException e) {
+            } catch (final InstanceNotFoundException e) {
 
             }
         } else {
             try {
                 configRegistryClient.lookupConfigBean(moduleName, instanceName);
                 fail();
-            } catch (InstanceNotFoundException e) {
+            } catch (final InstanceNotFoundException e) {
 
             }
         }
@@ -139,7 +139,7 @@ public class TwoInterfacesExportTest extends AbstractScheduledTest {
             transaction.createModule(
                     TestingScheduledThreadPoolModuleFactory.NAME, scheduled1);
             fail();
-        } catch (InstanceAlreadyExistsException e) {
+        } catch (final InstanceAlreadyExistsException e) {
             assertThat(
                     e.getMessage(),
                     containsString("There is an instance registered with name ModuleIdentifier{factoryName='scheduled', instanceName='scheduled1'}"));
index 0f4f00f0baf223c40239e4379b2a6529c10c9a8f..4f8de6dfe16f20467f5b8cbb56ff0d004be4a755 100644 (file)
@@ -36,7 +36,7 @@ public class TestingFixedThreadPool implements TestingThreadPoolIfc, Closeable,
     public static final List<ThreadPoolExecutor> allExecutors = Collections
             .synchronizedList(Lists.<ThreadPoolExecutor>newLinkedList());
 
-    public TestingFixedThreadPool(int threadCount, String uniqueName) {
+    public TestingFixedThreadPool(final int threadCount, final String uniqueName) {
         checkNotNull(uniqueName);
         this.uniqueName = uniqueName;
         executorService = (ThreadPoolExecutor) Executors
@@ -66,7 +66,7 @@ public class TestingFixedThreadPool implements TestingThreadPoolIfc, Closeable,
     }
 
     @Override
-    public void setMaximumNumberOfThreads(int activeCount) {
+    public void setMaximumNumberOfThreads(final int activeCount) {
         checkArgument(activeCount > 0);
         executorService.setMaximumPoolSize(activeCount);
     }
index c773dd232bb0e12341286e0a762420935a8fb333..a6c9b59605b35f7bbbaf9c9c37cd6c919cfbae6e 100644 (file)
@@ -27,9 +27,9 @@ public class TestingFixedThreadPoolModule implements
     private int threadCount = 0;
     private boolean triggerNewInstanceCreation;
 
-    TestingFixedThreadPoolModule(ModuleIdentifier name,
-            @Nullable AutoCloseable oldCloseable,
-            @Nullable TestingFixedThreadPool oldInstance) {
+    TestingFixedThreadPoolModule(final ModuleIdentifier name,
+            @Nullable final AutoCloseable oldCloseable,
+            @Nullable final TestingFixedThreadPool oldInstance) {
         this.name = name;
         this.oldCloseable = oldCloseable;
         this.oldInstance = oldInstance;
@@ -38,7 +38,7 @@ public class TestingFixedThreadPoolModule implements
 
     // attributes
     @Override
-    public void setThreadCount(int threadCount) {
+    public void setThreadCount(final int threadCount) {
         this.threadCount = threadCount;
     }
 
@@ -53,7 +53,7 @@ public class TestingFixedThreadPoolModule implements
     }
 
     @Override
-    public void setTriggerNewInstanceCreation(boolean triggerNewInstanceCreation) {
+    public void setTriggerNewInstanceCreation(final boolean triggerNewInstanceCreation) {
         this.triggerNewInstanceCreation = triggerNewInstanceCreation;
     }
 
@@ -88,7 +88,7 @@ public class TestingFixedThreadPoolModule implements
                 if (oldCloseable != null) {
                     try {
                         oldCloseable.close();
-                    } catch (Exception e) {
+                    } catch (final Exception e) {
                         throw new RuntimeException(e);
                     }
                 }
index 2fef47eb10ed8d7b7225aeb9ace224642b7e4cd6..e78ae980096fa5e8905e12bf0f83de330b353376 100644 (file)
@@ -50,7 +50,7 @@ public class TestingFixedThreadPoolModuleFactory extends AbstractTestingFixedThr
         try {
             // reconfigure existing instance
             oldInstance = (TestingFixedThreadPool) old.getInstance();
-        } catch (ClassCastException e) {
+        } catch (final ClassCastException e) {
             // old instance will be closed, new needs to be created
             oldInstance = null;
         }
index df08f894c9151349e0356b8205c77d3ef3469961..d837ffcdb481ade6eb41c7182b521c20232c08d5 100644 (file)
@@ -141,7 +141,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest {
             platformMBeanServer.invoke(fixed1names, "validate", new Object[0],
                     new String[0]);
             fail();
-        } catch (MBeanException e) {
+        } catch (final MBeanException e) {
             Exception targetException = e.getTargetException();
             assertNotNull(targetException);
             assertEquals(ValidationException.class, targetException.getClass());
@@ -151,7 +151,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest {
         try {
             transaction.validateBean(fixed1names);
             fail();
-        } catch (ValidationException e) {
+        } catch (final ValidationException e) {
             for (Map.Entry<String, Map<String, ExceptionMessageWithStackTrace>> exception : e
                     .getFailedValidations().entrySet()) {
                 for (Map.Entry<String, ExceptionMessageWithStackTrace> entry : exception
@@ -166,7 +166,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest {
         try {
             transaction.validateConfig();
             fail();
-        } catch (ValidationException e) {
+        } catch (final ValidationException e) {
             for (Map.Entry<String, Map<String, ExceptionMessageWithStackTrace>> exception : e
                     .getFailedValidations().entrySet()) {
                 for (Map.Entry<String, ExceptionMessageWithStackTrace> entry : exception
@@ -179,7 +179,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest {
         }
         try {
             transaction.commit();
-        } catch (ValidationException e) {
+        } catch (final ValidationException e) {
             for (Map.Entry<String, Map<String, ExceptionMessageWithStackTrace>> exception : e
                     .getFailedValidations().entrySet()) {
                 for (Map.Entry<String, ExceptionMessageWithStackTrace> entry : exception
@@ -249,7 +249,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest {
         try {
             platformMBeanServer.getMBeanInfo(on);
             fail();
-        } catch (Exception e) {
+        } catch (final Exception e) {
             assertTrue(e instanceof InstanceNotFoundException);
         }
     }
@@ -331,7 +331,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest {
         try {
             platformMBeanServer.getMBeanInfo(transaction.getObjectName());
             fail();
-        }catch(InstanceNotFoundException e){
+        }catch(final InstanceNotFoundException e){
             assertEquals("org.opendaylight.controller:TransactionName=ConfigTransaction-0-1,type=ConfigTransaction", e.getMessage());
         }
     }
@@ -347,7 +347,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest {
         try {
             transaction1.commit();
             fail();
-        } catch (ConflictingVersionException e) {
+        } catch (final ConflictingVersionException e) {
             assertEquals(
                     "Optimistic lock failed. Expected parent version 2, was 0",
                     e.getMessage());
@@ -365,7 +365,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest {
         try {
             configRegistryClient.commitConfig(transaction1.getObjectName());
             fail();
-        } catch (ConflictingVersionException e) {
+        } catch (final ConflictingVersionException e) {
             assertEquals(
                     "Optimistic lock failed. Expected parent version 2, was 0",
                     e.getMessage());