config-api: final parameters 13/56913/2
authorStephen Kitt <skitt@redhat.com>
Thu, 11 May 2017 17:11:11 +0000 (19:11 +0200)
committerTom Pantelis <tompantelis@gmail.com>
Mon, 15 May 2017 11:59:31 +0000 (11:59 +0000)
This automatically-generated patch flags all appropriate parameters as
final (including caught exceptions).

Change-Id: If0dfb559a3d27e6d54af29ad7f3f1796d5d4ffd4
Signed-off-by: Stephen Kitt <skitt@redhat.com>
18 files changed:
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/ConflictingVersionException.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/IdentityAttributeRef.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/JmxAttribute.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/JmxAttributeValidationException.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/ModuleFactoryNotFoundException.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/ModuleIdentifier.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/ValidationException.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/CommitStatus.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/ObjectNameUtil.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/constants/ConfigRegistryConstants.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/notifications/CommitJMXNotification.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/notifications/ConfigJMXNotification.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/osgi/ServiceNotFoundException.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/osgi/WaitingServiceTracker.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/spi/AbstractModule.java
opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/JmxAttributeValidationExceptionTest.java
opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/ValidationExceptionTest.java
opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/jmx/ObjectNameUtilTest.java

index 2edf2614999776c32230d7f275d80430e692b31b..bb0256174c25f28ec30e32db61e5d406cee7503d 100644 (file)
@@ -21,15 +21,15 @@ public class ConflictingVersionException extends Exception {
         super();
     }
 
