From: Stephen Kitt Date: Fri, 12 May 2017 09:54:20 +0000 (+0200) Subject: config-manager: final parameters X-Git-Tag: release/nitrogen~249 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=cbcc2b61265e903959f11d44c292771e76b3926e config-manager: final parameters This automatically-generated patch flags all appropriate parameters as final (including caught exceptions). Change-Id: I78de8a8a8f9766a654432e8ba5a0497f06c4438a Signed-off-by: Stephen Kitt --- diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/CommitInfo.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/CommitInfo.java index c0447bfb32..ae78c83754 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/CommitInfo.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/CommitInfo.java @@ -25,8 +25,8 @@ public class CommitInfo { private final List destroyedFromPreviousTransactions; private final Map commitMap; - public CommitInfo(List destroyedFromPreviousTransactions, - Map commitMap) { + public CommitInfo(final List destroyedFromPreviousTransactions, + final Map commitMap) { this.destroyedFromPreviousTransactions = Collections .unmodifiableList(destroyedFromPreviousTransactions); this.commitMap = Collections.unmodifiableMap(commitMap); diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigRegistryImpl.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigRegistryImpl.java index 763ed66cb1..369e7ed2a5 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigRegistryImpl.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigRegistryImpl.java @@ -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 lookupConfigBeans(String moduleName) { + public Set 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 lookupConfigBeans(String moduleName, - String instanceName) { + public Set 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 lookupRuntimeBeans(String moduleName, - String instanceName) { + public Set 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 lookupServiceReferencesByServiceInterfaceName(String serviceInterfaceQName) { + public Map lookupServiceReferencesByServiceInterfaceName(final String serviceInterfaceQName) { synchronized(readableSRRegistryLock) { return readableSRRegistry.lookupServiceReferencesByServiceInterfaceName(serviceInterfaceQName); } } @Override - public Set lookupServiceInterfaceNames(ObjectName objectName) throws InstanceNotFoundException { + public Set 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 configInfos) { + public void addAll(final Collection 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> 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) { diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionControllerImpl.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionControllerImpl.java index ad64288ab2..97c42803ef 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionControllerImpl.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionControllerImpl.java @@ -86,11 +86,11 @@ class ConfigTransactionControllerImpl implements @GuardedBy("this") private final SearchableServiceReferenceWritableRegistry writableSRRegistry; - public ConfigTransactionControllerImpl(ConfigTransactionLookupRegistry txLookupRegistry, - long parentVersion, BindingContextProvider bindingContextProvider, long currentVersion, - Map> 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> 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 existingModules, List lastListOfFactories) { + public void copyExistingModulesAndProcessFactoryDiff(final Collection existingModules, final List 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 lastListOfFactories) { + private synchronized void processDefaultBeans(final List 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 lookupConfigBeans(String moduleName) { + public Set 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 lookupConfigBeans(String moduleName, String instanceName) { + public Set 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 lookupRuntimeBeans(String moduleName, - String instanceName) { + public Set 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 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 lookupServiceReferencesByServiceInterfaceName(String serviceInterfaceQName) { + public synchronized Map lookupServiceReferencesByServiceInterfaceName(final String serviceInterfaceQName) { return writableSRRegistry.lookupServiceReferencesByServiceInterfaceName(serviceInterfaceQName); } @Override - public synchronized Set lookupServiceInterfaceNames(ObjectName objectName) throws InstanceNotFoundException { + public synchronized Set 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); } } diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionLookupRegistry.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionLookupRegistry.java index 79bffb49da..4780f96510 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionLookupRegistry.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionLookupRegistry.java @@ -33,15 +33,15 @@ class ConfigTransactionLookupRegistry implements LookupRegistry, Closeable { private final TransactionModuleJMXRegistrator txModuleJMXRegistrator; private final Map> allCurrentFactories; - ConfigTransactionLookupRegistry(TransactionIdentifier transactionIdentifier, - TransactionJMXRegistratorFactory factory, Map> allCurrentFactories) { + ConfigTransactionLookupRegistry(final TransactionIdentifier transactionIdentifier, + final TransactionJMXRegistratorFactory factory, final Map> 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 lookupConfigBeans(String moduleName) { + public Set 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 lookupConfigBeans(String moduleName, - String instanceName) { + public Set 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 lookupRuntimeBeans(String moduleName, - String instanceName) { + public Set lookupRuntimeBeans(final String moduleName, + final String instanceName) { String finalModuleName = moduleName == null ? "*" : moduleName; String finalInstanceName = instanceName == null ? "*" : instanceName; ObjectName namePattern = ObjectNameUtil.createRuntimeBeanPattern( diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java index 20e5fe6584..af58dd2746 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java @@ -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; } diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ModuleInternalInfo.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ModuleInternalInfo.java index 267e504f85..a64d8c33b8 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ModuleInternalInfo.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ModuleInternalInfo.java @@ -41,12 +41,12 @@ public class ModuleInternalInfo implements Comparable, 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, * Compare using orderingIdx */ @Override - public int compareTo(ModuleInternalInfo o) { + public int compareTo(final ModuleInternalInfo o) { return Integer.compare(orderingIdx, o.orderingIdx); } diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ServiceReferenceRegistryImpl.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ServiceReferenceRegistryImpl.java index 85f0af7e54..baa02edf3c 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ServiceReferenceRegistryImpl.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ServiceReferenceRegistryImpl.java @@ -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); } } diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/TransactionIdentifier.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/TransactionIdentifier.java index 15c69bf25f..5fc5182db3 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/TransactionIdentifier.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/TransactionIdentifier.java @@ -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; } diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DependencyResolverManager.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DependencyResolverManager.java index f8906735b6..ef4aaddf35 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DependencyResolverManager.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DependencyResolverManager.java @@ -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) { diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DestroyedModule.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DestroyedModule.java index dae6cb27e4..d449e28dfe 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DestroyedModule.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DestroyedModule.java @@ -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); } diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/ModuleInternalTransactionalInfo.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/ModuleInternalTransactionalInfo.java index b8d6c26f35..3a58b01b40 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/ModuleInternalTransactionalInfo.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/ModuleInternalTransactionalInfo.java @@ -30,11 +30,11 @@ public class ModuleInternalTransactionalInfo implements Identifiable> jmxInterfaces) { + static String findDescription(final Method setter, final Set> jmxInterfaces) { List 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> inspectedInterfaces) { + final Set> inspectedInterfaces) { // only allow setX(ObjectName y) or setX(ObjectName[] y) or setX(List y) to continue diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicReadableWrapper.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicReadableWrapper.java index 38c677ce35..1a43d6f884 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicReadableWrapper.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicReadableWrapper.java @@ -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); } diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicWritableWrapper.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicWritableWrapper.java index 67ed296f61..90cc62358a 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicWritableWrapper.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicWritableWrapper.java @@ -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)); diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/ReadOnlyAtomicBoolean.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/ReadOnlyAtomicBoolean.java index 583e8b46e8..8abb635755 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/ReadOnlyAtomicBoolean.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/ReadOnlyAtomicBoolean.java @@ -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; } diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/factoriesresolver/HierarchicalConfigMBeanFactoriesHolder.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/factoriesresolver/HierarchicalConfigMBeanFactoriesHolder.java index 02d1d97677..63be03f8ad 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/factoriesresolver/HierarchicalConfigMBeanFactoriesHolder.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/factoriesresolver/HierarchicalConfigMBeanFactoriesHolder.java @@ -35,7 +35,7 @@ public class HierarchicalConfigMBeanFactoriesHolder { * if unique constraint on module names is violated */ public HierarchicalConfigMBeanFactoriesHolder( - Map> factoriesMap) { + final Map> 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 result = moduleNamesToConfigBeanFactories.get(moduleName); if (result == null) { throw new ModuleFactoryNotFoundException(moduleName); diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/HierarchicalRuntimeBeanRegistrationImpl.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/HierarchicalRuntimeBeanRegistrationImpl.java index 2b0e525656..f621392e79 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/HierarchicalRuntimeBeanRegistrationImpl.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/HierarchicalRuntimeBeanRegistrationImpl.java @@ -23,9 +23,9 @@ public class HierarchicalRuntimeBeanRegistrationImpl implements private final Map properties; public HierarchicalRuntimeBeanRegistrationImpl( - ModuleIdentifier moduleIdentifier, - InternalJMXRegistrator internalJMXRegistrator, - Map properties) { + final ModuleIdentifier moduleIdentifier, + final InternalJMXRegistrator internalJMXRegistrator, + final Map 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 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); } diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/InternalJMXRegistrator.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/InternalJMXRegistrator.java index 71656c27bc..147d6ee369 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/InternalJMXRegistrator.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/InternalJMXRegistrator.java @@ -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); } } diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/RootRuntimeBeanRegistratorImpl.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/RootRuntimeBeanRegistratorImpl.java index 8bccef3b81..1f29a65604 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/RootRuntimeBeanRegistratorImpl.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/RootRuntimeBeanRegistratorImpl.java @@ -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, diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReference.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReference.java index 3455569ee8..9388b8e567 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReference.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReference.java @@ -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; } diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReferenceMXBeanImpl.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReferenceMXBeanImpl.java index ba6676b927..b4938f32fb 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReferenceMXBeanImpl.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReferenceMXBeanImpl.java @@ -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; } } diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReferenceRegistrator.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReferenceRegistrator.java index fa0c52699a..e9db0715e5 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReferenceRegistrator.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReferenceRegistrator.java @@ -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; } diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/TransactionModuleJMXRegistrator.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/TransactionModuleJMXRegistrator.java index 81e5ae6e22..dbffe4cc90 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/TransactionModuleJMXRegistrator.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/TransactionModuleJMXRegistrator.java @@ -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 queryNames(ObjectName name, QueryExp query) { + public Set queryNames(final ObjectName name, final QueryExp query) { return currentJMXRegistrator.queryNames(name, query); } diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BeanToOsgiServiceManager.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BeanToOsgiServiceManager.java index 51f9940314..ff504dafdc 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BeanToOsgiServiceManager.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BeanToOsgiServiceManager.java @@ -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 serviceNamesToAnnotations) { + public OsgiRegistration registerToOsgi(final AutoCloseable instance, final ModuleIdentifier moduleIdentifier, + final BundleContext bundleContext, + final Map serviceNamesToAnnotations) { return new OsgiRegistration(instance, moduleIdentifier, bundleContext, serviceNamesToAnnotations); } @@ -51,17 +51,17 @@ public class BeanToOsgiServiceManager { @GuardedBy("this") private final Map serviceNamesToAnnotations; - public OsgiRegistration(AutoCloseable instance, ModuleIdentifier moduleIdentifier, - BundleContext bundleContext, - Map serviceNamesToAnnotations) { + public OsgiRegistration(final AutoCloseable instance, final ModuleIdentifier moduleIdentifier, + final BundleContext bundleContext, + final Map serviceNamesToAnnotations) { this.instance = instance; this.moduleIdentifier = moduleIdentifier; this.serviceNamesToAnnotations = serviceNamesToAnnotations; this.serviceRegistrations = registerToSR(instance, bundleContext, serviceNamesToAnnotations); } - private static Set> registerToSR(AutoCloseable instance, BundleContext bundleContext, - Map serviceNamesToAnnotations) { + private static Set> registerToSR(final AutoCloseable instance, final BundleContext bundleContext, + final Map serviceNamesToAnnotations) { Set> serviceRegistrations = new HashSet<>(); for (Entry 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 newAnnotationMapping, - BundleContext bundleContext, AutoCloseable newInstance) { + public synchronized void updateRegistrations(final Map 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 createProps(String serviceName) { + private static Dictionary createProps(final String serviceName) { Hashtable result = new Hashtable<>(); result.put(SERVICE_NAME_OSGI_PROP, serviceName); return result; diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BlankTransactionServiceTracker.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BlankTransactionServiceTracker.java index a15820556c..8ec44a14ba 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BlankTransactionServiceTracker.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BlankTransactionServiceTracker.java @@ -57,7 +57,7 @@ public class BlankTransactionServiceTracker implements ServiceTrackerCustomizer< } @Override - public Object addingService(ServiceReference moduleFactoryServiceReference) { + public Object addingService(final ServiceReference 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 moduleFactoryServiceReference, Object o) { + public void modifiedService(final ServiceReference moduleFactoryServiceReference, final Object o) { blankTransactionAsync(); } @Override - public void removedService(ServiceReference moduleFactoryServiceReference, Object o) { + public void removedService(final ServiceReference moduleFactoryServiceReference, final Object o) { blankTransactionAsync(); } diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BundleContextBackedModuleFactoriesResolver.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BundleContextBackedModuleFactoriesResolver.java index 0cbbbab912..1926c6b9af 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BundleContextBackedModuleFactoriesResolver.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BundleContextBackedModuleFactoriesResolver.java @@ -36,7 +36,7 @@ public class BundleContextBackedModuleFactoriesResolver implements ModuleFactori Collection> serviceReferences; try { serviceReferences = bundleContext.getServiceReferences(ModuleFactory.class, null); - } catch (InvalidSyntaxException e) { + } catch (final InvalidSyntaxException e) { throw new IllegalStateException(e); } Map> result = new HashMap<>(serviceReferences.size()); diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ExtensibleBundleTracker.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ExtensibleBundleTracker.java index 6969a3b657..5841acfde8 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ExtensibleBundleTracker.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ExtensibleBundleTracker.java @@ -80,7 +80,7 @@ public final class ExtensibleBundleTracker extends BundleTracker> { 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 extends BundleTracker> { 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); } } diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ModuleFactoryBundleTracker.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ModuleFactoryBundleTracker.java index 8ca5da2825..5e706250af 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ModuleFactoryBundleTracker.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ModuleFactoryBundleTracker.java @@ -33,12 +33,12 @@ public class ModuleFactoryBundleTracker implements BundleTrackerCustomizer 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 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); diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/LookupBeansUtil.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/LookupBeansUtil.java index 0572bd9350..fd1e37a98f 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/LookupBeansUtil.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/LookupBeansUtil.java @@ -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 objectNames = lookupRegistry.lookupConfigBeans( moduleName, instanceName); diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/ModuleQNameUtil.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/ModuleQNameUtil.java index e5858ac2ee..1fa97acd2f 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/ModuleQNameUtil.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/ModuleQNameUtil.java @@ -21,9 +21,9 @@ public class ModuleQNameUtil { private ModuleQNameUtil() { } - public static Set getQNames(Map> resolved) { - Set result = new HashSet<>(); - for (Entry entry : resolved.values()) { + public static Set getQNames(final Map> resolved) { + final Set result = new HashSet<>(); + for (final Entry entry : resolved.values()) { Class inspected = entry.getKey().getClass(); if (inspected.isInterface()) { throw new IllegalArgumentException("Unexpected interface " + inspected); diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/OsgiRegistrationUtil.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/OsgiRegistrationUtil.java index 7c02019544..607cf49db9 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/OsgiRegistrationUtil.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/OsgiRegistrationUtil.java @@ -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; diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/ConfigRegistryImplTest.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/ConfigRegistryImplTest.java index ee47316f8d..5fc5884531 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/ConfigRegistryImplTest.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/ConfigRegistryImplTest.java @@ -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); } diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/AbstractMockedModule.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/AbstractMockedModule.java index a6e24e9a49..7681b00d90 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/AbstractMockedModule.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/AbstractMockedModule.java @@ -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; } diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/ClassBasedModuleFactory.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/ClassBasedModuleFactory.java index 170878a6ed..451d85f780 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/ClassBasedModuleFactory.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/ClassBasedModuleFactory.java @@ -42,8 +42,8 @@ public class ClassBasedModuleFactory implements ModuleFactory { * This class must implement Module interface and all exported * interfaces. */ - public ClassBasedModuleFactory(String implementationName, - Class configBeanClass) { + public ClassBasedModuleFactory(final String implementationName, + final Class 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 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 serviceInterface) { + final Class serviceInterface) { Class[] classes = configBeanClass.getInterfaces(); List> ifc = Arrays.asList(classes); if (ifc.contains(serviceInterface)) { @@ -104,7 +104,7 @@ public class ClassBasedModuleFactory implements ModuleFactory { } @Override - public Set getDefaultModules(DependencyResolverFactory dependencyResolverFactory, BundleContext bundleContext) { + public Set getDefaultModules(final DependencyResolverFactory dependencyResolverFactory, final BundleContext bundleContext) { return new HashSet<>(); } diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionManagerImplTest.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionManagerImplTest.java index 3b7bbcd267..cc4d3cad36 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionManagerImplTest.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionManagerImplTest.java @@ -32,7 +32,7 @@ public class ConfigTransactionManagerImplTest extends try { configRegistryJMXRegistrator.registerToJMX(mockedRegistry); fail(); - } catch (Exception e) { + } catch (final Exception e) { assertTrue(e instanceof InstanceAlreadyExistsException); } } diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AnnotationsTest.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AnnotationsTest.java index 018fea86ed..854b40eb24 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AnnotationsTest.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AnnotationsTest.java @@ -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")); } diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicReadableWrapperTest.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicReadableWrapperTest.java index 4299bb4e88..ed8e588d23 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicReadableWrapperTest.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicReadableWrapperTest.java @@ -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()); } diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicWritableWrapperTest.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicWritableWrapperTest.java index bd8211377f..100ed62b82 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicWritableWrapperTest.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicWritableWrapperTest.java @@ -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); diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/factoriesresolver/HardcodedModuleFactoriesResolver.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/factoriesresolver/HardcodedModuleFactoriesResolver.java index e7e10e884f..b313049d7d 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/factoriesresolver/HardcodedModuleFactoriesResolver.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/factoriesresolver/HardcodedModuleFactoriesResolver.java @@ -28,7 +28,7 @@ import org.osgi.framework.ServiceRegistration; public class HardcodedModuleFactoriesResolver implements ModuleFactoriesResolver { private Map> factories; - public HardcodedModuleFactoriesResolver(BundleContext bundleContext, ModuleFactory... list) { + public HardcodedModuleFactoriesResolver(final BundleContext bundleContext, final ModuleFactory... list) { List factoryList = Arrays.asList(list); this.factories = new HashMap<>(factoryList.size()); for (ModuleFactory moduleFactory : list) { diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/osgi/BundleContextBackedModuleFactoriesResolverTest.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/osgi/BundleContextBackedModuleFactoriesResolverTest.java index 72d6526225..cf50098e09 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/osgi/BundleContextBackedModuleFactoriesResolverTest.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/osgi/BundleContextBackedModuleFactoriesResolverTest.java @@ -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; diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/osgi/ModuleFactoryBundleTrackerTest.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/osgi/ModuleFactoryBundleTrackerTest.java index 9930a887c5..d694e981d6 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/osgi/ModuleFactoryBundleTrackerTest.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/osgi/ModuleFactoryBundleTrackerTest.java @@ -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; } diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/runtimembean/RuntimeBeanRegistratorImplTest.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/runtimembean/RuntimeBeanRegistratorImplTest.java index fd225f1b93..5b19f615bc 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/runtimembean/RuntimeBeanRegistratorImplTest.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/runtimembean/RuntimeBeanRegistratorImplTest.java @@ -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(), diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPImpl.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPImpl.java index 65b36deb43..2b012a750c 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPImpl.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPImpl.java @@ -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; diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModule.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModule.java index 1857aaa22f..774ddac4e8 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModule.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModule.java @@ -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); } } diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModuleFactory.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModuleFactory.java index b08cdcb20d..3fc07fe571 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModuleFactory.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModuleFactory.java @@ -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 serviceInterface) { + final Class serviceInterface) { return false; } @Override - public Set getDefaultModules(DependencyResolverFactory dependencyResolverFactory, BundleContext context) { + public Set getDefaultModules(final DependencyResolverFactory dependencyResolverFactory, final BundleContext context) { return new HashSet<>(); } diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/AbstractParallelAPSPTest.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/AbstractParallelAPSPTest.java index 6fdc8fef41..4f1664ad46 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/AbstractParallelAPSPTest.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/AbstractParallelAPSPTest.java @@ -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); diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/DependentWiringTest.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/DependentWiringTest.java index 7b4a9f335a..9c550966e6 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/DependentWiringTest.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/DependentWiringTest.java @@ -69,7 +69,7 @@ public class DependentWiringTest extends AbstractParallelAPSPTest { try { transaction.validateConfig(); fail(); - } catch (ValidationException e) { + } catch (final ValidationException e) { for (Map.Entry> exception : e .getFailedValidations().entrySet()) { for (Map.Entry 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> exception : e .getFailedValidations().entrySet()) { for (Map.Entry entry : exception diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/MockedDependenciesTest.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/MockedDependenciesTest.java index 6d151c4788..1e0bebbf06 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/MockedDependenciesTest.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/MockedDependenciesTest.java @@ -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; } diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolImpl.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolImpl.java index 0e60db899d..9c0f56b120 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolImpl.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolImpl.java @@ -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); diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolModule.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolModule.java index 8c6cd03cde..cf0d9d17df 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolModule.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolModule.java @@ -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; } diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolModuleFactory.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolModuleFactory.java index 295d348503..7428776b76 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolModuleFactory.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolModuleFactory.java @@ -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; } diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/test/RuntimeBeanTest.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/test/RuntimeBeanTest.java index 451980c3ef..7b975ceb20 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/test/RuntimeBeanTest.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/test/RuntimeBeanTest.java @@ -85,7 +85,7 @@ public class RuntimeBeanTest extends AbstractScheduledTest { try { checkRuntimeBean(on); fail(); - } catch (InstanceNotFoundException e) { + } catch (final InstanceNotFoundException e) { // No-op } } diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/test/TwoInterfacesExportTest.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/test/TwoInterfacesExportTest.java index 0e6a54fdc9..2a7876255f 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/test/TwoInterfacesExportTest.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/test/TwoInterfacesExportTest.java @@ -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'}")); diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPool.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPool.java index 0f4f00f0ba..4f8de6dfe1 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPool.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPool.java @@ -36,7 +36,7 @@ public class TestingFixedThreadPool implements TestingThreadPoolIfc, Closeable, public static final List allExecutors = Collections .synchronizedList(Lists.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); } diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPoolModule.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPoolModule.java index c773dd232b..a6c9b59605 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPoolModule.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPoolModule.java @@ -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); } } diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPoolModuleFactory.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPoolModuleFactory.java index 2fef47eb10..e78ae98009 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPoolModuleFactory.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPoolModuleFactory.java @@ -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; } diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/test/SimpleConfigurationTest.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/test/SimpleConfigurationTest.java index df08f894c9..d837ffcdb4 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/test/SimpleConfigurationTest.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/test/SimpleConfigurationTest.java @@ -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> exception : e .getFailedValidations().entrySet()) { for (Map.Entry 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> exception : e .getFailedValidations().entrySet()) { for (Map.Entry entry : exception @@ -179,7 +179,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest { } try { transaction.commit(); - } catch (ValidationException e) { + } catch (final ValidationException e) { for (Map.Entry> exception : e .getFailedValidations().entrySet()) { for (Map.Entry 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());