-    public ConflictingVersionException(String message, Throwable cause) {
+    public ConflictingVersionException(final String message, final Throwable cause) {
         super(message, cause);
     }
 
-    public ConflictingVersionException(String message) {
+    public ConflictingVersionException(final String message) {
         super(message);
     }
 
-    public ConflictingVersionException(Throwable cause) {
+    public ConflictingVersionException(final Throwable cause) {
         super(cause);
     }
 
index e1462b6b703d046a7c46f72611840220f514ed8e..23d8691f54674f12cc01f51b38e45ef1e8a17b62 100644 (file)
@@ -17,7 +17,7 @@ public final class IdentityAttributeRef {
     private final String qNameOfIdentity;
 
     @ConstructorProperties(QNAME_ATTR_NAME)
-    public IdentityAttributeRef(String qNameOfIdentity) {
+    public IdentityAttributeRef(final String qNameOfIdentity) {
         if (qNameOfIdentity == null) {
             throw new NullPointerException("Parameter " + QNAME_ATTR_NAME + " is null");
         }
@@ -28,11 +28,11 @@ public final class IdentityAttributeRef {
         return qNameOfIdentity;
     }
 
-    public <T extends BaseIdentity> Class<? extends T> resolveIdentity(DependencyResolver resolver, Class<T> baseIdentity) {
+    public <T extends BaseIdentity> Class<? extends T> resolveIdentity(final DependencyResolver resolver, final Class<T> baseIdentity) {
         return resolver.resolveIdentity(this, baseIdentity);
     }
 
-    public <T extends BaseIdentity> void validateIdentity(DependencyResolver resolver, Class<T> baseIdentity, JmxAttribute jmxAttribute) {
+    public <T extends BaseIdentity> void validateIdentity(final DependencyResolver resolver, final Class<T> baseIdentity, final JmxAttribute jmxAttribute) {
         resolver.validateIdentity(this, baseIdentity, jmxAttribute);
     }
 
@@ -45,7 +45,7 @@ public final class IdentityAttributeRef {
     }
 
     @Override
-    public boolean equals(Object o) {
+    public boolean equals(final Object o) {
         if (this == o) {
             return true;
         }
index 7ce602ae49685600ec4d9a990465ce2ce69398b4..068322cc89c29b8b927a301a1c26cf19db43afe7 100644 (file)
@@ -14,7 +14,7 @@ package org.opendaylight.controller.config.api;
 public class JmxAttribute {
     private final String attributeName;
 
-    public JmxAttribute(String attributeName) {
+    public JmxAttribute(final String attributeName) {
         if (attributeName == null) {
             throw new NullPointerException("Parameter 'attributeName' is null");
         }
@@ -29,7 +29,7 @@ public class JmxAttribute {
     }
 
     @Override
-    public boolean equals(Object o) {
+    public boolean equals(final Object o) {
         if (this == o) {
             return true;
         }
index b09017fe55d1c3ddcff118c0cd21353ea6aa542f..c7b1ed3348c1c05371819091080d762bd87ee5e2 100644 (file)
@@ -20,32 +20,32 @@ public class JmxAttributeValidationException extends RuntimeException {
     private static final long serialVersionUID = 1L;
     private final List<JmxAttribute> attributeNames;
 
-    public JmxAttributeValidationException(JmxAttribute jmxAttribute) {
+    public JmxAttributeValidationException(final JmxAttribute jmxAttribute) {
         this(Arrays.asList(jmxAttribute));
     }
 
-    public JmxAttributeValidationException(List<JmxAttribute> jmxAttribute) {
+    public JmxAttributeValidationException(final List<JmxAttribute> jmxAttribute) {
         this.attributeNames = jmxAttribute;
     }
 
-    public JmxAttributeValidationException(String message,
-            JmxAttribute jmxAttribute) {
+    public JmxAttributeValidationException(final String message,
+            final JmxAttribute jmxAttribute) {
         this(message, Arrays.asList(jmxAttribute));
     }
 
-    public JmxAttributeValidationException(String message,
-            List<JmxAttribute> jmxAttributes) {
+    public JmxAttributeValidationException(final String message,
+            final List<JmxAttribute> jmxAttributes) {
         super(message);
         this.attributeNames = jmxAttributes;
     }
 
-    public JmxAttributeValidationException(String message, Throwable cause,
-            JmxAttribute jmxAttribute) {
+    public JmxAttributeValidationException(final String message, final Throwable cause,
+            final JmxAttribute jmxAttribute) {
         this(message, cause, Arrays.asList(jmxAttribute));
     }
 
-    public JmxAttributeValidationException(String message, Throwable cause,
-            List<JmxAttribute> jmxAttributes) {
+    public JmxAttributeValidationException(final String message, final Throwable cause,
+            final List<JmxAttribute> jmxAttributes) {
         super(message, cause);
         this.attributeNames = jmxAttributes;
     }
@@ -54,13 +54,13 @@ public class JmxAttributeValidationException extends RuntimeException {
         return attributeNames;
     }
 
-    public static <T> T checkNotNull(T param, JmxAttribute jmxAttribute) {
+    public static <T> T checkNotNull(final T param, final JmxAttribute jmxAttribute) {
         String message = "is null";
         return checkNotNull(param, message, jmxAttribute);
     }
 
-    public static <T> T checkNotNull(T param, String message,
-            JmxAttribute jmxAttribute) {
+    public static <T> T checkNotNull(final T param, final String message,
+            final JmxAttribute jmxAttribute) {
         if (param == null) {
             throw new JmxAttributeValidationException(
                     jmxAttribute.getAttributeName() + " " + message,
@@ -69,21 +69,21 @@ public class JmxAttributeValidationException extends RuntimeException {
         return param;
     }
 
-    public static JmxAttributeValidationException wrap(Throwable throwable,
-            JmxAttribute jmxAttribute) throws JmxAttributeValidationException {
+    public static JmxAttributeValidationException wrap(final Throwable throwable,
+            final JmxAttribute jmxAttribute) throws JmxAttributeValidationException {
         return wrap(throwable, throwable.getMessage(), jmxAttribute);
     }
 
-    public static JmxAttributeValidationException wrap(Throwable throwable,
-            String message, JmxAttribute jmxAttribute) {
+    public static JmxAttributeValidationException wrap(final Throwable throwable,
+            final String message, final JmxAttribute jmxAttribute) {
 
         throw new JmxAttributeValidationException(
                 jmxAttribute.getAttributeName() + " " + message, throwable,
                 jmxAttribute);
     }
 
-    public static void checkCondition(boolean condition, String message,
-            JmxAttribute jmxAttribute) throws JmxAttributeValidationException {
+    public static void checkCondition(final boolean condition, final String message,
+            final JmxAttribute jmxAttribute) throws JmxAttributeValidationException {
         if (!condition) {
             throw new JmxAttributeValidationException(
                     jmxAttribute.getAttributeName() + " " + message,
index 6d8f65446329d86eda81f8b9aeecec2d556bd1ed..029367ff1badcc4610ab28314cfc0f3964ad9858 100644 (file)
@@ -17,7 +17,7 @@ public class ModuleFactoryNotFoundException extends RuntimeException {
 
     private final String moduleName;
 
-    public ModuleFactoryNotFoundException(String moduleName) {
+    public ModuleFactoryNotFoundException(final String moduleName) {
         super("ModuleFactory not found for module name: " + moduleName);
         this.moduleName = moduleName;
     }
index 7baaf9f6e45021bb87dced0ee189fa889767e52d..c7d1df895bd353901c6aeefd54d75e874fd46f69 100644 (file)
@@ -13,7 +13,7 @@ public class ModuleIdentifier implements Identifier {
     private static final long serialVersionUID = 1L;
     private final String factoryName, instanceName;
 
-    public ModuleIdentifier(String factoryName, String instanceName) {
+    public ModuleIdentifier(final String factoryName, final String instanceName) {
         if (factoryName == null) {
             throw new IllegalArgumentException("Parameter 'factoryName' is null");
         }
@@ -33,7 +33,7 @@ public class ModuleIdentifier implements Identifier {
     }
 
     @Override
-    public boolean equals(Object o) {
+    public boolean equals(final Object o) {
         if (this == o) {
             return true;
         }
index 82b73d419e402a31f85a4dfeba7266c26d86b802..f1c90920be8c5bcaa3dbceb44226b057547560df 100644 (file)
@@ -26,13 +26,13 @@ public class ValidationException extends Exception {
     private final Map<String/* module name */, Map<String/* instance name */, ExceptionMessageWithStackTrace>> failedValidations;
 
     public ValidationException(
-            Map<String /* module name */, Map<String /* instance name */, ExceptionMessageWithStackTrace>> failedValidations) {
+            final Map<String /* module name */, Map<String /* instance name */, ExceptionMessageWithStackTrace>> failedValidations) {
         super(failedValidations.toString());
         this.failedValidations = Collections.unmodifiableMap(failedValidations);
     }
 
     public static ValidationException createFromCollectedValidationExceptions(
-            List<ValidationException> collectedExceptions) {
+            final List<ValidationException> collectedExceptions) {
         Map<String, Map<String, ExceptionMessageWithStackTrace>> failedValidations = new HashMap<>();
         for (ValidationException ve : collectedExceptions) {
             for (Entry<String, Map<String, ExceptionMessageWithStackTrace>> outerEntry : ve
@@ -62,7 +62,7 @@ public class ValidationException extends Exception {
     }
 
     public static ValidationException createForSingleException(
-            ModuleIdentifier moduleIdentifier, Exception e) {
+            final ModuleIdentifier moduleIdentifier, final Exception e) {
         Map<String, Map<String, ExceptionMessageWithStackTrace>> failedValidations = new HashMap<>();
         Map<String, ExceptionMessageWithStackTrace> innerMap = new HashMap<>();
 
@@ -82,12 +82,12 @@ public class ValidationException extends Exception {
         public ExceptionMessageWithStackTrace() {
         }
 
-        public ExceptionMessageWithStackTrace(String message, String stackTrace) {
+        public ExceptionMessageWithStackTrace(final String message, final String stackTrace) {
             this.message = message;
             this.stackTrace = stackTrace;
         }
 
-        public ExceptionMessageWithStackTrace(Exception e) {
+        public ExceptionMessageWithStackTrace(final Exception e) {
             this(e.getMessage(), Arrays.toString(e.getStackTrace()));
         }
 
@@ -99,11 +99,11 @@ public class ValidationException extends Exception {
             return stackTrace;
         }
 
-        public void setMessage(String message) {
+        public void setMessage(final String message) {
             this.message = message;
         }
 
-        public void setTrace(String stackTrace) {
+        public void setTrace(final String stackTrace) {
             this.stackTrace = stackTrace;
         }
 
@@ -119,7 +119,7 @@ public class ValidationException extends Exception {
         }
 
         @Override
-        public boolean equals(Object obj) {
+        public boolean equals(final Object obj) {
             if (this == obj) {
                 return true;
             }
index 3fb0604f20789888dcc7686bf64fbd129d7f13ad..33f811c739436a5497a5fe8d55766e102ef513bb 100644 (file)
@@ -25,9 +25,9 @@ public class CommitStatus {
      */
     @ConstructorProperties({"newInstances", "reusedInstances",
             "recreatedInstances"})
-    public CommitStatus(List<ObjectName> newInstances,
-                        List<ObjectName> reusedInstances,
-                        List<ObjectName> recreatedInstances) {
+    public CommitStatus(final List<ObjectName> newInstances,
+                        final List<ObjectName> reusedInstances,
+                        final List<ObjectName> recreatedInstances) {
         this.newInstances = Collections.unmodifiableList(newInstances);
         this.reusedInstances = Collections.unmodifiableList(reusedInstances);
         this.recreatedInstances = Collections
@@ -71,7 +71,7 @@ public class CommitStatus {
     }
 
     @Override
-    public boolean equals(Object obj) {
+    public boolean equals(final Object obj) {
         if (this == obj) {
             return true;
         }
index 0c7478dca0f1008955bcc03c60cd17d3bb309287..1165d7a3992f8bd76602600d021547097f236aad 100644 (file)
@@ -45,77 +45,77 @@ public class ObjectNameUtil {
     private static final String REPLACED_QUOTATION_MARK = "\\?";
     public static final String ON_WILDCARD = "*";
 
-    public static ObjectName createON(String on) {
+    public static ObjectName createON(final String on) {
         try {
             return new ObjectName(on);
-        } catch (MalformedObjectNameException e) {
+        } catch (final MalformedObjectNameException e) {
             throw new IllegalArgumentException(e);
         }
     }
 
-    public static ObjectName createONWithDomainAndType(String type) {
+    public static ObjectName createONWithDomainAndType(final String type) {
         return ConfigRegistryConstants.createONWithDomainAndType(type);
     }
 
-    public static ObjectName createON(String name, String key, String value) {
+    public static ObjectName createON(final String name, final String key, final String value) {
         return ConfigRegistryConstants.createON(name, key, value);
     }
 
-    public static ObjectName createON(String domain, Map<String, String> attribs) {
+    public static ObjectName createON(final String domain, final Map<String, String> attribs) {
         Hashtable<String, String> table = new Hashtable<>(attribs);
         try {
             return new ObjectName(domain, table);
-        } catch (MalformedObjectNameException e) {
+        } catch (final MalformedObjectNameException e) {
             throw new IllegalArgumentException(e);
         }
 
     }
 
     public static ObjectName createTransactionControllerON(
-            String transactionName) {
+            final String transactionName) {
         Map<String, String> onParams = new HashMap<>();
         onParams.put(TRANSACTION_NAME_KEY, transactionName);
         onParams.put(TYPE_KEY, TYPE_CONFIG_TRANSACTION);
         return createON(ON_DOMAIN, onParams);
     }
 
-    public static ObjectName createTransactionModuleON(String transactionName,
-                                                       ModuleIdentifier moduleIdentifier) {
+    public static ObjectName createTransactionModuleON(final String transactionName,
+                                                       final ModuleIdentifier moduleIdentifier) {
         return createTransactionModuleON(transactionName,
                 moduleIdentifier.getFactoryName(),
                 moduleIdentifier.getInstanceName());
     }
 
-    public static ObjectName createTransactionModuleON(String transactionName,
-                                                       String moduleName, String instanceName) {
+    public static ObjectName createTransactionModuleON(final String transactionName,
+                                                       final String moduleName, final String instanceName) {
         Map<String, String> onParams = createModuleMap(moduleName, instanceName);
         onParams.put(TRANSACTION_NAME_KEY, transactionName);
         return createON(ON_DOMAIN, onParams);
     }
 
-    public static ObjectName createTransactionModuleON(String transactionName,
-                                                       ObjectName on) {
+    public static ObjectName createTransactionModuleON(final String transactionName,
+                                                       final ObjectName on) {
         return createTransactionModuleON(transactionName, getFactoryName(on),
                 getInstanceName(on));
     }
 
     public static ObjectName createReadOnlyModuleON(
-            ModuleIdentifier moduleIdentifier) {
+            final ModuleIdentifier moduleIdentifier) {
         return createReadOnlyModuleON(moduleIdentifier.getFactoryName(),
                 moduleIdentifier.getInstanceName());
     }
 
-    public static ObjectName createReadOnlyServiceON(String serviceQName, String refName) {
+    public static ObjectName createReadOnlyServiceON(final String serviceQName, final String refName) {
         Map<String, String> onParams = createServiceMap(serviceQName, refName);
         return createON(ON_DOMAIN, onParams);
     }
 
-    public static ObjectName createTransactionServiceON(String transactionName, String serviceQName, String refName) {
+    public static ObjectName createTransactionServiceON(final String transactionName, final String serviceQName, final String refName) {
         Map<String, String> onParams = createServiceON(transactionName, serviceQName, refName);
         return createON(ON_DOMAIN, onParams);
     }
 
-    public static String getServiceQName(ObjectName objectName) {
+    public static String getServiceQName(final ObjectName objectName) {
         checkType(objectName, TYPE_SERVICE_REFERENCE);
         String quoted = objectName.getKeyProperty(SERVICE_QNAME_KEY);
         return unquoteAndUnescape(objectName, quoted);
@@ -124,7 +124,7 @@ public class ObjectNameUtil {
     // ObjectName supports quotation and ignores tokens like =, but fails to ignore ? sign.
     // It must be replaced with another character that hopefully does not collide
     // with actual value.
-    private static String unquoteAndUnescape(ObjectName objectName, String quoted) {
+    private static String unquoteAndUnescape(final ObjectName objectName, final String quoted) {
         if (quoted == null) {
             throw new IllegalArgumentException("Cannot find " + SERVICE_QNAME_KEY + " in " + objectName);
         }
@@ -137,24 +137,24 @@ public class ObjectNameUtil {
         return substring;
     }
 
-    private static String quoteAndEscapeValue(String serviceQName) {
+    private static String quoteAndEscapeValue(final String serviceQName) {
         return "\"" + serviceQName.replace("?", REPLACED_QUOTATION_MARK) + "\"";
     }
 
-    public static String getReferenceName(ObjectName objectName) {
+    public static String getReferenceName(final ObjectName objectName) {
         checkType(objectName, TYPE_SERVICE_REFERENCE);
         return objectName.getKeyProperty(REF_NAME_KEY);
     }
 
-    private static Map<String, String> createServiceON(String transactionName, String serviceQName,
-                                                       String refName) {
+    private static Map<String, String> createServiceON(final String transactionName, final String serviceQName,
+                                                       final String refName) {
         Map<String, String> result = new HashMap<>(createServiceMap(serviceQName, refName));
         result.put(TRANSACTION_NAME_KEY, transactionName);
         return result;
     }
 
-    private static Map<String, String> createServiceMap(String serviceQName,
-                                                        String refName) {
+    private static Map<String, String> createServiceMap(final String serviceQName,
+                                                        final String refName) {
         Map<String, String> onParams = new HashMap<>();
         onParams.put(TYPE_KEY, TYPE_SERVICE_REFERENCE);
         onParams.put(SERVICE_QNAME_KEY, quoteAndEscapeValue(serviceQName));
@@ -163,14 +163,14 @@ public class ObjectNameUtil {
     }
 
 
-    public static ObjectName createReadOnlyModuleON(String moduleName,
-                                                    String instanceName) {
+    public static ObjectName createReadOnlyModuleON(final String moduleName,
+                                                    final String instanceName) {
         Map<String, String> onParams = createModuleMap(moduleName, instanceName);
         return createON(ON_DOMAIN, onParams);
     }
 
-    private static Map<String, String> createModuleMap(String moduleName,
-                                                       String instanceName) {
+    private static Map<String, String> createModuleMap(final String moduleName,
+                                                       final String instanceName) {
         Map<String, String> onParams = new HashMap<>();
         onParams.put(TYPE_KEY, TYPE_MODULE);
         onParams.put(MODULE_FACTORY_NAME_KEY, moduleName);
@@ -178,24 +178,24 @@ public class ObjectNameUtil {
         return onParams;
     }
 
-    public static String getFactoryName(ObjectName objectName) {
+    public static String getFactoryName(final ObjectName objectName) {
         checkTypeOneOf(objectName, TYPE_MODULE, TYPE_RUNTIME_BEAN);
         return objectName.getKeyProperty(MODULE_FACTORY_NAME_KEY);
     }
 
-    public static String getInstanceName(ObjectName objectName) {
+    public static String getInstanceName(final ObjectName objectName) {
         checkTypeOneOf(objectName, TYPE_MODULE, TYPE_RUNTIME_BEAN);
         return objectName.getKeyProperty(INSTANCE_NAME_KEY);
     }
 
-    public static String getTransactionName(ObjectName objectName) {
+    public static String getTransactionName(final ObjectName objectName) {
         return objectName.getKeyProperty(TRANSACTION_NAME_KEY);
     }
 
     /**
      * Sanitize on: keep only mandatory attributes of module + metadata.
      */
-    public static ObjectName withoutTransactionName(ObjectName inputON) {
+    public static ObjectName withoutTransactionName(final ObjectName inputON) {
         checkTypeOneOf(inputON, TYPE_MODULE, TYPE_SERVICE_REFERENCE);
         if (getTransactionName(inputON) == null) {
             throw new IllegalArgumentException(
@@ -224,7 +224,7 @@ public class ObjectNameUtil {
         return createON(ON_DOMAIN, outputProperties);
     }
 
-    public static ObjectName withTransactionName(ObjectName inputON, String transactionName) {
+    public static ObjectName withTransactionName(final ObjectName inputON, final String transactionName) {
         Map<String, String> additionalProperties = getAdditionalProperties(inputON);
         additionalProperties.put(TRANSACTION_NAME_KEY, transactionName);
         return createON(inputON.getDomain(), additionalProperties);
@@ -232,7 +232,7 @@ public class ObjectNameUtil {
     }
 
     private static void assertDoesNotContain(
-            Map<String, String> additionalProperties, String key) {
+            final Map<String, String> additionalProperties, final String key) {
         if (additionalProperties.containsKey(key)) {
             throw new IllegalArgumentException(
                     "Map 'additionalProperties' cannot overwrite attribute "
@@ -240,8 +240,8 @@ public class ObjectNameUtil {
         }
     }
 
-    public static ObjectName createRuntimeBeanName(String moduleName,
-                                                   String instanceName, Map<String, String> additionalProperties) {
+    public static ObjectName createRuntimeBeanName(final String moduleName,
+                                                   final String instanceName, final Map<String, String> additionalProperties) {
         // check that there is no overwriting of default attributes
         assertDoesNotContain(additionalProperties, MODULE_FACTORY_NAME_KEY);
         assertDoesNotContain(additionalProperties, INSTANCE_NAME_KEY);
@@ -258,7 +258,7 @@ public class ObjectNameUtil {
             MODULE_FACTORY_NAME_KEY, INSTANCE_NAME_KEY, TYPE_KEY));
 
     public static Map<String, String> getAdditionalPropertiesOfRuntimeBeanName(
-            ObjectName on) {
+            final ObjectName on) {
         checkType(on, TYPE_RUNTIME_BEAN);
         Map<String, String> allProperties = getAdditionalProperties(on);
         Map<String, String> result = new HashMap<>();
@@ -270,7 +270,7 @@ public class ObjectNameUtil {
         return result;
     }
 
-    public static Map<String, String> getAdditionalProperties(ObjectName on) {
+    public static Map<String, String> getAdditionalProperties(final ObjectName on) {
         Map<String, String> keyPropertyList = on.getKeyPropertyList();
         Map<String, String> result = new HashMap<>();
         for (Entry<String, String> entry : keyPropertyList.entrySet()) {
@@ -279,21 +279,21 @@ public class ObjectNameUtil {
         return result;
     }
 
-    public static void checkDomain(ObjectName objectName) {
+    public static void checkDomain(final ObjectName objectName) {
         if (!ON_DOMAIN.equals(objectName.getDomain())) {
             throw new IllegalArgumentException("Wrong domain " + objectName);
         }
 
     }
 
-    public static void checkType(ObjectName objectName, String type) {
+    public static void checkType(final ObjectName objectName, final String type) {
         if (!type.equals(objectName.getKeyProperty(TYPE_KEY))) {
             throw new IllegalArgumentException("Wrong type, expected '" + type
                     + "', got " + objectName);
         }
     }
 
-    public static void checkTypeOneOf(ObjectName objectName, String... types) {
+    public static void checkTypeOneOf(final ObjectName objectName, final String... types) {
         for (String type : types) {
             if (type.equals(objectName.getKeyProperty(TYPE_KEY))) {
                 return;
@@ -303,8 +303,8 @@ public class ObjectNameUtil {
                 + ", got " + objectName);
     }
 
-    public static ObjectName createModulePattern(String moduleName,
-                                                 String instanceName) {
+    public static ObjectName createModulePattern(final String moduleName,
+                                                 final String instanceName) {
         String finalModuleName = moduleName == null ? ON_WILDCARD : moduleName;
         String finalInstanceName = instanceName == null ? ON_WILDCARD : instanceName;
 
@@ -319,8 +319,8 @@ public class ObjectNameUtil {
         return namePattern;
     }
 
-    public static ObjectName createModulePattern(String ifcName,
-                                                 String instanceName, String transactionName) {
+    public static ObjectName createModulePattern(final String ifcName,
+                                                 final String instanceName, final String transactionName) {
         String finalIfcName = ifcName == null ? ON_WILDCARD : ifcName;
         String finalInstanceName = instanceName == null ? ON_WILDCARD : instanceName;
         String finalTransactionName = transactionName == null ? ON_WILDCARD : transactionName;
@@ -332,8 +332,8 @@ public class ObjectNameUtil {
                 + "=" + finalTransactionName);
     }
 
-    public static ObjectName createRuntimeBeanPattern(String moduleName,
-                                                      String instanceName) {
+    public static ObjectName createRuntimeBeanPattern(final String moduleName,
+                                                      final String instanceName) {
         String finalModuleName = moduleName == null ? ON_WILDCARD : moduleName;
         String finalInstanceName = instanceName == null ? ON_WILDCARD : instanceName;
 
@@ -346,8 +346,8 @@ public class ObjectNameUtil {
 
     }
 
-    public static ModuleIdentifier fromON(ObjectName objectName,
-                                          String expectedType) {
+    public static ModuleIdentifier fromON(final ObjectName objectName,
+                                          final String expectedType) {
         checkType(objectName, expectedType);
         String factoryName = getFactoryName(objectName);
         if (factoryName == null) {
@@ -362,7 +362,7 @@ public class ObjectNameUtil {
         return new ModuleIdentifier(factoryName, instanceName);
     }
 
-    public static boolean isServiceReference(ObjectName objectName) {
+    public static boolean isServiceReference(final ObjectName objectName) {
         return TYPE_SERVICE_REFERENCE.equals(objectName.getKeyProperty(TYPE_KEY));
     }
 }
index bcac188ab36cdac7ec24ae2feab84e04ea01ac4c..eae93e4d56b7dd7cdbf8fb39e8e3569a23f9438c 100644 (file)
@@ -29,14 +29,14 @@ public class ConfigRegistryConstants {
 
     public static final String GET_AVAILABLE_MODULE_NAMES_ATTRIBUT_NAME = "AvailableModuleNames";
 
-    public static ObjectName createONWithDomainAndType(String type) {
+    public static ObjectName createONWithDomainAndType(final String type) {
         return createON(ON_DOMAIN, TYPE_KEY, type);
     }
 
-    public static ObjectName createON(String name, String key, String value) {
+    public static ObjectName createON(final String name, final String key, final String value) {
         try {
             return new ObjectName(name, key, value);
-        } catch (MalformedObjectNameException e) {
+        } catch (final MalformedObjectNameException e) {
             throw new IllegalArgumentException(e);
         }
 
index 79c792945f34c051740ca38c14f54e7cf27eb250..1a49b887c7f71b22604797526a582068faaccd15 100644 (file)
@@ -14,7 +14,7 @@ public class CommitJMXNotification extends ConfigJMXNotification {
 
     private static final String AFTER_COMMIT_MESSAGE_TEMPLATE = "Commit successful: %s";
 
-    CommitJMXNotification(NotificationBroadcasterSupport source, String message) {
+    CommitJMXNotification(final NotificationBroadcasterSupport source, final String message) {
         super(ConfigJMXNotification.NotificationType.COMMIT,  source, String.format(AFTER_COMMIT_MESSAGE_TEMPLATE, message));
     }
 
index 2548711aa294401ef8698e362b28e0117779b187..842c30aaa53c1a0d1e531b1af14b3dbb8065d77c 100644 (file)
@@ -27,8 +27,8 @@ public abstract class ConfigJMXNotification extends Notification {
 
     private final NotificationType type;
 
-    protected ConfigJMXNotification(NotificationType type,
-                                    NotificationBroadcasterSupport source, String message) {
+    protected ConfigJMXNotification(final NotificationType type,
+                                    final NotificationBroadcasterSupport source, final String message) {
         super(type.toString(), source, sequenceNumber++, System.nanoTime(), message);
         this.type = type;
     }
@@ -50,7 +50,7 @@ public abstract class ConfigJMXNotification extends Notification {
      *
      * Intended for config-persister.
      */
-    public static CommitJMXNotification afterCommit(NotificationBroadcasterSupport source, String messages) {
+    public static CommitJMXNotification afterCommit(final NotificationBroadcasterSupport source, final String messages) {
         return new CommitJMXNotification(source, messages);
     }
 
index 0d9e7f0a34aeca95ecd494f4cf515be9d8e47c17..2c6d76a9d687509600232fc9c7a0d7b1ee810ee1 100644 (file)
@@ -15,11 +15,11 @@ package org.opendaylight.controller.config.api.osgi;
 public class ServiceNotFoundException extends RuntimeException {
     private static final long serialVersionUID = 1L;
 
-    public ServiceNotFoundException(String message, Throwable cause) {
+    public ServiceNotFoundException(final String message, final Throwable cause) {
         super(message, cause);
     }
 
-    public ServiceNotFoundException(String message) {
+    public ServiceNotFoundException(final String message) {
         super(message);
     }
 }
index d6abc64dda0571e0014c6f0fa9541844cdd71a9a..e06d7002dd9aeeee5c668e032598cf347e7deab6 100644 (file)
@@ -28,7 +28,7 @@ public final class WaitingServiceTracker<T> implements AutoCloseable {
     private final ServiceTracker<T, ?> tracker;
     private final Class<T> serviceInterface;
 
-    private WaitingServiceTracker(Class<T> serviceInterface, ServiceTracker<T, ?> tracker) {
+    private WaitingServiceTracker(final Class<T> serviceInterface, final ServiceTracker<T, ?> tracker) {
         this.tracker = tracker;
         this.serviceInterface = serviceInterface;
     }
@@ -41,7 +41,7 @@ public final class WaitingServiceTracker<T> implements AutoCloseable {
      * @throws ServiceNotFoundException if it times out or is interrupted
      */
     @SuppressWarnings("unchecked")
-    public T waitForService(long timeoutInMillis) throws ServiceNotFoundException {
+    public T waitForService(final long timeoutInMillis) throws ServiceNotFoundException {
         try {
             T service = (T) tracker.waitForService(timeoutInMillis);
             if(service == null) {
@@ -50,7 +50,7 @@ public final class WaitingServiceTracker<T> implements AutoCloseable {
             }
 
             return service;
-        } catch(InterruptedException e) {
+        } catch(final InterruptedException e) {
             throw new ServiceNotFoundException(String.format("Wait for OSGi service %s was interrrupted",
                     serviceInterface));
         }
@@ -63,7 +63,7 @@ public final class WaitingServiceTracker<T> implements AutoCloseable {
      * @param context the BundleContext
      * @return new WaitingServiceTracker instance
      */
-    public static <T> WaitingServiceTracker<T> create(@Nonnull Class<T> serviceInterface, @Nonnull BundleContext context) {
+    public static <T> WaitingServiceTracker<T> create(@Nonnull final Class<T> serviceInterface, @Nonnull final BundleContext context) {
         ServiceTracker<T, ?> tracker = new ServiceTracker<>(context, serviceInterface, null);
         tracker.open();
         return new WaitingServiceTracker<>(serviceInterface, tracker);
@@ -77,14 +77,14 @@ public final class WaitingServiceTracker<T> implements AutoCloseable {
      * @param filter the OSGi service filter
      * @return new WaitingServiceTracker instance
      */
-    public static <T> WaitingServiceTracker<T> create(@Nonnull Class<T> serviceInterface, @Nonnull BundleContext context,
-            @Nonnull String filter) {
+    public static <T> WaitingServiceTracker<T> create(@Nonnull final Class<T> serviceInterface, @Nonnull final BundleContext context,
+            @Nonnull final String filter) {
         String newFilter = String.format("(&(%s=%s)%s)", Constants.OBJECTCLASS, serviceInterface.getName(), filter);
         try {
             ServiceTracker<T, ?> tracker = new ServiceTracker<>(context, context.createFilter(newFilter), null);
             tracker.open();
             return new WaitingServiceTracker<>(serviceInterface, tracker);
-        } catch(InvalidSyntaxException e) {
+        } catch(final InvalidSyntaxException e) {
             throw new IllegalArgumentException(String.format("Invalid OSGi filter %s", newFilter), e);
         }
     }
@@ -93,7 +93,7 @@ public final class WaitingServiceTracker<T> implements AutoCloseable {
     public void close() {
         try {
             tracker.close();
-        } catch(RuntimeException e) {
+        } catch(final RuntimeException e) {
             // The ServiceTracker could throw IllegalStateException if the BundleContext is already closed.
             // This is benign so ignore it.
             LOG.debug("Error closing ServiceTracker", e);
index 9f6a5512ca6ef60070ef2528398e67261884684e..b9addee95259a57b96f6fd148e99c9e8efec700e 100644 (file)
@@ -59,7 +59,7 @@ public abstract class AbstractModule<M extends AbstractModule<M>> implements org
         return identifier;
     }
 
-    public final void setCanReuseInstance(boolean canReuseInstance) {
+    public final void setCanReuseInstance(final boolean canReuseInstance) {
         this.canReuseInstance = canReuseInstance;
     }
 
@@ -79,7 +79,7 @@ public abstract class AbstractModule<M extends AbstractModule<M>> implements org
                 if (oldInstance != null) {
                     try {
                         oldInstance.close();
-                    } catch (Exception e) {
+                    } catch (final Exception e) {
                         LOG.error("An error occurred while closing old instance {} for module {}", oldInstance, getIdentifier(), e);
                     }
                 }
index 66c9f5901346207827c63f412e30a0980571674f..4df59addc298f5142e1fc4133f2faee6a0a42551 100644 (file)
@@ -63,7 +63,7 @@ public class JmxAttributeValidationExceptionTest {
     public void testCheckNotNull() throws Exception {
         try {
             JmxAttributeValidationException.checkNotNull(false, jmxAttribute);
-        } catch (JmxAttributeValidationException e) {
+        } catch (final JmxAttributeValidationException e) {
             assertJmxEx(e, jmxAttribute.getAttributeName() + " " + "message", jmxAttribute);
         }
     }
index 5ee537e17e5cd40eb612f36615e09f31cdca1660..3f4bd858237de6fd712c9337fb1da190adb941dd 100644 (file)
@@ -53,7 +53,7 @@ public class ValidationExceptionTest {
         ValidationException single2 = ValidationException.createForSingleException(mi, e);
         try {
             ValidationException.createFromCollectedValidationExceptions(Lists.newArrayList(single, single2));
-        } catch (IllegalArgumentException ex) {
+        } catch (final IllegalArgumentException ex) {
             // Duplicate exception
             assertThat(ex.getMessage(), containsString("Cannot merge"));
             return;
index ad1a53a5436b8572184275c473f47d7b1f11502b..a9be8e984a5aed0f999c74e6fd41c1acf83eb715 100644 (file)
@@ -151,7 +151,7 @@ public class ObjectNameUtilTest {
     private void assertFailure(final Runnable test, final Class<? extends Exception> ex) {
         try {
             test.run();
-        } catch(Exception e) {
+        } catch(final Exception e) {
             assertTrue("Failed with wrong exception: " + Throwables.getStackTraceAsString(e),
                     e.getClass().isAssignableFrom(ex));
             return;