config-manager-facade-xml: final parameters 15/56915/3
authorStephen Kitt <skitt@redhat.com>
Fri, 12 May 2017 07:42:45 +0000 (09:42 +0200)
committerTom Pantelis <tompantelis@gmail.com>
Mon, 15 May 2017 11:58:27 +0000 (11:58 +0000)
This automatically-generated patch flags all appropriate parameters as
final (including caught exceptions).

Change-Id: I957543aa948a5d2473b7b61ffc3de52467f11d76
Signed-off-by: Stephen Kitt <skitt@redhat.com>
56 files changed:
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/CandidateDatastoreQueryStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/ConfigExecution.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/ConfigSubsystemFacade.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/Datastore.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/RpcFacade.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/RunningDatastoreQueryStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/TestOption.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/IdentityMapping.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/AttributeIfcSwitchStatement.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/fromxml/AbstractAttributeReadingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/fromxml/ArrayAttributeReadingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/fromxml/AttributeConfigElement.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/fromxml/CompositeAttributeReadingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/fromxml/ObjectNameAttributeReadingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/fromxml/ObjectXmlReader.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/fromxml/SimpleAttributeReadingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/fromxml/SimpleBinaryAttributeReadingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/fromxml/SimpleCompositeAttributeReadingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/fromxml/SimpleIdentityRefAttributeReadingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/fromxml/SimpleUnionAttributeReadingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/mapping/AbstractAttributeMappingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/mapping/ArrayAttributeMappingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/mapping/CompositeAttributeMappingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/mapping/EnumAttributeMappingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/mapping/ObjectMapper.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/mapping/ObjectNameAttributeMappingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/mapping/SimpleAttributeMappingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/mapping/UnionCompositeAttributeMappingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/resolving/AbstractAttributeResolvingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/resolving/ArrayAttributeResolvingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/resolving/CompositeAttributeResolvingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/resolving/EnumAttributeResolvingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/resolving/ObjectNameAttributeResolvingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/resolving/ObjectResolver.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/resolving/SimpleAttributeResolvingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/resolving/UnionCompositeAttributeResolvingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/toxml/ArrayAttributeWritingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/toxml/CompositeAttributeWritingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/toxml/ObjectNameAttributeWritingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/toxml/ObjectXmlWriter.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/toxml/RuntimeBeanEntryWritingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/toxml/SimpleAttributeWritingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/toxml/SimpleBinaryAttributeWritingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/toxml/SimpleCompositeAttributeWritingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/toxml/SimpleIdentityRefAttributeWritingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/toxml/SimpleUnionAttributeWritingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/config/Config.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/config/InstanceConfig.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/config/InstanceConfigElementResolved.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/config/ModuleConfig.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/config/ModuleElementDefinition.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/config/ModuleElementResolved.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/config/ServiceRegistryWrapper.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/config/Services.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/rpc/InstanceRuntimeRpc.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/transactions/TransactionProvider.java

index 971fc44e8285ad37ea654bd398cce097fea09fda..3f2fcfaf6fe1d9c7a2760bea8b17ca6a499fb719 100644 (file)
@@ -18,12 +18,12 @@ public class CandidateDatastoreQueryStrategy implements DatastoreQueryStrategy {
 
     private final TransactionProvider transactionProvider;
 
-    public CandidateDatastoreQueryStrategy(TransactionProvider transactionProvider) {
+    public CandidateDatastoreQueryStrategy(final TransactionProvider transactionProvider) {
         this.transactionProvider = transactionProvider;
     }
 
     @Override
-    public Set<ObjectName> queryInstances(ConfigRegistryClient configRegistryClient) {
+    public Set<ObjectName> queryInstances(final ConfigRegistryClient configRegistryClient) {
         ObjectName on = transactionProvider.getOrCreateTransaction();
         ConfigTransactionClient proxy = configRegistryClient.getConfigTransactionClient(on);
         return proxy.lookupConfigBeans();
index 0d49dbf63715b273267d6ebcbf21b3d267d4ebe8..26ba0eafc490ba1bb27757d014d42956d9cece08 100644 (file)
@@ -28,7 +28,7 @@ public class ConfigExecution {
     private final Config configResolver;
     private final XmlElement configElement;
 
-    public ConfigExecution(Config configResolver, XmlElement configElement, TestOption testOption, EditStrategyType defaultStrategy) throws DocumentedException {
+    public ConfigExecution(final Config configResolver, final XmlElement configElement, final TestOption testOption, final EditStrategyType defaultStrategy) throws DocumentedException {
         Config.checkUnrecognisedChildren(configElement);
         this.configResolver = configResolver;
         this.configElement = configElement;
@@ -45,16 +45,18 @@ public class ConfigExecution {
         return testOption == TestOption.set || testOption == TestOption.testThenSet;
     }
 
-    public Map<String, Multimap<String, ModuleElementResolved>> getResolvedXmlElements(ServiceReferenceReadableRegistry serviceRegistry) throws DocumentedException {
+    public Map<String, Multimap<String, ModuleElementResolved>> getResolvedXmlElements(
+            final ServiceReferenceReadableRegistry serviceRegistry) throws DocumentedException {
         return configResolver.fromXmlModulesResolved(configElement, defaultEditStrategyType, getServiceRegistryWrapper(serviceRegistry));
     }
 
-    public ServiceRegistryWrapper getServiceRegistryWrapper(ServiceReferenceReadableRegistry serviceRegistry) {
+    public ServiceRegistryWrapper getServiceRegistryWrapper(final ServiceReferenceReadableRegistry serviceRegistry) {
         // TODO cache service registry
         return new ServiceRegistryWrapper(serviceRegistry);
     }
 
-    public Map<String, Multimap<String,ModuleElementDefinition>> getModulesDefinition(ServiceReferenceReadableRegistry serviceRegistry) throws DocumentedException {
+    public Map<String, Multimap<String,ModuleElementDefinition>> getModulesDefinition(
+            final ServiceReferenceReadableRegistry serviceRegistry) throws DocumentedException {
         return configResolver.fromXmlModulesMap(configElement, defaultEditStrategyType, getServiceRegistryWrapper(serviceRegistry));
     }
 
index d47383469a0fcc1d11e14234851a7be7eb144a1d..781bda575f9bfba6640ed766896ce86c3031adea 100644 (file)
@@ -71,7 +71,7 @@ public class ConfigSubsystemFacade implements Closeable {
     private final ConfigRegistryClient configRegistryClientNoNotifications;
     private final RpcFacade rpcFacade;
 
-    public ConfigSubsystemFacade(ConfigRegistryClient configRegistryClient, ConfigRegistryClient configRegistryClientNoNotifications, YangStoreService yangStoreService, String id) {
+    public ConfigSubsystemFacade(final ConfigRegistryClient configRegistryClient, final ConfigRegistryClient configRegistryClientNoNotifications, final YangStoreService yangStoreService, final String id) {
         this.configRegistryClient = configRegistryClient;
         this.configRegistryClientNoNotifications = configRegistryClientNoNotifications;
         this.yangStoreService = yangStoreService;
@@ -79,7 +79,7 @@ public class ConfigSubsystemFacade implements Closeable {
         rpcFacade = new RpcFacade(yangStoreService, configRegistryClient);
     }
 
-    public ConfigSubsystemFacade(ConfigRegistryClient configRegistryClient, ConfigRegistryClient configRegistryClientNoNotifications, YangStoreService yangStoreService, TransactionProvider txProvider) {
+    public ConfigSubsystemFacade(final ConfigRegistryClient configRegistryClient, final ConfigRegistryClient configRegistryClientNoNotifications, final YangStoreService yangStoreService, final TransactionProvider txProvider) {
         this.configRegistryClient = configRegistryClient;
         this.configRegistryClientNoNotifications = configRegistryClientNoNotifications;
         this.yangStoreService = yangStoreService;
@@ -118,7 +118,7 @@ public class ConfigSubsystemFacade implements Closeable {
         }
     }
 
-    public void executeConfigExecution(ConfigExecution configExecution) throws DocumentedException, ValidationException {
+    public void executeConfigExecution(final ConfigExecution configExecution) throws DocumentedException, ValidationException {
         if (configExecution.shouldTest()) {
             executeTests(configExecution);
         }
@@ -140,17 +140,17 @@ public class ConfigSubsystemFacade implements Closeable {
         return status;
     }
 
-    private void executeSet(ConfigExecution configExecution) throws DocumentedException {
+    private void executeSet(final ConfigExecution configExecution) throws DocumentedException {
         set(configExecution);
         LOG.debug("Set phase for {} operation successful, element: ", configExecution.getDefaultStrategy(), configExecution.getConfigElement());
     }
 
-    private void executeTests(ConfigExecution configExecution) throws DocumentedException, ValidationException {
+    private void executeTests(final ConfigExecution configExecution) throws DocumentedException, ValidationException {
         test(configExecution, configExecution.getDefaultStrategy());
         LOG.debug("Test phase for {} operation successful, element: ", configExecution.getDefaultStrategy(), configExecution.getConfigElement());
     }
 
-    private void test(ConfigExecution execution, EditStrategyType editStrategyType) throws ValidationException, DocumentedException {
+    private void test(final ConfigExecution execution, final EditStrategyType editStrategyType) throws ValidationException, DocumentedException {
         ObjectName taON = transactionProvider.getTestTransaction();
         try {
             // default strategy = replace wipes config
@@ -169,7 +169,7 @@ public class ConfigSubsystemFacade implements Closeable {
         }
     }
 
-    private void set(ConfigExecution ConfigExecution) throws DocumentedException {
+    private void set(final ConfigExecution ConfigExecution) throws DocumentedException {
         ObjectName taON = transactionProvider.getOrCreateTransaction();
 
         // default strategy = replace wipes config
@@ -184,7 +184,7 @@ public class ConfigSubsystemFacade implements Closeable {
         setOnTransaction(ta, ConfigExecution);
     }
 
-    private void setServicesOnTransaction(ConfigTransactionClient ta, ConfigExecution execution) throws DocumentedException {
+    private void setServicesOnTransaction(final ConfigTransactionClient ta, final ConfigExecution execution) throws DocumentedException {
 
         Services services = execution.getServices();
 
@@ -208,7 +208,7 @@ public class ConfigSubsystemFacade implements Closeable {
                             LOG.debug("Saving service {} with on {} under name {} with service on {}", qnameOfService,
                                     on, refNameToServiceEntry.getKey(), saved);
                         }
-                    } catch (InstanceNotFoundException e) {
+                    } catch (final InstanceNotFoundException e) {
                         throw new DocumentedException(String.format("Unable to edit ref name " + refNameToServiceEntry.getKey() + " for instance " + on, e),
                                 ErrorType.APPLICATION,
                                 ErrorTag.OPERATION_FAILED,
@@ -219,11 +219,11 @@ public class ConfigSubsystemFacade implements Closeable {
         }
     }
 
-    private String getQname(ConfigTransactionClient ta, String namespace, String serviceName) {
+    private String getQname(final ConfigTransactionClient ta, final String namespace, final String serviceName) {
         return ta.getServiceInterfaceName(namespace, serviceName);
     }
 
-    private void setOnTransaction(ConfigTransactionClient ta, ConfigExecution execution) throws DocumentedException {
+    private void setOnTransaction(final ConfigTransactionClient ta, final ConfigExecution execution) throws DocumentedException {
 
         for (Multimap<String, ModuleElementResolved> modulesToResolved : execution.getResolvedXmlElements(ta).values()) {
 
@@ -240,8 +240,8 @@ public class ConfigSubsystemFacade implements Closeable {
         }
     }
 
-    private void handleMisssingInstancesOnTransaction(ConfigTransactionClient ta,
-                                                      ConfigExecution execution) throws DocumentedException {
+    private void handleMisssingInstancesOnTransaction(final ConfigTransactionClient ta,
+                                                      final ConfigExecution execution) throws DocumentedException {
 
         for (Multimap<String, ModuleElementDefinition> modulesToResolved : execution.getModulesDefinition(ta).values()) {
             for (Map.Entry<String, ModuleElementDefinition> moduleToResolved : modulesToResolved.entries()) {
@@ -262,7 +262,7 @@ public class ConfigSubsystemFacade implements Closeable {
         return new Config(factories, identitiesMap, snapshot.getEnumResolver());
     }
 
-    private static Map<String, Map<Date, IdentityMapping>> transformIdentities(Set<Module> modules) {
+    private static Map<String, Map<Date, IdentityMapping>> transformIdentities(final Set<Module> modules) {
         Map<String, Map<Date, IdentityMapping>> mappedIds = Maps.newHashMap();
         for (Module module : modules) {
             String namespace = module.getNamespace().toString();
@@ -291,14 +291,15 @@ public class ConfigSubsystemFacade implements Closeable {
 
     public Map<String/* Namespace from yang file */,
             Map<String /* Name of module entry from yang file */, ModuleConfig>> transformMbeToModuleConfigs(
-            Map<String/* Namespace from yang file */,
+            final Map<String/* Namespace from yang file */,
                     Map<String /* Name of module entry from yang file */, ModuleMXBeanEntry>> mBeanEntries) {
         return transformMbeToModuleConfigs(configRegistryClient, mBeanEntries);
     }
 
     public Map<String/* Namespace from yang file */,
-            Map<String /* Name of module entry from yang file */, ModuleConfig>> transformMbeToModuleConfigs(BeanReader reader,
-                                                                                                             Map<String/* Namespace from yang file */,
+            Map<String /* Name of module entry from yang file */, ModuleConfig>> transformMbeToModuleConfigs(
+            final BeanReader reader,
+                                                                                                             final Map<String/* Namespace from yang file */,
                                                                                                                      Map<String /* Name of module entry from yang file */, ModuleMXBeanEntry>> mBeanEntries) {
 
         Map<String, Map<String, ModuleConfig>> namespaceToModuleNameToModuleConfig = Maps.newHashMap();
@@ -328,8 +329,8 @@ public class ConfigSubsystemFacade implements Closeable {
         return new ConfigExecution(configMapping, XmlElement.fromDomElement(xmlToBePersisted), TestOption.testThenSet, EditStrategyType.getDefaultStrategy());
     }
 
-    private Map<String, Map<String, ModuleRuntime>> createModuleRuntimes(ConfigRegistryClient configRegistryClient,
-                                                                         Map<String, Map<String, ModuleMXBeanEntry>> mBeanEntries) {
+    private Map<String, Map<String, ModuleRuntime>> createModuleRuntimes(final ConfigRegistryClient configRegistryClient,
+                                                                         final Map<String, Map<String, ModuleMXBeanEntry>> mBeanEntries) {
         Map<String, Map<String, ModuleRuntime>> retVal = Maps.newHashMap();
 
         for (Map.Entry<String, Map<String, ModuleMXBeanEntry>> namespaceToModuleEntry : mBeanEntries.entrySet()) {
@@ -363,7 +364,7 @@ public class ConfigSubsystemFacade implements Closeable {
         return retVal;
     }
 
-    private InstanceRuntime createInstanceRuntime(RuntimeBeanEntry root, Map<RuntimeBeanEntry, InstanceConfig> cache) {
+    private InstanceRuntime createInstanceRuntime(final RuntimeBeanEntry root, final Map<RuntimeBeanEntry, InstanceConfig> cache) {
         Map<String, InstanceRuntime> children = Maps.newHashMap();
         for (RuntimeBeanEntry child : root.getChildren()) {
             children.put(child.getJavaNamePrefix(), createInstanceRuntime(child, cache));
@@ -372,7 +373,7 @@ public class ConfigSubsystemFacade implements Closeable {
         return new InstanceRuntime(cache.get(root), children, createJmxToYangMap(root.getChildren()));
     }
 
-    private Map<String, String> createJmxToYangMap(List<RuntimeBeanEntry> children) {
+    private Map<String, String> createJmxToYangMap(final List<RuntimeBeanEntry> children) {
         Map<String, String> jmxToYangNamesForChildRbe = Maps.newHashMap();
         for (RuntimeBeanEntry rbe : children) {
             jmxToYangNamesForChildRbe.put(rbe.getJavaNamePrefix(), rbe.getYangName());
@@ -380,7 +381,7 @@ public class ConfigSubsystemFacade implements Closeable {
         return jmxToYangNamesForChildRbe;
     }
 
-    public Element get(Document document) throws DocumentedException {
+    public Element get(final Document document) throws DocumentedException {
         final ObjectName testTransaction = transactionProvider.getOrCreateReadTransaction();
         final ConfigTransactionClient txClient = configRegistryClient.getConfigTransactionClient(testTransaction);
 
index c908df854794a408df48f5d6fac6f9d3bc86c093..22c97c46dc3f49c4a7584aa5f8d633052263eeee 100644 (file)
@@ -19,8 +19,8 @@ public enum Datastore {
      * @param transactionProvider
      * @return
      */
-    public static DatastoreQueryStrategy getInstanceQueryStrategy(Datastore source,
-            TransactionProvider transactionProvider) {
+    public static DatastoreQueryStrategy getInstanceQueryStrategy(final Datastore source,
+            final TransactionProvider transactionProvider) {
         switch (source) {
         case running:
             return new RunningDatastoreQueryStrategy(transactionProvider);
index 60c0e72e26e36080e8bc33816f6d8c111b4497c6..dd4bd5b9de37a437d0e139c1a1ba34f7483aa1ab 100644 (file)
@@ -145,7 +145,7 @@ public class RpcFacade {
         return configRegistryClient.invokeMethod(execution.on, execution.operationName, params, signature);
     }
 
-    public Element toXml(Document doc, Object result, OperationExecution execution) throws DocumentedException {
+    public Element toXml(final Document doc, final Object result, final OperationExecution execution) throws DocumentedException {
         AttributeMappingStrategy<?, ? extends OpenType<?>> mappingStrategy = new ObjectMapper().prepareStrategy(execution.getReturnType());
         Optional<?> mappedAttributeOpt = mappingStrategy.mapAttribute(result);
         Preconditions.checkState(mappedAttributeOpt.isPresent(), "Unable to map return value %s as %s", result, execution.getReturnType().getOpenType());
index 08b9499acf972449a69532dcac37013ec8791c0a..28f203b4d9d75876018728eb7e692569c1ff9f41 100644 (file)
@@ -18,12 +18,12 @@ public class RunningDatastoreQueryStrategy implements DatastoreQueryStrategy {
 
     private final TransactionProvider transactionProvider;
 
-    public RunningDatastoreQueryStrategy(TransactionProvider transactionProvider) {
+    public RunningDatastoreQueryStrategy(final TransactionProvider transactionProvider) {
         this.transactionProvider = transactionProvider;
     }
 
     @Override
-    public Set<ObjectName> queryInstances(ConfigRegistryClient configRegistryClient) {
+    public Set<ObjectName> queryInstances(final ConfigRegistryClient configRegistryClient) {
         ObjectName on = transactionProvider.getOrCreateReadTransaction();
         ConfigTransactionClient proxy = configRegistryClient.getConfigTransactionClient(on);
         return proxy.lookupConfigBeans();
index 52e8d17938ab5c2a4b585e5893956a5a58b344d3..312717ad90a9be1cb50aa6b72c7ebd3a6c2cbe0f 100644 (file)
@@ -13,7 +13,7 @@ import java.util.Arrays;
 public enum TestOption {
     testOnly, set, testThenSet;
 
-    public static TestOption getFromXmlName(String testOptionXmlName) {
+    public static TestOption getFromXmlName(final String testOptionXmlName) {
         switch (testOptionXmlName) {
         case "test-only":
             return testOnly;
index e937e2645b80f72ea41e16d1ca4588ea84edc1b8..759e33e0a6c2e97997d6290966259fee90fd164e 100644 (file)
@@ -20,13 +20,13 @@ public class IdentityMapping {
         this.identityNameToSchemaNode = Maps.newHashMap();
     }
 
-    public void addIdSchemaNode(IdentitySchemaNode node) {
+    public void addIdSchemaNode(final IdentitySchemaNode node) {
         String name = node.getQName().getLocalName();
         Preconditions.checkState(!identityNameToSchemaNode.containsKey(name));
         identityNameToSchemaNode.put(name, node);
     }
 
-    public boolean containsIdName(String idName) {
+    public boolean containsIdName(final String idName) {
         return identityNameToSchemaNode.containsKey(idName);
     }
 
index 8ee33c96504945494b48bc63bdef94edb3efe2c0..9c2aaeda499b572a563ad38d8457266fc8c5a07d 100644 (file)
@@ -24,7 +24,7 @@ public abstract class AttributeIfcSwitchStatement<T> {
 
     private AttributeIfc lastAttribute;
 
-    public T switchAttribute(AttributeIfc attributeIfc) {
+    public T switchAttribute(final AttributeIfc attributeIfc) {
 
         this.lastAttribute = attributeIfc;
 
@@ -43,7 +43,7 @@ public abstract class AttributeIfcSwitchStatement<T> {
                 } else {
                     return caseJavaAttribute(openType);
                 }
-            } catch (UnknownOpenTypeException e) {
+            } catch (final UnknownOpenTypeException e) {
                 throw getIllegalArgumentException(attributeIfc);
             }
 
@@ -64,28 +64,28 @@ public abstract class AttributeIfcSwitchStatement<T> {
         return lastAttribute;
     }
 
-    protected T caseJavaIdentityRefAttribute(OpenType<?> openType) {
+    protected T caseJavaIdentityRefAttribute(final OpenType<?> openType) {
         return caseJavaAttribute(openType);
     }
 
-    protected T caseJavaUnionAttribute(OpenType<?> openType) {
+    protected T caseJavaUnionAttribute(final OpenType<?> openType) {
         return caseJavaAttribute(openType);
     }
 
-    protected T caseJavaEnumAttribute(OpenType<?> openType) {
+    protected T caseJavaEnumAttribute(final OpenType<?> openType) {
         return caseJavaAttribute(openType);
     }
 
-    protected T caseJavaBinaryAttribute(OpenType<?> openType) {
+    protected T caseJavaBinaryAttribute(final OpenType<?> openType) {
         return caseJavaAttribute(openType);
     }
 
-    private IllegalArgumentException getIllegalArgumentException(AttributeIfc attributeIfc) {
+    private IllegalArgumentException getIllegalArgumentException(final AttributeIfc attributeIfc) {
         return new IllegalArgumentException("Unknown attribute type " + attributeIfc.getClass() + ", " + attributeIfc
                 + " with open type:" + attributeIfc.getOpenType());
     }
 
-    public final T caseJavaAttribute(OpenType<?> openType) {
+    public final T caseJavaAttribute(final OpenType<?> openType) {
         if (openType instanceof SimpleType<?>) {
             return caseJavaSimpleAttribute((SimpleType<?>) openType);
         } else if (openType instanceof ArrayType<?>) {
@@ -114,7 +114,7 @@ public abstract class AttributeIfcSwitchStatement<T> {
     private static class UnknownOpenTypeException extends RuntimeException {
         private static final long serialVersionUID = 1L;
 
-        public UnknownOpenTypeException(String message) {
+        public UnknownOpenTypeException(final String message) {
             super(message);
         }
     }
index a1f185a10e8c081a16dcbf1aa64fd13553ddeba3..d0642944a6f1ae04e9f2a495a5cddd32ce28379a 100644 (file)
@@ -16,7 +16,7 @@ public abstract class AbstractAttributeReadingStrategy implements AttributeReadi
 
     private final String nullableDefault;
 
-    public AbstractAttributeReadingStrategy(String nullableDefault) {
+    public AbstractAttributeReadingStrategy(final String nullableDefault) {
         this.nullableDefault = nullableDefault;
     }
 
@@ -25,7 +25,7 @@ public abstract class AbstractAttributeReadingStrategy implements AttributeReadi
     }
 
     @Override
-    public AttributeConfigElement readElement(List<XmlElement> configNodes) throws DocumentedException {
+    public AttributeConfigElement readElement(final List<XmlElement> configNodes) throws DocumentedException {
         if (configNodes.size() == 0){
             return AttributeConfigElement.createNullValue(postprocessNullableDefault(nullableDefault));
         }
@@ -34,7 +34,7 @@ public abstract class AbstractAttributeReadingStrategy implements AttributeReadi
 
     abstract AttributeConfigElement readElementHook(List<XmlElement> configNodes) throws DocumentedException;
 
-    protected Object postprocessNullableDefault(String nullableDefault) {
+    protected Object postprocessNullableDefault(final String nullableDefault) {
         return nullableDefault;
     }
 }
index 5f169de9fb50c54aec9c8a6b67c0d52c89e78e8f..f2a67cce45bca9c847fd6f8779f07b10e4357f6a 100644 (file)
@@ -18,13 +18,13 @@ public class ArrayAttributeReadingStrategy extends AbstractAttributeReadingStrat
 
     private final AttributeReadingStrategy innerStrategy;
 
-    public ArrayAttributeReadingStrategy(String nullableDefault, AttributeReadingStrategy innerStrategy) {
+    public ArrayAttributeReadingStrategy(final String nullableDefault, final AttributeReadingStrategy innerStrategy) {
         super(nullableDefault);
         this.innerStrategy = innerStrategy;
     }
 
     @Override
-    AttributeConfigElement readElementHook(List<XmlElement> configNodes) throws DocumentedException {
+    AttributeConfigElement readElementHook(final List<XmlElement> configNodes) throws DocumentedException {
         List<Object> innerList = Lists.newArrayList();
         EditStrategyType innerEditStrategy= null;
         for (XmlElement configNode : configNodes) {
index 8ca9616fcc183dc6b5160b1f8bac7ded064dc690..850d0bea33ccf4619158d87bfd7d58c6e1c11bb0 100644 (file)
@@ -27,13 +27,13 @@ public class AttributeConfigElement {
     private Object resolvedDefaultValue;
     private String jmxName;
 
-    public AttributeConfigElement(Object defaultValue, Object value, final EditStrategyType editStrategyType) {
+    public AttributeConfigElement(final Object defaultValue, final Object value, final EditStrategyType editStrategyType) {
         this.defaultValue = defaultValue;
         this.value = value;
         this.editStrategy = Optional.fromNullable(editStrategyType);
     }
 
-    public void setJmxName(String jmxName) {
+    public void setJmxName(final String jmxName) {
         this.jmxName = jmxName;
     }
 
@@ -41,8 +41,8 @@ public class AttributeConfigElement {
         return jmxName;
     }
 
-    public void resolveValue(AttributeResolvingStrategy<?, ? extends OpenType<?>> attributeResolvingStrategy,
-            String attrName) throws DocumentedException {
+    public void resolveValue(final AttributeResolvingStrategy<?, ? extends OpenType<?>> attributeResolvingStrategy,
+            final String attrName) throws DocumentedException {
         resolvedValue = attributeResolvingStrategy.parseAttribute(attrName, value);
         Optional<?> resolvedDefault = attributeResolvingStrategy.parseAttribute(attrName, defaultValue);
         resolvedDefaultValue = resolvedDefault.isPresent() ? resolvedDefault.get() : null;
@@ -52,11 +52,11 @@ public class AttributeConfigElement {
         return editStrategy;
     }
 
-    public static AttributeConfigElement create(Object nullableDefault, Object value) {
+    public static AttributeConfigElement create(final Object nullableDefault, final Object value) {
         return new AttributeConfigElement(nullableDefault, value, null);
     }
 
-    public static AttributeConfigElement createNullValue(Object nullableDefault) {
+    public static AttributeConfigElement createNullValue(final Object nullableDefault) {
         return new AttributeConfigElement(nullableDefault, null, null);
     }
 
index 6f4aefd9e11680684f453a708702da14e5957b8c..461ac339e9782cb8804ba0d1037e997e74bc2b2a 100644 (file)
@@ -24,14 +24,14 @@ public class CompositeAttributeReadingStrategy extends AbstractAttributeReadingS
 
     private final Map<String, AttributeReadingStrategy> innerStrategies;
 
-    public CompositeAttributeReadingStrategy(String nullableDefault,
-            Map<String, AttributeReadingStrategy> innerStrategies) {
+    public CompositeAttributeReadingStrategy(final String nullableDefault,
+            final Map<String, AttributeReadingStrategy> innerStrategies) {
         super(nullableDefault);
         this.innerStrategies = innerStrategies;
     }
 
     @Override
-    AttributeConfigElement readElementHook(List<XmlElement> configNodes) throws DocumentedException {
+    AttributeConfigElement readElementHook(final List<XmlElement> configNodes) throws DocumentedException {
 
         Preconditions.checkState(configNodes.size() == 1, "This element should be present only once %s", configNodes);
 
index 725d73a7f7b7a529cb5bc4ce1651200c929fa23b..12d68cefa6082bb986f9cd54f9579391a31b947a 100644 (file)
@@ -19,12 +19,12 @@ public class ObjectNameAttributeReadingStrategy extends AbstractAttributeReading
 
     private static final Object PREFIX_SEPARATOR = ":";
 
-    public ObjectNameAttributeReadingStrategy(String nullableDefault) {
+    public ObjectNameAttributeReadingStrategy(final String nullableDefault) {
         super(nullableDefault);
     }
 
     @Override
-    AttributeConfigElement readElementHook(List<XmlElement> configNodes) throws DocumentedException {
+    AttributeConfigElement readElementHook(final List<XmlElement> configNodes) throws DocumentedException {
 
         XmlElement firstChild = configNodes.get(0);
         Preconditions.checkState(configNodes.size() == 1, "This element should be present only once " + firstChild
@@ -34,7 +34,7 @@ public class ObjectNameAttributeReadingStrategy extends AbstractAttributeReading
         return AttributeConfigElement.create(getNullableDefault(), resolve(firstChild));
     }
 
-    private ObjectNameAttributeMappingStrategy.MappedDependency resolve(XmlElement firstChild) throws DocumentedException{
+    private ObjectNameAttributeMappingStrategy.MappedDependency resolve(final XmlElement firstChild) throws DocumentedException{
         XmlElement typeElement = firstChild.getOnlyChildElementWithSameNamespace(XmlMappingConstants.TYPE_KEY);
         Map.Entry<String, String> prefixNamespace = typeElement.findNamespaceOfTextContent();
 
@@ -47,7 +47,7 @@ public class ObjectNameAttributeReadingStrategy extends AbstractAttributeReading
                 dependencyName);
     }
 
-    public static String checkPrefixAndExtractServiceName(XmlElement typeElement, Map.Entry<String, String> prefixNamespace) throws DocumentedException {
+    public static String checkPrefixAndExtractServiceName(final XmlElement typeElement, final Map.Entry<String, String> prefixNamespace) throws DocumentedException {
         String serviceName = typeElement.getTextContent();
         Preconditions.checkNotNull(prefixNamespace.getKey(), "Service %s value cannot be linked to namespace",
                 XmlMappingConstants.TYPE_KEY);
index a9c07238692de2d75ebb2fa171bcb820d6cf6c3c..2fe373475fa601dfe93df688a6910e2d48b83624 100644 (file)
@@ -31,7 +31,7 @@ public class ObjectXmlReader extends AttributeIfcSwitchStatement<AttributeReadin
     private String key;
     private Map<String, Map<Date, IdentityMapping>> identityMap;
 
-    public Map<String, AttributeReadingStrategy> prepareReading(Map<String, AttributeIfc> yangToAttrConfig, Map<String, Map<Date, IdentityMapping>> identityMap) {
+    public Map<String, AttributeReadingStrategy> prepareReading(final Map<String, AttributeIfc> yangToAttrConfig, final Map<String, Map<Date, IdentityMapping>> identityMap) {
         Map<String, AttributeReadingStrategy> strategies = Maps.newHashMap();
         this.identityMap = identityMap;
 
@@ -42,42 +42,42 @@ public class ObjectXmlReader extends AttributeIfcSwitchStatement<AttributeReadin
         return strategies;
     }
 
-    private AttributeReadingStrategy prepareReadingStrategy(String key, AttributeIfc attributeIfc) {
+    private AttributeReadingStrategy prepareReadingStrategy(final String key, final AttributeIfc attributeIfc) {
         this.key = key;
         return switchAttribute(attributeIfc);
     }
 
     @Override
-    protected AttributeReadingStrategy caseJavaBinaryAttribute(OpenType<?> openType) {
+    protected AttributeReadingStrategy caseJavaBinaryAttribute(final OpenType<?> openType) {
         return new SimpleBinaryAttributeReadingStrategy(getLastAttribute().getNullableDefault());
     }
 
     @Override
-    protected AttributeReadingStrategy caseJavaUnionAttribute(OpenType<?> openType) {
+    protected AttributeReadingStrategy caseJavaUnionAttribute(final OpenType<?> openType) {
         String mappingKey = JavaAttribute.DESCRIPTION_OF_VALUE_ATTRIBUTE_FOR_UNION;
         return new SimpleUnionAttributeReadingStrategy(getLastAttribute().getNullableDefault(), mappingKey);
     }
 
     @Override
-    public AttributeReadingStrategy caseJavaSimpleAttribute(SimpleType<?> openType) {
+    public AttributeReadingStrategy caseJavaSimpleAttribute(final SimpleType<?> openType) {
         return new SimpleAttributeReadingStrategy(getLastAttribute().getNullableDefault());
     }
 
     @Override
-    public AttributeReadingStrategy caseJavaArrayAttribute(ArrayType<?> openType) {
+    public AttributeReadingStrategy caseJavaArrayAttribute(final ArrayType<?> openType) {
         SimpleAttributeReadingStrategy innerStrategy = new SimpleAttributeReadingStrategy(getLastAttribute().getNullableDefault());
         return new ArrayAttributeReadingStrategy(getLastAttribute().getNullableDefault(), innerStrategy);
     }
 
     @Override
-    public AttributeReadingStrategy caseJavaCompositeAttribute(CompositeType openType) {
+    public AttributeReadingStrategy caseJavaCompositeAttribute(final CompositeType openType) {
         Preconditions.checkState(openType.keySet().size() == 1, "Unexpected number of elements for open type %s, should be 1", openType);
         String mappingKey = openType.keySet().iterator().next();
         return new SimpleCompositeAttributeReadingStrategy(getLastAttribute().getNullableDefault(), mappingKey);
     }
 
     @Override
-    protected AttributeReadingStrategy caseJavaIdentityRefAttribute(OpenType<?> openType) {
+    protected AttributeReadingStrategy caseJavaIdentityRefAttribute(final OpenType<?> openType) {
         Preconditions.checkState(openType instanceof CompositeType);
         Set<String> keys = ((CompositeType) openType).keySet();
         Preconditions.checkState(keys.size() == 1, "Unexpected number of elements for open type %s, should be 1", openType);
@@ -86,12 +86,12 @@ public class ObjectXmlReader extends AttributeIfcSwitchStatement<AttributeReadin
     }
 
     @Override
-    protected AttributeReadingStrategy caseDependencyAttribute(SimpleType<?> openType) {
+    protected AttributeReadingStrategy caseDependencyAttribute(final SimpleType<?> openType) {
         return new ObjectNameAttributeReadingStrategy(getLastAttribute().getNullableDefault());
     }
 
     @Override
-    protected AttributeReadingStrategy caseTOAttribute(CompositeType openType) {
+    protected AttributeReadingStrategy caseTOAttribute(final CompositeType openType) {
         AttributeIfc lastAttribute = getLastAttribute();
         Preconditions.checkState(lastAttribute instanceof TOAttribute);
         Map<String, AttributeIfc> inner = ((TOAttribute)lastAttribute).getYangPropertiesToTypesMap();
@@ -108,7 +108,7 @@ public class ObjectXmlReader extends AttributeIfcSwitchStatement<AttributeReadin
     }
 
     @Override
-    protected AttributeReadingStrategy caseListAttribute(ArrayType<?> openType) {
+    protected AttributeReadingStrategy caseListAttribute(final ArrayType<?> openType) {
         AttributeIfc lastAttribute = getLastAttribute();
         Preconditions.checkState(lastAttribute instanceof ListAttribute);
         AttributeReadingStrategy innerStrategy = prepareReadingStrategy(key, ((ListAttribute) lastAttribute).getInnerAttribute());
@@ -116,7 +116,7 @@ public class ObjectXmlReader extends AttributeIfcSwitchStatement<AttributeReadin
     }
 
     @Override
-    protected AttributeReadingStrategy caseListDependeciesAttribute(ArrayType<?> openType) {
+    protected AttributeReadingStrategy caseListDependeciesAttribute(final ArrayType<?> openType) {
         AttributeIfc lastAttribute = getLastAttribute();
         Preconditions.checkState(lastAttribute instanceof ListDependenciesAttribute);
         AttributeReadingStrategy innerStrategy = caseDependencyAttribute(SimpleType.OBJECTNAME);
index 0fa0358cb11f723fe652c7a3cd325f64e8daac7e..db2d9c1d1ee3694a20cdd565884812a4c3d5ca24 100644 (file)
@@ -14,12 +14,12 @@ import org.opendaylight.controller.config.util.xml.DocumentedException;
 import org.opendaylight.controller.config.util.xml.XmlElement;
 
 public class SimpleAttributeReadingStrategy extends AbstractAttributeReadingStrategy {
-    public SimpleAttributeReadingStrategy(String nullableDefault) {
+    public SimpleAttributeReadingStrategy(final String nullableDefault) {
         super(nullableDefault);
     }
 
     @Override
-    AttributeConfigElement readElementHook(List<XmlElement> configNodes) throws DocumentedException {
+    AttributeConfigElement readElementHook(final List<XmlElement> configNodes) throws DocumentedException {
         XmlElement xmlElement = configNodes.get(0);
         Preconditions.checkState(configNodes.size() == 1, "This element should be present only once " + xmlElement
                 + " but was " + configNodes.size());
@@ -29,16 +29,16 @@ public class SimpleAttributeReadingStrategy extends AbstractAttributeReadingStra
                 postprocessParsedValue(textContent));
     }
 
-    protected String readElementContent(XmlElement xmlElement) throws DocumentedException {
+    protected String readElementContent(final XmlElement xmlElement) throws DocumentedException {
         return xmlElement.getTextContent();
     }
 
     @Override
-    protected Object postprocessNullableDefault(String nullableDefault) {
+    protected Object postprocessNullableDefault(final String nullableDefault) {
         return nullableDefault;
     }
 
-    protected Object postprocessParsedValue(String textContent) {
+    protected Object postprocessParsedValue(final String textContent) {
         return textContent;
     }
 
index 12b118e59b80462c291de7807cee72e5832592d6..5353049b4ddffb15a7c4295143ccb75065ebbc20 100644 (file)
@@ -14,12 +14,12 @@ import java.util.List;
 
 public class SimpleBinaryAttributeReadingStrategy extends SimpleAttributeReadingStrategy {
 
-    public SimpleBinaryAttributeReadingStrategy(String nullableDefault) {
+    public SimpleBinaryAttributeReadingStrategy(final String nullableDefault) {
         super(nullableDefault);
     }
 
     @Override
-    protected Object postprocessParsedValue(String textContent) {
+    protected Object postprocessParsedValue(final String textContent) {
         BaseEncoding en = BaseEncoding.base64();
         byte[] decode = en.decode(textContent);
         List<String> parsed = Lists.newArrayListWithCapacity(decode.length);
@@ -30,7 +30,7 @@ public class SimpleBinaryAttributeReadingStrategy extends SimpleAttributeReading
     }
 
     @Override
-    protected Object postprocessNullableDefault(String nullableDefault) {
+    protected Object postprocessNullableDefault(final String nullableDefault) {
         return nullableDefault == null ? null : postprocessParsedValue(nullableDefault);
     }
 }
index 211dba990d551141c7099d4eb4f4fe5ef4d84053..764629bf7c8e8faa24670e954922516eaf58e59e 100644 (file)
@@ -15,20 +15,20 @@ public class SimpleCompositeAttributeReadingStrategy extends SimpleAttributeRead
 
     private final String key;
 
-    public SimpleCompositeAttributeReadingStrategy(String nullableDefault, String key) {
+    public SimpleCompositeAttributeReadingStrategy(final String nullableDefault, final String key) {
         super(nullableDefault);
         this.key = key;
     }
 
     @Override
-    protected Object postprocessParsedValue(String textContent) {
+    protected Object postprocessParsedValue(final String textContent) {
         HashMap<String,String> map = Maps.newHashMap();
         map.put(key, textContent);
         return map;
     }
 
     @Override
-    protected Object postprocessNullableDefault(String nullableDefault) {
+    protected Object postprocessNullableDefault(final String nullableDefault) {
         return nullableDefault == null ? null : postprocessParsedValue(nullableDefault);
     }
 }
index 2bd4356ef47887b8f25f8f8150f87484a61aed5d..35af46c5f3f119c09c9d13a2224b3cee82143bf8 100644 (file)
@@ -25,14 +25,14 @@ public class SimpleIdentityRefAttributeReadingStrategy extends SimpleAttributeRe
     private final String key;
     private final Map<String, Map<Date, IdentityMapping>> identityMap;
 
-    public SimpleIdentityRefAttributeReadingStrategy(String nullableDefault, String key, Map<String, Map<Date, IdentityMapping>> identityMap) {
+    public SimpleIdentityRefAttributeReadingStrategy(final String nullableDefault, final String key, final Map<String, Map<Date, IdentityMapping>> identityMap) {
         super(nullableDefault);
         this.key = key;
         this.identityMap = identityMap;
     }
 
     @Override
-    protected String readElementContent(XmlElement xmlElement) throws DocumentedException {
+    protected String readElementContent(final XmlElement xmlElement) throws DocumentedException {
         Map.Entry<String, String> namespaceOfTextContent = xmlElement.findNamespaceOfTextContent();
         String content = xmlElement.getTextContent();
 
@@ -65,14 +65,14 @@ public class SimpleIdentityRefAttributeReadingStrategy extends SimpleAttributeRe
     }
 
     @Override
-    protected Object postprocessParsedValue(String textContent) {
+    protected Object postprocessParsedValue(final String textContent) {
         HashMap<String,String> map = Maps.newHashMap();
         map.put(key, textContent);
         return map;
     }
 
     @Override
-    protected Object postprocessNullableDefault(String nullableDefault) {
+    protected Object postprocessNullableDefault(final String nullableDefault) {
         return nullableDefault == null ? null : postprocessParsedValue(nullableDefault);
     }
 }
index 7377da4f7d3b76d382228fe255d4c1ef417c227b..d2466bbad9e500bb727db7b5adf4e69876f4dc00 100644 (file)
@@ -17,13 +17,13 @@ public class SimpleUnionAttributeReadingStrategy extends SimpleAttributeReadingS
 
     private final String key;
 
-    public SimpleUnionAttributeReadingStrategy(String nullableDefault, String key) {
+    public SimpleUnionAttributeReadingStrategy(final String nullableDefault, final String key) {
         super(nullableDefault);
         this.key = key;
     }
 
     @Override
-    protected Object postprocessParsedValue(String textContent) {
+    protected Object postprocessParsedValue(final String textContent) {
         char[] charArray = textContent.toCharArray();
         List<String> chars = Lists.newArrayListWithCapacity(charArray.length);
 
@@ -37,7 +37,7 @@ public class SimpleUnionAttributeReadingStrategy extends SimpleAttributeReadingS
     }
 
     @Override
-    protected Object postprocessNullableDefault(String nullableDefault) {
+    protected Object postprocessNullableDefault(final String nullableDefault) {
         return nullableDefault == null ? null : postprocessParsedValue(nullableDefault);
     }
 }
index 46e098bcbd76edf6fac9440433d6df4d36a9759a..7ff7cfade98d6b0865228809ff9d304db1194133 100644 (file)
@@ -15,7 +15,7 @@ public abstract class AbstractAttributeMappingStrategy<T, O extends OpenType<?>>
 
     private final O attrOpenType;
 
-    public AbstractAttributeMappingStrategy(O attributeIfc) {
+    public AbstractAttributeMappingStrategy(final O attributeIfc) {
         this.attrOpenType = attributeIfc;
     }
 
index 471072bba151c39220d4196c30468e5fe6ddbc91..0c593ebf3d59bf7aaad73b0a4775610b98697455 100644 (file)
@@ -20,14 +20,14 @@ public class ArrayAttributeMappingStrategy extends AbstractAttributeMappingStrat
 
     private final AttributeMappingStrategy<?, ? extends OpenType<?>> innerElementStrategy;
 
-    public ArrayAttributeMappingStrategy(ArrayType<?> arrayType,
-            AttributeMappingStrategy<?, ? extends OpenType<?>> innerElementStrategy) {
+    public ArrayAttributeMappingStrategy(final ArrayType<?> arrayType,
+            final AttributeMappingStrategy<?, ? extends OpenType<?>> innerElementStrategy) {
         super(arrayType);
         this.innerElementStrategy = innerElementStrategy;
     }
 
     @Override
-    public Optional<List<Object>> mapAttribute(Object value) {
+    public Optional<List<Object>> mapAttribute(final Object value) {
         if (value == null){
             return Optional.absent();
         }
index 1bc78f3339e0ec615390e9e744d74568846da97b..7c1357005b978904f28d6a5aa48eca3b306f8081 100644 (file)
@@ -24,16 +24,16 @@ public class CompositeAttributeMappingStrategy extends
     private final Map<String, AttributeMappingStrategy<?, ? extends OpenType<?>>> innerStrategies;
     private final Map<String, String> jmxToJavaNameMapping;
 
-    public CompositeAttributeMappingStrategy(CompositeType compositeType,
-            Map<String, AttributeMappingStrategy<?, ? extends OpenType<?>>> innerStrategies,
-            Map<String, String> jmxToJavaNameMapping) {
+    public CompositeAttributeMappingStrategy(final CompositeType compositeType,
+            final Map<String, AttributeMappingStrategy<?, ? extends OpenType<?>>> innerStrategies,
+            final Map<String, String> jmxToJavaNameMapping) {
         super(compositeType);
         this.innerStrategies = innerStrategies;
         this.jmxToJavaNameMapping = jmxToJavaNameMapping;
     }
 
     @Override
-    public Optional<Map<String, Object>> mapAttribute(Object value) {
+    public Optional<Map<String, Object>> mapAttribute(final Object value) {
         if (value == null){
             return Optional.absent();
         }
@@ -62,7 +62,7 @@ public class CompositeAttributeMappingStrategy extends
         return Optional.of(retVal);
     }
 
-    protected Optional<?> mapInnerAttribute(CompositeDataSupport compositeData, String jmxName, String description) {
+    protected Optional<?> mapInnerAttribute(final CompositeDataSupport compositeData, final String jmxName, final String description) {
         Object innerValue = compositeData.get(jmxName);
 
         AttributeMappingStrategy<?, ? extends OpenType<?>> attributeMappingStrategy = innerStrategies
index bafb33b88d750e397b7988fcf6a4ed09df223bc2..6ff56d0452538703f33c907c501da1b8cfdf16ff 100644 (file)
@@ -16,13 +16,13 @@ public class EnumAttributeMappingStrategy extends AbstractAttributeMappingStrate
 
     private final EnumResolver enumResolver;
 
-    public EnumAttributeMappingStrategy(CompositeType openType, final EnumResolver enumResolver) {
+    public EnumAttributeMappingStrategy(final CompositeType openType, final EnumResolver enumResolver) {
         super(openType);
         this.enumResolver = enumResolver;
     }
 
     @Override
-    public Optional<String> mapAttribute(Object value) {
+    public Optional<String> mapAttribute(final Object value) {
         if (value == null){
             return Optional.absent();
         }
index 65a3367a6b39af8e651763b914c77a0e89743daf..9e2c69b9f3d9ad551ee35c81780e8be13c0d1c71 100644 (file)
@@ -29,7 +29,7 @@ public class ObjectMapper extends AttributeIfcSwitchStatement<AttributeMappingSt
     private EnumResolver enumResolver;
 
     public Map<String, AttributeMappingStrategy<?, ? extends OpenType<?>>> prepareMapping(
-            Map<String, AttributeIfc> configDefinition, EnumResolver enumResolver) {
+            final Map<String, AttributeIfc> configDefinition, final EnumResolver enumResolver) {
         this.enumResolver = Preconditions.checkNotNull(enumResolver);
         Map<String, AttributeMappingStrategy<?, ? extends OpenType<?>>> strategies = Maps.newHashMap();
 
@@ -40,7 +40,7 @@ public class ObjectMapper extends AttributeIfcSwitchStatement<AttributeMappingSt
         return strategies;
     }
 
-    public AttributeMappingStrategy<?, ? extends OpenType<?>> prepareStrategy(AttributeIfc attributeIfc) {
+    public AttributeMappingStrategy<?, ? extends OpenType<?>> prepareStrategy(final AttributeIfc attributeIfc) {
 
         if(attributeIfc instanceof DependencyAttribute) {
             namespaceOfDepAttr = ((DependencyAttribute)attributeIfc).getDependency().getSie().getQName().getNamespace().toString();
@@ -51,7 +51,7 @@ public class ObjectMapper extends AttributeIfcSwitchStatement<AttributeMappingSt
         return switchAttribute(attributeIfc);
     }
 
-    private Map<String, String> createJmxToYangMapping(TOAttribute attributeIfc) {
+    private Map<String, String> createJmxToYangMapping(final TOAttribute attributeIfc) {
         Map<String, String> retVal = Maps.newHashMap();
         for (Entry<String, AttributeIfc> entry : attributeIfc.getJmxPropertiesToTypesMap().entrySet()) {
             retVal.put(entry.getKey(), (entry.getValue()).getAttributeYangName());
@@ -60,7 +60,7 @@ public class ObjectMapper extends AttributeIfcSwitchStatement<AttributeMappingSt
     }
 
     @Override
-    protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseJavaSimpleAttribute(SimpleType<?> openType) {
+    protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseJavaSimpleAttribute(final SimpleType<?> openType) {
         return new SimpleAttributeMappingStrategy(openType);
     }
 
@@ -70,7 +70,7 @@ public class ObjectMapper extends AttributeIfcSwitchStatement<AttributeMappingSt
     }
 
     @Override
-    protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseJavaArrayAttribute(ArrayType<?> openType) {
+    protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseJavaArrayAttribute(final ArrayType<?> openType) {
 
         AttributeMappingStrategy<?, ? extends OpenType<?>> innerStrategy = new SimpleAttributeMappingStrategy(
                 (SimpleType<?>) openType.getElementOpenType());
@@ -78,7 +78,7 @@ public class ObjectMapper extends AttributeIfcSwitchStatement<AttributeMappingSt
     }
 
     @Override
-    protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseJavaCompositeAttribute(CompositeType openType) {
+    protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseJavaCompositeAttribute(final CompositeType openType) {
         Map<String, AttributeMappingStrategy<?, ? extends OpenType<?>>> innerStrategies = Maps.newHashMap();
 
         Map<String, String> attributeMapping = Maps.newHashMap();
@@ -93,7 +93,7 @@ public class ObjectMapper extends AttributeIfcSwitchStatement<AttributeMappingSt
     }
 
     @Override
-    protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseJavaUnionAttribute(OpenType<?> openType) {
+    protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseJavaUnionAttribute(final OpenType<?> openType) {
         Map<String, AttributeMappingStrategy<?, ? extends OpenType<?>>> innerStrategies = Maps.newHashMap();
 
         Map<String, String> attributeMapping = Maps.newHashMap();
@@ -112,12 +112,12 @@ public class ObjectMapper extends AttributeIfcSwitchStatement<AttributeMappingSt
 
     @Override
     protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseDependencyAttribute(
-            SimpleType<?> openType) {
+            final SimpleType<?> openType) {
         return new ObjectNameAttributeMappingStrategy(openType, namespaceOfDepAttr);
     }
 
     @Override
-    protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseTOAttribute(CompositeType openType) {
+    protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseTOAttribute(final CompositeType openType) {
         Map<String, AttributeMappingStrategy<?, ? extends OpenType<?>>> innerStrategies = Maps.newHashMap();
 
         Preconditions.checkState(getLastAttribute() instanceof TOAttribute);
@@ -132,14 +132,14 @@ public class ObjectMapper extends AttributeIfcSwitchStatement<AttributeMappingSt
     }
 
     @Override
-    protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseListAttribute(ArrayType<?> openType) {
+    protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseListAttribute(final ArrayType<?> openType) {
         Preconditions.checkState(getLastAttribute() instanceof ListAttribute);
         return new ArrayAttributeMappingStrategy(openType,
                 prepareStrategy(((ListAttribute) getLastAttribute()).getInnerAttribute()));
     }
 
     @Override
-    protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseListDependeciesAttribute(ArrayType<?> openType) {
+    protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseListDependeciesAttribute(final ArrayType<?> openType) {
         Preconditions.checkState(getLastAttribute() instanceof ListDependenciesAttribute);
         return new ArrayAttributeMappingStrategy(openType, caseDependencyAttribute(SimpleType.OBJECTNAME));
     }
index 73c8f47b5861a92de64467c55888bad23951a60a..3874c3a64118f8a389e831864bc00bdca5a579d2 100644 (file)
@@ -21,13 +21,13 @@ public class ObjectNameAttributeMappingStrategy extends
 
     private final String namespace;
 
-    public ObjectNameAttributeMappingStrategy(SimpleType<?> openType, String namespace) {
+    public ObjectNameAttributeMappingStrategy(final SimpleType<?> openType, final String namespace) {
         super(openType);
         this.namespace = namespace;
     }
 
     @Override
-    public Optional<MappedDependency> mapAttribute(Object value) {
+    public Optional<MappedDependency> mapAttribute(final Object value) {
         if (value == null){
             return Optional.absent();
         }
@@ -50,7 +50,7 @@ public class ObjectNameAttributeMappingStrategy extends
     public static class MappedDependency {
         private final String namespace, serviceName, refName;
 
-        public MappedDependency(String namespace, String serviceName, String refName) {
+        public MappedDependency(final String namespace, final String serviceName, final String refName) {
             this.serviceName = serviceName;
             this.refName = refName;
             this.namespace = namespace;
index 5b9c2a2b2fcb05d39bc26e456b84c6237526acfb..aacdd93b51bb01b1c76507827ac3a61a723f1617 100644 (file)
@@ -18,12 +18,12 @@ import org.opendaylight.controller.config.facade.xml.util.Util;
 
 public class SimpleAttributeMappingStrategy extends AbstractAttributeMappingStrategy<String, SimpleType<?>> {
 
-    public SimpleAttributeMappingStrategy(SimpleType<?> openType) {
+    public SimpleAttributeMappingStrategy(final SimpleType<?> openType) {
         super(openType);
     }
 
     @Override
-    public Optional<String> mapAttribute(Object value) {
+    public Optional<String> mapAttribute(final Object value) {
         if (value == null){
             return Optional.absent();
         }
@@ -55,7 +55,7 @@ public class SimpleAttributeMappingStrategy extends AbstractAttributeMappingStra
     static class DefaultWriterPlugin implements WriterPlugin {
 
         @Override
-        public String writeObject(Object value) {
+        public String writeObject(final Object value) {
             return value.toString();
         }
     }
@@ -63,7 +63,7 @@ public class SimpleAttributeMappingStrategy extends AbstractAttributeMappingStra
     static class DatePlugin implements WriterPlugin {
 
         @Override
-        public String writeObject(Object value) {
+        public String writeObject(final Object value) {
             Preconditions.checkArgument(value instanceof Date, "Attribute must be Date");
             return Util.writeDate((Date) value);
         }
index 21c0e053894dad055f44637493c17edb78e636d6..d15777cb8cc3dd8babbdae3f0b6aff7ba247392f 100644 (file)
@@ -19,12 +19,12 @@ public class UnionCompositeAttributeMappingStrategy extends
         CompositeAttributeMappingStrategy {
 
 
-    public UnionCompositeAttributeMappingStrategy(CompositeType compositeType, Map<String, AttributeMappingStrategy<?, ? extends OpenType<?>>> innerStrategies, Map<String, String> jmxToJavaNameMapping) {
+    public UnionCompositeAttributeMappingStrategy(final CompositeType compositeType, final Map<String, AttributeMappingStrategy<?, ? extends OpenType<?>>> innerStrategies, final Map<String, String> jmxToJavaNameMapping) {
         super(compositeType, innerStrategies, jmxToJavaNameMapping);
     }
 
     @Override
-    protected Optional<?> mapInnerAttribute(CompositeDataSupport compositeData, String jmxName, String description) {
+    protected Optional<?> mapInnerAttribute(final CompositeDataSupport compositeData, final String jmxName, final String description) {
         if(!description.equals(JavaAttribute.DESCRIPTION_OF_VALUE_ATTRIBUTE_FOR_UNION)){
             return Optional.absent();
         }
index 56b11aa564ae5ef95970ae0b96bf90118cbc994f..0443013a3fae852d37d284831dfdfba06b68fd43 100644 (file)
@@ -13,7 +13,7 @@ import javax.management.openmbean.OpenType;
 abstract class AbstractAttributeResolvingStrategy<T, O extends OpenType<?>> implements AttributeResolvingStrategy<T, O> {
     private O openType;
 
-    public AbstractAttributeResolvingStrategy(O openType) {
+    public AbstractAttributeResolvingStrategy(final O openType) {
         this.openType = openType;
     }
 
index 73b9dd9cbce28dfc9997550b924b3c32bbe20f9d..5daf5a42a941c91a13823082e0fcb7790438a7fa 100644 (file)
@@ -27,14 +27,14 @@ final class ArrayAttributeResolvingStrategy extends AbstractAttributeResolvingSt
 
     private static final Logger LOG = LoggerFactory.getLogger(ArrayAttributeResolvingStrategy.class);
 
-    public ArrayAttributeResolvingStrategy(AttributeResolvingStrategy<?, ? extends OpenType<?>> innerTypeResolved,
-            ArrayType<?> openType) {
+    public ArrayAttributeResolvingStrategy(final AttributeResolvingStrategy<?, ? extends OpenType<?>> innerTypeResolved,
+            final ArrayType<?> openType) {
         super(openType);
         this.innerTypeResolvingStrategy = innerTypeResolved;
     }
 
     @Override
-    public Optional<Object> parseAttribute(String attrName, Object value) throws DocumentedException {
+    public Optional<Object> parseAttribute(final String attrName, final Object value) throws DocumentedException {
         if (value == null) {
             return Optional.absent();
         }
@@ -49,7 +49,7 @@ final class ArrayAttributeResolvingStrategy extends AbstractAttributeResolvingSt
         } else {
             try {
                 innerTypeClass = Class.forName(getOpenType().getElementOpenType().getClassName());
-            } catch (ClassNotFoundException e) {
+            } catch (final ClassNotFoundException e) {
                 throw new IllegalStateException("Unable to locate class for "
                         + getOpenType().getElementOpenType().getClassName(), e);
             }
@@ -80,7 +80,7 @@ final class ArrayAttributeResolvingStrategy extends AbstractAttributeResolvingSt
                 final ArrayType<?> openType =
                         new ArrayType<>(getOpenType().getDimension(), innerTypeResolvingStrategy.getOpenType());
                 setOpenType(openType);
-            } catch (OpenDataException e) {
+            } catch (final OpenDataException e) {
                 throw new IllegalStateException("An error occurred during restoration of array type " + this
                         + " for attribute " + attrName + " from value " + value, e);
             }
@@ -92,7 +92,7 @@ final class ArrayAttributeResolvingStrategy extends AbstractAttributeResolvingSt
         return Optional.of(parsedArray);
     }
 
-    private static String toStringArray(Object array) {
+    private static String toStringArray(final Object array) {
         StringBuilder build = new StringBuilder(array.toString());
         build.append(" [");
         for (int i = 0; i < Array.getLength(array); i++) {
@@ -103,10 +103,10 @@ final class ArrayAttributeResolvingStrategy extends AbstractAttributeResolvingSt
         return build.toString();
     }
 
-    private static Class<?> getPrimitiveType(Class<?> innerTypeClass) {
+    private static Class<?> getPrimitiveType(final Class<?> innerTypeClass) {
         try {
             return (Class<?>) innerTypeClass.getField("TYPE").get(null);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new IllegalStateException("Unable to determine primitive type to " + innerTypeClass);
         }
     }
index 7988a4c7f583795d1c8ac0c68c757ef0f678904e..920b5dcd88793b0b4c428e0efda55b2959c77481 100644 (file)
@@ -29,8 +29,8 @@ class CompositeAttributeResolvingStrategy extends
 
     private static final Logger LOG = LoggerFactory.getLogger(CompositeAttributeResolvingStrategy.class);
 
-    CompositeAttributeResolvingStrategy(Map<String, AttributeResolvingStrategy<?, ? extends OpenType<?>>> innerTypes,
-            CompositeType openType, Map<String, String> yangToJavaAttrMapping) {
+    CompositeAttributeResolvingStrategy(final Map<String, AttributeResolvingStrategy<?, ? extends OpenType<?>>> innerTypes,
+            final CompositeType openType, final Map<String, String> yangToJavaAttrMapping) {
         super(openType);
         this.innerTypes = innerTypes;
         this.yangToJavaAttrMapping = yangToJavaAttrMapping;
@@ -42,7 +42,7 @@ class CompositeAttributeResolvingStrategy extends
     }
 
     @Override
-    public Optional<CompositeDataSupport> parseAttribute(String attrName, Object value) throws DocumentedException {
+    public Optional<CompositeDataSupport> parseAttribute(final String attrName, final Object value) throws DocumentedException {
 
         if (value == null) {
             return Optional.absent();
@@ -96,7 +96,7 @@ class CompositeAttributeResolvingStrategy extends
             setOpenType(new CompositeType(getOpenType().getTypeName(), getOpenType().getDescription(), names, descriptions, itemTypes));
             LOG.debug("Attribute {}. Open type reconstructed to {}", attrName, getOpenType(), getOpenType());
             parsedValue = new CompositeDataSupport(getOpenType(), items);
-        } catch (OpenDataException e) {
+        } catch (final OpenDataException e) {
             throw new IllegalStateException("An error occurred during restoration of composite type " + this
                     + " for attribute " + attrName + " from value " + value, e);
         }
@@ -107,7 +107,7 @@ class CompositeAttributeResolvingStrategy extends
     }
 
 
-    protected Map<?, ?> preprocessValueMap(Map<?, ?> valueMap) {
+    protected Map<?, ?> preprocessValueMap(final Map<?, ?> valueMap) {
         return valueMap;
     }
 
index 15f8d77b9a997dfdf8dbea4657ac5ff0e6ea3ad7..7a66e421cf435053348e95a5c8f1886b05991bf1 100644 (file)
@@ -23,7 +23,7 @@ final class EnumAttributeResolvingStrategy extends AbstractAttributeResolvingStr
     private static final Logger LOG = LoggerFactory.getLogger(EnumAttributeResolvingStrategy.class);
     private final EnumResolver enumResolver;
 
-    EnumAttributeResolvingStrategy(CompositeType simpleType, final EnumResolver enumResolver) {
+    EnumAttributeResolvingStrategy(final CompositeType simpleType, final EnumResolver enumResolver) {
         super(simpleType);
         this.enumResolver = enumResolver;
     }
@@ -34,7 +34,7 @@ final class EnumAttributeResolvingStrategy extends AbstractAttributeResolvingStr
     }
 
     @Override
-    public Optional<Object> parseAttribute(String attrName, Object value) throws DocumentedException {
+    public Optional<Object> parseAttribute(final String attrName, final Object value) throws DocumentedException {
         if (value == null) {
             return Optional.absent();
         }
index 71dee55d564379778f808b066cafbf8d6884f8df..086c18198f202c56e456838a516f66d56f77987b 100644 (file)
@@ -22,13 +22,13 @@ public class ObjectNameAttributeResolvingStrategy extends AbstractAttributeResol
     private final ServiceRegistryWrapper serviceTracker;
     private static final Logger LOG = LoggerFactory.getLogger(ObjectNameAttributeResolvingStrategy.class);
 
-    ObjectNameAttributeResolvingStrategy(ServiceRegistryWrapper serviceTracker) {
+    ObjectNameAttributeResolvingStrategy(final ServiceRegistryWrapper serviceTracker) {
         super(SimpleType.OBJECTNAME);
         this.serviceTracker = serviceTracker;
     }
 
     @Override
-    public Optional<ObjectName> parseAttribute(String attrName, Object value) {
+    public Optional<ObjectName> parseAttribute(final String attrName, final Object value) {
         if (value == null) {
             return Optional.absent();
         }
index eccd9caeb00219f956707fefec565daa35670162..c1eeef5cbfceedfb34928581143977fb09b254e1 100644 (file)
@@ -29,12 +29,12 @@ public class ObjectResolver extends AttributeIfcSwitchStatement<AttributeResolvi
     private final ServiceRegistryWrapper serviceTracker;
     private EnumResolver enumResolver;
 
-    public ObjectResolver(ServiceRegistryWrapper serviceTracker) {
+    public ObjectResolver(final ServiceRegistryWrapper serviceTracker) {
         this.serviceTracker = serviceTracker;
     }
 
     public Map<String, AttributeResolvingStrategy<?, ? extends OpenType<?>>> prepareResolving(
-            Map<String, AttributeIfc> configDefinition, final EnumResolver enumResolver) {
+            final Map<String, AttributeIfc> configDefinition, final EnumResolver enumResolver) {
         this.enumResolver = enumResolver;
 
         Map<String, AttributeResolvingStrategy<?, ? extends OpenType<?>>> strategies = Maps.newHashMap();
@@ -47,11 +47,11 @@ public class ObjectResolver extends AttributeIfcSwitchStatement<AttributeResolvi
         return strategies;
     }
 
-    private AttributeResolvingStrategy<?, ? extends OpenType<?>> prepareStrategy(AttributeIfc attributeIfc) {
+    private AttributeResolvingStrategy<?, ? extends OpenType<?>> prepareStrategy(final AttributeIfc attributeIfc) {
         return switchAttribute(attributeIfc);
     }
 
-    private Map<String, String> createYangToJmxMapping(TOAttribute attributeIfc) {
+    private Map<String, String> createYangToJmxMapping(final TOAttribute attributeIfc) {
         Map<String, String> retVal = Maps.newHashMap();
         for (Entry<String, AttributeIfc> entry : attributeIfc.getYangPropertiesToTypesMap().entrySet()) {
             retVal.put(entry.getKey(), (entry.getValue()).getLowerCaseCammelCase());
@@ -65,12 +65,12 @@ public class ObjectResolver extends AttributeIfcSwitchStatement<AttributeResolvi
     }
 
     @Override
-    protected AttributeResolvingStrategy<?, ? extends OpenType<?>>  caseJavaSimpleAttribute(SimpleType<?> openType) {
+    protected AttributeResolvingStrategy<?, ? extends OpenType<?>>  caseJavaSimpleAttribute(final SimpleType<?> openType) {
         return new SimpleAttributeResolvingStrategy(openType);
     }
 
     @Override
-    protected AttributeResolvingStrategy<?, ? extends OpenType<?>>  caseJavaArrayAttribute(ArrayType<?> openType) {
+    protected AttributeResolvingStrategy<?, ? extends OpenType<?>>  caseJavaArrayAttribute(final ArrayType<?> openType) {
 
         SimpleType<?> innerType = (SimpleType<?>) openType.getElementOpenType();
         AttributeResolvingStrategy<?, ? extends OpenType<?>> strat = new SimpleAttributeResolvingStrategy(innerType);
@@ -78,7 +78,7 @@ public class ObjectResolver extends AttributeIfcSwitchStatement<AttributeResolvi
     }
 
     @Override
-    protected AttributeResolvingStrategy<?, ? extends OpenType<?>>  caseJavaCompositeAttribute(CompositeType openType) {
+    protected AttributeResolvingStrategy<?, ? extends OpenType<?>>  caseJavaCompositeAttribute(final CompositeType openType) {
         Map<String, AttributeResolvingStrategy<?, ? extends OpenType<?>>> innerMap = Maps.newHashMap();
         Map<String, String> yangToJmxMapping = Maps.newHashMap();
 
@@ -86,7 +86,7 @@ public class ObjectResolver extends AttributeIfcSwitchStatement<AttributeResolvi
         return new CompositeAttributeResolvingStrategy(innerMap, openType, yangToJmxMapping);
     }
 
-    private void fillMappingForComposite(CompositeType openType, Map<String, AttributeResolvingStrategy<?, ? extends OpenType<?>>> innerMap, Map<String, String> yangToJmxMapping) {
+    private void fillMappingForComposite(final CompositeType openType, final Map<String, AttributeResolvingStrategy<?, ? extends OpenType<?>>> innerMap, final Map<String, String> yangToJmxMapping) {
         for (String innerAttributeKey : openType.keySet()) {
             innerMap.put(innerAttributeKey, caseJavaAttribute(openType.getType(innerAttributeKey)));
             yangToJmxMapping.put(innerAttributeKey, innerAttributeKey);
@@ -94,7 +94,7 @@ public class ObjectResolver extends AttributeIfcSwitchStatement<AttributeResolvi
     }
 
     @Override
-    protected AttributeResolvingStrategy<?, ? extends OpenType<?>> caseJavaUnionAttribute(OpenType<?> openType) {
+    protected AttributeResolvingStrategy<?, ? extends OpenType<?>> caseJavaUnionAttribute(final OpenType<?> openType) {
 
         Preconditions.checkState(openType instanceof CompositeType, "Unexpected open type, expected %s but was %s");
         CompositeType compositeType = (CompositeType) openType;
@@ -108,12 +108,12 @@ public class ObjectResolver extends AttributeIfcSwitchStatement<AttributeResolvi
 
     @Override
     protected AttributeResolvingStrategy<?, ? extends OpenType<?>> caseDependencyAttribute(
-            SimpleType<?> openType) {
+            final SimpleType<?> openType) {
         return new ObjectNameAttributeResolvingStrategy(serviceTracker);
     }
 
     @Override
-    protected AttributeResolvingStrategy<?, ? extends OpenType<?>> caseTOAttribute(CompositeType openType) {
+    protected AttributeResolvingStrategy<?, ? extends OpenType<?>> caseTOAttribute(final CompositeType openType) {
         Preconditions.checkState(getLastAttribute() instanceof TOAttribute);
         TOAttribute toAttribute = (TOAttribute) getLastAttribute();
 
@@ -129,14 +129,14 @@ public class ObjectResolver extends AttributeIfcSwitchStatement<AttributeResolvi
     }
 
     @Override
-    protected AttributeResolvingStrategy<?, ? extends OpenType<?>> caseListAttribute(ArrayType<?> openType) {
+    protected AttributeResolvingStrategy<?, ? extends OpenType<?>> caseListAttribute(final ArrayType<?> openType) {
         Preconditions.checkState(getLastAttribute() instanceof ListAttribute);
         AttributeIfc innerAttribute = ((ListAttribute) getLastAttribute()).getInnerAttribute();
         return new ArrayAttributeResolvingStrategy(prepareStrategy(innerAttribute), openType);
     }
 
     @Override
-    protected AttributeResolvingStrategy<?, ? extends OpenType<?>> caseListDependeciesAttribute(ArrayType<?> openType) {
+    protected AttributeResolvingStrategy<?, ? extends OpenType<?>> caseListDependeciesAttribute(final ArrayType<?> openType) {
         Preconditions.checkState(getLastAttribute() instanceof ListDependenciesAttribute);
         return new ArrayAttributeResolvingStrategy(caseDependencyAttribute(SimpleType.OBJECTNAME), openType);
     }
index 5412882e33a69f6e6d8a55d10d8ce54802ecee88..f639ed9cbe4a997b40436bcd13dc8872415b775e 100644 (file)
@@ -27,7 +27,7 @@ final class SimpleAttributeResolvingStrategy extends AbstractAttributeResolvingS
 
     private static final Logger LOG = LoggerFactory.getLogger(SimpleAttributeResolvingStrategy.class);
 
-    SimpleAttributeResolvingStrategy(SimpleType<?> simpleType) {
+    SimpleAttributeResolvingStrategy(final SimpleType<?> simpleType) {
         super(simpleType);
     }
 
@@ -37,7 +37,7 @@ final class SimpleAttributeResolvingStrategy extends AbstractAttributeResolvingS
     }
 
     @Override
-    public Optional<Object> parseAttribute(String attrName, Object value) throws DocumentedException {
+    public Optional<Object> parseAttribute(final String attrName, final Object value) throws DocumentedException {
         if (value == null) {
             return Optional.absent();
         }
@@ -45,7 +45,7 @@ final class SimpleAttributeResolvingStrategy extends AbstractAttributeResolvingS
         Class<?> cls;
         try {
             cls = Class.forName(getOpenType().getClassName());
-        } catch (ClassNotFoundException e) {
+        } catch (final ClassNotFoundException e) {
             throw new RuntimeException("Unable to locate class for " + getOpenType().getClassName(), e);
         }
 
@@ -78,10 +78,10 @@ final class SimpleAttributeResolvingStrategy extends AbstractAttributeResolvingS
     static class DefaultResolver implements Resolver {
 
         @Override
-        public Object resolveObject(Class<?> type, String attrName, String value) throws DocumentedException {
+        public Object resolveObject(final Class<?> type, final String attrName, final String value) throws DocumentedException {
             try {
                 return parseObject(type, value);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new DocumentedException("Unable to resolve attribute " + attrName + " from " + value,
                         DocumentedException.ErrorType.APPLICATION,
                         DocumentedException.ErrorTag.OPERATION_FAILED,
@@ -89,7 +89,7 @@ final class SimpleAttributeResolvingStrategy extends AbstractAttributeResolvingS
             }
         }
 
-        protected Object parseObject(Class<?> type, String value) throws DocumentedException {
+        protected Object parseObject(final Class<?> type, final String value) throws DocumentedException {
             Method method = null;
             try {
                 method = type.getMethod("valueOf", String.class);
@@ -107,7 +107,7 @@ final class SimpleAttributeResolvingStrategy extends AbstractAttributeResolvingS
     static class StringResolver extends DefaultResolver {
 
         @Override
-        protected Object parseObject(Class<?> type, String value) {
+        protected Object parseObject(final Class<?> type, final String value) {
             return value;
         }
     }
@@ -115,7 +115,7 @@ final class SimpleAttributeResolvingStrategy extends AbstractAttributeResolvingS
     static class BigIntegerResolver extends DefaultResolver {
 
         @Override
-        protected Object parseObject(Class<?> type, String value) {
+        protected Object parseObject(final Class<?> type, final String value) {
             return new BigInteger(value);
         }
     }
@@ -123,7 +123,7 @@ final class SimpleAttributeResolvingStrategy extends AbstractAttributeResolvingS
     static class BigDecimalResolver extends DefaultResolver {
 
         @Override
-        protected Object parseObject(Class<?> type, String value) {
+        protected Object parseObject(final Class<?> type, final String value) {
             return new BigDecimal(value);
         }
     }
@@ -131,17 +131,17 @@ final class SimpleAttributeResolvingStrategy extends AbstractAttributeResolvingS
     static class CharResolver extends DefaultResolver {
 
         @Override
-        protected Object parseObject(Class<?> type, String value)  {
+        protected Object parseObject(final Class<?> type, final String value)  {
             return value.charAt(0);
         }
     }
 
     static class DateResolver extends DefaultResolver {
         @Override
-        protected Object parseObject(Class<?> type, String value) throws DocumentedException {
+        protected Object parseObject(final Class<?> type, final String value) throws DocumentedException {
             try {
                 return Util.readDate(value);
-            } catch (ParseException e) {
+            } catch (final ParseException e) {
                 LOG.trace("Unable parse value {} due to ",value, e);
                 throw new DocumentedException("Unable to parse value "+value+" as date.",
                         DocumentedException.ErrorType.APPLICATION,
index 05dc488ffa575b701eafbb4fb5a1ca06d6421f14..c47087f5b079b1052aedb029f5d7a9600cf71491 100644 (file)
@@ -17,12 +17,12 @@ import org.opendaylight.controller.config.yangjmxgenerator.attribute.JavaAttribu
 
 final class UnionCompositeAttributeResolvingStrategy extends CompositeAttributeResolvingStrategy {
 
-    UnionCompositeAttributeResolvingStrategy(Map<String, AttributeResolvingStrategy<?, ? extends OpenType<?>>> innerTypes,
-                                        CompositeType openType, Map<String, String> yangToJavaAttrMapping) {
+    UnionCompositeAttributeResolvingStrategy(final Map<String, AttributeResolvingStrategy<?, ? extends OpenType<?>>> innerTypes,
+                                        final CompositeType openType, final Map<String, String> yangToJavaAttrMapping) {
         super(innerTypes, openType, yangToJavaAttrMapping);
     }
 
-    protected Map<String, Object> preprocessValueMap(Map<?, ?> valueMap) {
+    protected Map<String, Object> preprocessValueMap(final Map<?, ?> valueMap) {
         CompositeType openType = getOpenType();
 
         Preconditions.checkArgument(
index 2401371823bf75ee8329b62dee3ab25dc4a65289..311ab1d512d2b6266eada1548103cdde1fd3b941 100644 (file)
@@ -16,12 +16,12 @@ public class ArrayAttributeWritingStrategy implements AttributeWritingStrategy {
 
     private final AttributeWritingStrategy innnerStrategy;
 
-    public ArrayAttributeWritingStrategy(AttributeWritingStrategy innerStrategy) {
+    public ArrayAttributeWritingStrategy(final AttributeWritingStrategy innerStrategy) {
         this.innnerStrategy = innerStrategy;
     }
 
     @Override
-    public void writeElement(Element parentElement, String namespace, Object value) {
+    public void writeElement(final Element parentElement, final String namespace, final Object value) {
         Util.checkType(value, List.class);
 
         for (Object innerObject : ((List<?>) value)) {
index ee4b009fff19feaef50813071e0de9645d5cee8d..58579f72c779238b0e8e32481afedcd10b489020 100644 (file)
@@ -22,15 +22,15 @@ public class CompositeAttributeWritingStrategy implements AttributeWritingStrate
     private final Document document;
     private final Map<String, AttributeWritingStrategy> innerStrats;
 
-    public CompositeAttributeWritingStrategy(Document document, String key,
-            Map<String, AttributeWritingStrategy> innerStrats) {
+    public CompositeAttributeWritingStrategy(final Document document, final String key,
+            final Map<String, AttributeWritingStrategy> innerStrats) {
         this.document = document;
         this.key = key;
         this.innerStrats = innerStrats;
     }
 
     @Override
-    public void writeElement(Element parentElement, String namespace, Object value) {
+    public void writeElement(final Element parentElement, final String namespace, final Object value) {
         Util.checkType(value, Map.class);
 
         Element innerNode = XmlUtil.createElement(document, key, Optional.of(namespace));
index 95bb96708f2f393637948b896002be3a9fbb2cdd..0dc8731d4cac3e750daadaeb1bccc5219018c1a4 100644 (file)
@@ -25,13 +25,13 @@ public class ObjectNameAttributeWritingStrategy implements AttributeWritingStrat
      * @param document
      * @param key
      */
-    public ObjectNameAttributeWritingStrategy(Document document, String key) {
+    public ObjectNameAttributeWritingStrategy(final Document document, final String key) {
         this.document = document;
         this.key = key;
     }
 
     @Override
-    public void writeElement(Element parentElement, String namespace, Object value) {
+    public void writeElement(final Element parentElement, final String namespace, final Object value) {
         Util.checkType(value, ObjectNameAttributeMappingStrategy.MappedDependency.class);
         Element innerNode = XmlUtil.createElement(document, key, Optional.of(namespace));
 
index 3eb6fcebf1652441e6c5318097188a458ba102b8..d72d65baa86e71e7f1451de2b5c0384007232b46 100644 (file)
@@ -28,8 +28,8 @@ public class ObjectXmlWriter extends AttributeIfcSwitchStatement<AttributeWritin
     private Document document;
     private String key;
 
-    public Map<String, AttributeWritingStrategy> prepareWriting(Map<String, AttributeIfc> yangToAttrConfig,
-            Document document) {
+    public Map<String, AttributeWritingStrategy> prepareWriting(final Map<String, AttributeIfc> yangToAttrConfig,
+            final Document document) {
 
         Map<String, AttributeWritingStrategy> preparedWriting = Maps.newHashMap();
 
@@ -43,7 +43,7 @@ public class ObjectXmlWriter extends AttributeIfcSwitchStatement<AttributeWritin
         return preparedWriting;
     }
 
-    public AttributeWritingStrategy prepareWritingStrategy(String key, AttributeIfc expectedAttr, Document document) {
+    public AttributeWritingStrategy prepareWritingStrategy(final String key, final AttributeIfc expectedAttr, final Document document) {
         Preconditions.checkNotNull(expectedAttr, "Mbean attributes mismatch, unable to find expected attribute for %s",
                 key);
         this.document = document;
@@ -52,7 +52,7 @@ public class ObjectXmlWriter extends AttributeIfcSwitchStatement<AttributeWritin
     }
 
     @Override
-    protected AttributeWritingStrategy caseJavaBinaryAttribute(OpenType<?> openType) {
+    protected AttributeWritingStrategy caseJavaBinaryAttribute(final OpenType<?> openType) {
         return new SimpleBinaryAttributeWritingStrategy(document, key);
     }
 
@@ -62,38 +62,38 @@ public class ObjectXmlWriter extends AttributeIfcSwitchStatement<AttributeWritin
     }
 
     @Override
-    protected AttributeWritingStrategy caseJavaSimpleAttribute(SimpleType<?> openType) {
+    protected AttributeWritingStrategy caseJavaSimpleAttribute(final SimpleType<?> openType) {
         return new SimpleAttributeWritingStrategy(document, key);
     }
 
     @Override
-    protected AttributeWritingStrategy caseJavaArrayAttribute(ArrayType<?> openType) {
+    protected AttributeWritingStrategy caseJavaArrayAttribute(final ArrayType<?> openType) {
         AttributeWritingStrategy innerStrategy = new SimpleAttributeWritingStrategy(document, key);
         return new ArrayAttributeWritingStrategy(innerStrategy);
     }
 
     @Override
-    protected AttributeWritingStrategy caseJavaIdentityRefAttribute(OpenType<?> openType) {
+    protected AttributeWritingStrategy caseJavaIdentityRefAttribute(final OpenType<?> openType) {
         return new SimpleIdentityRefAttributeWritingStrategy(document, key);
     }
 
     @Override
-    protected AttributeWritingStrategy caseJavaCompositeAttribute(CompositeType openType) {
+    protected AttributeWritingStrategy caseJavaCompositeAttribute(final CompositeType openType) {
         return new SimpleCompositeAttributeWritingStrategy(document, key);
     }
 
     @Override
-    protected AttributeWritingStrategy caseJavaUnionAttribute(OpenType<?> openType) {
+    protected AttributeWritingStrategy caseJavaUnionAttribute(final OpenType<?> openType) {
         return new SimpleUnionAttributeWritingStrategy(document, key);
     }
 
     @Override
-    protected AttributeWritingStrategy caseDependencyAttribute(SimpleType<?> openType) {
+    protected AttributeWritingStrategy caseDependencyAttribute(final SimpleType<?> openType) {
         return new ObjectNameAttributeWritingStrategy(document, key);
     }
 
     @Override
-    protected AttributeWritingStrategy caseTOAttribute(CompositeType openType) {
+    protected AttributeWritingStrategy caseTOAttribute(final CompositeType openType) {
         Preconditions.checkState(getLastAttribute() instanceof TOAttribute);
 
         Map<String, AttributeWritingStrategy> innerStrats = Maps.newHashMap();
@@ -109,7 +109,7 @@ public class ObjectXmlWriter extends AttributeIfcSwitchStatement<AttributeWritin
     }
 
     @Override
-    protected AttributeWritingStrategy caseListAttribute(ArrayType<?> openType) {
+    protected AttributeWritingStrategy caseListAttribute(final ArrayType<?> openType) {
         Preconditions.checkState(getLastAttribute() instanceof ListAttribute);
         AttributeIfc innerAttribute = ((ListAttribute) getLastAttribute()).getInnerAttribute();
 
@@ -118,7 +118,7 @@ public class ObjectXmlWriter extends AttributeIfcSwitchStatement<AttributeWritin
     }
 
     @Override
-    protected AttributeWritingStrategy caseListDependeciesAttribute(ArrayType<?> openType) {
+    protected AttributeWritingStrategy caseListDependeciesAttribute(final ArrayType<?> openType) {
         Preconditions.checkState(getLastAttribute() instanceof ListDependenciesAttribute);
         AttributeWritingStrategy innerStrategy = caseDependencyAttribute(SimpleType.OBJECTNAME);
         return new ArrayAttributeWritingStrategy(innerStrategy);
index f85117eaa24b1851a956ce040347a904fb36c0b8..f0a1121958b43747c8741a4d7f7f7eb012e68ddf 100644 (file)
@@ -18,13 +18,13 @@ import org.w3c.dom.Element;
 
 public class RuntimeBeanEntryWritingStrategy extends CompositeAttributeWritingStrategy {
 
-    public RuntimeBeanEntryWritingStrategy(Document document, String key,
-            Map<String, AttributeWritingStrategy> innerStrats) {
+    public RuntimeBeanEntryWritingStrategy(final Document document, final String key,
+            final Map<String, AttributeWritingStrategy> innerStrats) {
         super(document, key, innerStrats);
     }
 
     @Override
-    public void writeElement(Element parentElement, String namespace, Object value) {
+    public void writeElement(final Element parentElement, final String namespace, final Object value) {
         Util.checkType(value, Map.class);
 
         Element innerNode = XmlUtil.createElement(getDocument(), getKey(), Optional.<String>absent());
index 5e2f0c740521bd54e8fedbbfdd808e817fb8fc92..c8e218aae820be68d9f611b3115dc9dac5572e95 100644 (file)
@@ -23,26 +23,26 @@ public class SimpleAttributeWritingStrategy implements AttributeWritingStrategy
      * @param document
      * @param key
      */
-    public SimpleAttributeWritingStrategy(Document document, String key) {
+    public SimpleAttributeWritingStrategy(final Document document, final String key) {
         this.document = document;
         this.key = key;
     }
 
     @Override
-    public void writeElement(Element parentElement, String namespace, Object value) {
+    public void writeElement(final Element parentElement, final String namespace, Object value) {
         value = preprocess(value);
         Util.checkType(value, String.class);
         Element innerNode = createElement(document, key, (String) value, Optional.of(namespace));
         parentElement.appendChild(innerNode);
     }
 
-    protected Element createElement(Document document, String key, String value, Optional<String> namespace) {
+    protected Element createElement(final Document document, final String key, final String value, final Optional<String> namespace) {
         Element typeElement = XmlUtil.createElement(document, key, namespace);
 
         typeElement.appendChild(document.createTextNode(value));
         return typeElement;
     }
-    protected Object preprocess(Object value) {
+    protected Object preprocess(final Object value) {
         return value;
     }
 
index d6db3c32113d8590370378c95a519976ca78f641..f56ee73703b663414d9ae806923c292494a46ea6 100644 (file)
@@ -20,12 +20,12 @@ public class SimpleBinaryAttributeWritingStrategy extends SimpleAttributeWriting
      * @param document
      * @param key
      */
-    public SimpleBinaryAttributeWritingStrategy(Document document, String key) {
+    public SimpleBinaryAttributeWritingStrategy(final Document document, final String key) {
         super(document, key);
     }
 
     @Override
-    protected Object preprocess(Object value) {
+    protected Object preprocess(final Object value) {
         Util.checkType(value, List.class);
         BaseEncoding en = BaseEncoding.base64();
 
index 5bd34e588cbcda413243104c9256eac6f9289da2..b67371a927a99f6fa391f94acf860d2c8e5c57ce 100644 (file)
@@ -19,11 +19,11 @@ public class SimpleCompositeAttributeWritingStrategy extends SimpleAttributeWrit
      * @param document
      * @param key
      */
-    public SimpleCompositeAttributeWritingStrategy(Document document, String key) {
+    public SimpleCompositeAttributeWritingStrategy(final Document document, final String key) {
         super(document, key);
     }
 
-    protected Object preprocess(Object value) {
+    protected Object preprocess(final Object value) {
         Util.checkType(value, Map.class);
         Preconditions.checkArgument(((Map<?, ?>)value).size() == 1, "Unexpected number of values in %s, expected 1", value);
         return ((Map<?, ?>)value).values().iterator().next();
index 44b1f3eb210f5012229512565b3655aafe369392..aba1173921a343eb6fe5dc4014f4dfd6172a6982 100644 (file)
@@ -25,11 +25,11 @@ public class SimpleIdentityRefAttributeWritingStrategy extends SimpleAttributeWr
      * @param document
      * @param key
      */
-    public SimpleIdentityRefAttributeWritingStrategy(Document document, String key) {
+    public SimpleIdentityRefAttributeWritingStrategy(final Document document, final String key) {
         super(document, key);
     }
 
-    protected Object preprocess(Object value) {
+    protected Object preprocess(final Object value) {
         Util.checkType(value, Map.class);
         Preconditions.checkArgument(((Map<?, ?>)value).size() == 1, "Unexpected number of values in %s, expected 1", value);
         Object stringValue = ((Map<?, ?>) value).values().iterator().next();
@@ -39,7 +39,7 @@ public class SimpleIdentityRefAttributeWritingStrategy extends SimpleAttributeWr
     }
 
     @Override
-    protected Element createElement(Document doc, String key, String value, Optional<String> namespace) {
+    protected Element createElement(final Document doc, final String key, final String value, final Optional<String> namespace) {
         QName qName = QName.create(value);
         String identityValue = qName.getLocalName();
         String identityNamespace = qName.getNamespace().toString();
index 969ef002aff5333b4a7395a7271f17d6612a4eb9..d3b0c00114e2a9912c2aaff66f478a0b2370b2bb 100644 (file)
@@ -20,11 +20,11 @@ public class SimpleUnionAttributeWritingStrategy extends SimpleAttributeWritingS
      * @param document
      * @param key
      */
-    public SimpleUnionAttributeWritingStrategy(Document document, String key) {
+    public SimpleUnionAttributeWritingStrategy(final Document document, final String key) {
         super(document, key);
     }
 
-    protected Object preprocess(Object value) {
+    protected Object preprocess(final Object value) {
         Util.checkType(value, Map.class);
         Preconditions.checkArgument(((Map<?, ?>)value).size() == 1, "Unexpected number of values in %s, expected 1", value);
         Object listOfStrings = ((Map<?, ?>) value).values().iterator().next();
index 10602ce7e5011e42bff511430bd46353c4565cde..21b74da6cd23dd2a79c7c6422b461e1e4b428171 100644 (file)
@@ -44,18 +44,18 @@ public class Config {
 
     private final EnumResolver enumResolver;
 
-    public Config(Map<String, Map<String, ModuleConfig>> moduleConfigs, final EnumResolver enumResolver) {
+    public Config(final Map<String, Map<String, ModuleConfig>> moduleConfigs, final EnumResolver enumResolver) {
         this(moduleConfigs, Collections.<String, Map<Date, IdentityMapping>>emptyMap(), enumResolver);
     }
 
-    public Config(Map<String, Map<String, ModuleConfig>> moduleConfigs, Map<String, Map<Date, IdentityMapping>> identityMap, final EnumResolver enumResolver) {
+    public Config(final Map<String, Map<String, ModuleConfig>> moduleConfigs, final Map<String, Map<Date, IdentityMapping>> identityMap, final EnumResolver enumResolver) {
         this.moduleConfigs = moduleConfigs;
         this.identityMap = identityMap;
         this.enumResolver = enumResolver;
     }
 
-    public static Map<String, Map<String, Collection<ObjectName>>> getMappedInstances(Set<ObjectName> instancesToMap,
-                                                                                Map<String, Map<String, ModuleConfig>> configs) {
+    public static Map<String, Map<String, Collection<ObjectName>>> getMappedInstances(final Set<ObjectName> instancesToMap,
+                                                                                final Map<String, Map<String, ModuleConfig>> configs) {
         Multimap<String, ObjectName> moduleToInstances = mapInstancesToModules(instancesToMap);
 
         Map<String, Map<String, Collection<ObjectName>>> retVal = Maps.newLinkedHashMap();
@@ -85,7 +85,7 @@ public class Config {
         return retVal;
     }
 
-    private static Multimap<String, ObjectName> mapInstancesToModules(Set<ObjectName> instancesToMap) {
+    private static Multimap<String, ObjectName> mapInstancesToModules(final Set<ObjectName> instancesToMap) {
         Multimap<String, ObjectName> retVal = HashMultimap.create();
 
         for (ObjectName objectName : instancesToMap) {
@@ -95,8 +95,8 @@ public class Config {
         return retVal;
     }
 
-    public Element toXml(Set<ObjectName> instancesToMap, Optional<String> maybeNamespace, Document document,
-            Element dataElement, ServiceRegistryWrapper serviceTracker) {
+    public Element toXml(final Set<ObjectName> instancesToMap, final Optional<String> maybeNamespace, final Document document,
+            final Element dataElement, final ServiceRegistryWrapper serviceTracker) {
 
         Map<String, Map<String, Collection<ObjectName>>> moduleToInstances = getMappedInstances(instancesToMap,
                 moduleConfigs);
@@ -129,8 +129,8 @@ public class Config {
         return dataElement;
     }
 
-    public Element moduleToXml(String moduleNamespace, String factoryName, String instanceName,
-        ObjectName instanceON, Document document) {
+    public Element moduleToXml(final String moduleNamespace, final String factoryName, final String instanceName,
+        final ObjectName instanceON, final Document document) {
         ModuleConfig moduleConfig = getModuleMapping(moduleNamespace, instanceName, factoryName);
         return moduleConfig.toXml(instanceON, document, moduleNamespace, enumResolver);
     }
@@ -139,7 +139,7 @@ public class Config {
     // TODO refactor, replace Map->Multimap with e.g. ConfigElementResolved
     // class
 
-    public Map<String, Multimap<String, ModuleElementResolved>> fromXmlModulesResolved(XmlElement xml, EditStrategyType defaultEditStrategyType, ServiceRegistryWrapper serviceTracker) throws DocumentedException {
+    public Map<String, Multimap<String, ModuleElementResolved>> fromXmlModulesResolved(final XmlElement xml, final EditStrategyType defaultEditStrategyType, final ServiceRegistryWrapper serviceTracker) throws DocumentedException {
         Optional<XmlElement> modulesElement = getModulesElement(xml);
         List<XmlElement> moduleElements = getModulesElementList(modulesElement);
 
@@ -148,7 +148,7 @@ public class Config {
         for (XmlElement moduleElement : moduleElements) {
             ResolvingStrategy<ModuleElementResolved> resolvingStrategy = new ResolvingStrategy<ModuleElementResolved>() {
                 @Override
-                public ModuleElementResolved resolveElement(ModuleConfig moduleMapping, XmlElement moduleElement, ServiceRegistryWrapper serviceTracker, String instanceName, String moduleNamespace, EditStrategyType defaultStrategy) throws DocumentedException {
+                public ModuleElementResolved resolveElement(final ModuleConfig moduleMapping, final XmlElement moduleElement, final ServiceRegistryWrapper serviceTracker, final String instanceName, final String moduleNamespace, final EditStrategyType defaultStrategy) throws DocumentedException {
                     return moduleMapping.fromXml(moduleElement, serviceTracker,
                             instanceName, moduleNamespace, defaultStrategy, identityMap, enumResolver);
                 }
@@ -162,8 +162,8 @@ public class Config {
     /**
      * return a map containing namespace -&gt; moduleName -&gt; instanceName map. Attribute parsing is omitted.
      */
-    public Map<String, Multimap<String, ModuleElementDefinition>> fromXmlModulesMap(XmlElement xml,
-            EditStrategyType defaultEditStrategyType, ServiceRegistryWrapper serviceTracker) throws DocumentedException {
+    public Map<String, Multimap<String, ModuleElementDefinition>> fromXmlModulesMap(final XmlElement xml,
+            final EditStrategyType defaultEditStrategyType, final ServiceRegistryWrapper serviceTracker) throws DocumentedException {
         Optional<XmlElement> modulesElement = getModulesElement(xml);
         List<XmlElement> moduleElements = getModulesElementList(modulesElement);
 
@@ -172,9 +172,9 @@ public class Config {
         for (XmlElement moduleElement : moduleElements) {
             ResolvingStrategy<ModuleElementDefinition> resolvingStrategy = new ResolvingStrategy<ModuleElementDefinition>() {
                 @Override
-                public ModuleElementDefinition resolveElement(ModuleConfig moduleMapping, XmlElement moduleElement,
-                        ServiceRegistryWrapper serviceTracker, String instanceName, String moduleNamespace,
-                        EditStrategyType defaultStrategy) {
+                public ModuleElementDefinition resolveElement(final ModuleConfig moduleMapping, final XmlElement moduleElement,
+                        final ServiceRegistryWrapper serviceTracker, final String instanceName, final String moduleNamespace,
+                        final EditStrategyType defaultStrategy) {
                     // TODO: add check for conflicts between global and local
                     // edit strategy
                     String perInstanceEditStrategy = moduleElement.getAttribute(XmlMappingConstants.OPERATION_ATTR_KEY,
@@ -188,12 +188,12 @@ public class Config {
         return retVal;
     }
 
-    private static Optional<XmlElement> getModulesElement(XmlElement xml) {
+    private static Optional<XmlElement> getModulesElement(final XmlElement xml) {
         return xml.getOnlyChildElementOptionally(XmlMappingConstants.MODULES_KEY,
                     XmlMappingConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG);
     }
 
-    private List<XmlElement> getModulesElementList(Optional<XmlElement> modulesElement) throws DocumentedException {
+    private List<XmlElement> getModulesElementList(final Optional<XmlElement> modulesElement) throws DocumentedException {
         List<XmlElement> moduleElements;
 
         if (modulesElement.isPresent()) {
@@ -205,8 +205,8 @@ public class Config {
         return moduleElements;
     }
 
-    private <T> void resolveModule(Map<String, Multimap<String, T>> retVal, ServiceRegistryWrapper serviceTracker,
-            XmlElement moduleElement, EditStrategyType defaultStrategy, ResolvingStrategy<T> resolvingStrategy) throws DocumentedException {
+    private <T> void resolveModule(final Map<String, Multimap<String, T>> retVal, final ServiceRegistryWrapper serviceTracker,
+            final XmlElement moduleElement, final EditStrategyType defaultStrategy, final ResolvingStrategy<T> resolvingStrategy) throws DocumentedException {
         XmlElement typeElement = null;
         typeElement = moduleElement.getOnlyChildElementWithSameNamespace(XmlMappingConstants.TYPE_KEY);
         Entry<String, String> prefixToNamespace = typeElement.findNamespaceOfTextContent();
@@ -232,7 +232,7 @@ public class Config {
         innerMap.put(factoryName, resolvedElement);
     }
 
-    public Services fromXmlServices(XmlElement xml) throws DocumentedException {
+    public Services fromXmlServices(final XmlElement xml) throws DocumentedException {
         Optional<XmlElement> servicesElement = getServicesElement(xml);
 
         Services services;
@@ -245,12 +245,12 @@ public class Config {
         return services;
     }
 
-    private static Optional<XmlElement> getServicesElement(XmlElement xml) {
+    private static Optional<XmlElement> getServicesElement(final XmlElement xml) {
         return xml.getOnlyChildElementOptionally(XmlMappingConstants.SERVICES_KEY,
                     XmlMappingConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG);
     }
 
-    public static void checkUnrecognisedChildren(XmlElement parent) throws DocumentedException {
+    public static void checkUnrecognisedChildren(final XmlElement parent) throws DocumentedException {
         Optional<XmlElement> servicesOpt = getServicesElement(parent);
         Optional<XmlElement> modulesOpt = getModulesElement(parent);
 
@@ -265,7 +265,7 @@ public class Config {
         parent.checkUnrecognisedElements(recognised);
     }
 
-    private String getFactoryName(String factoryNameWithPrefix, String prefixOrEmptyString) {
+    private String getFactoryName(final String factoryNameWithPrefix, final String prefixOrEmptyString) {
         checkState(
                 factoryNameWithPrefix.startsWith(prefixOrEmptyString),
                 String.format("Internal error: text " + "content '%s' of type node does not start with prefix '%s'",
@@ -280,7 +280,7 @@ public class Config {
         return factoryNameWithPrefix.substring(factoryNameAfterPrefixIndex);
     }
 
-    private ModuleConfig getModuleMapping(String moduleNamespace, String instanceName, String factoryName) {
+    private ModuleConfig getModuleMapping(final String moduleNamespace, final String instanceName, final String factoryName) {
         Map<String, ModuleConfig> mappingsFromNamespace = moduleConfigs.get(moduleNamespace);
 
         Preconditions.checkNotNull(mappingsFromNamespace,
index a66fd75dbddfd2a04a69d658b31b2c829284a7ff..b9f4cda834ca742d39ba6eaedeaf8e1b0d9f118f 100644 (file)
@@ -49,8 +49,8 @@ public final class InstanceConfig {
     private final Map<String, AttributeIfc> jmxToAttrConfig;
     private final BeanReader configRegistryClient;
 
-    public InstanceConfig(BeanReader configRegistryClient, Map<String, AttributeIfc> yangNamesToAttributes,
-                          String nullableDummyContainerName) {
+    public InstanceConfig(final BeanReader configRegistryClient, final Map<String, AttributeIfc> yangNamesToAttributes,
+                          final String nullableDummyContainerName) {
 
         this.yangToAttrConfig = yangNamesToAttributes;
         this.nullableDummyContainerName = nullableDummyContainerName;
@@ -58,7 +58,7 @@ public final class InstanceConfig {
         this.configRegistryClient = configRegistryClient;
     }
 
-    private Map<String, Object> getMappedConfiguration(ObjectName on, final EnumResolver enumResolver) {
+    private Map<String, Object> getMappedConfiguration(final ObjectName on, final EnumResolver enumResolver) {
 
         // TODO make field, mappingStrategies can be instantiated only once
         Map<String, AttributeMappingStrategy<?, ? extends OpenType<?>>> mappingStrategies = new ObjectMapper()
@@ -80,7 +80,7 @@ public final class InstanceConfig {
                     continue;
                 }
                 toXml.put(configDefEntry.getValue().getAttributeYangName(), a.get());
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new IllegalStateException("Unable to map value " + value + " to attribute "
                         + configDefEntry.getKey(), e);
             }
@@ -88,7 +88,7 @@ public final class InstanceConfig {
         return toXml;
     }
 
-    public Element toXml(ObjectName on, String namespace, Document document, Element rootElement, final EnumResolver enumResolver) {
+    public Element toXml(final ObjectName on, final String namespace, final Document document, final Element rootElement, final EnumResolver enumResolver) {
         Map<String, AttributeWritingStrategy> strats = new ObjectXmlWriter().prepareWriting(yangToAttrConfig, document);
         Map<String, Object> mappedConfig = getMappedConfiguration(on, enumResolver);
         Element parentElement;
@@ -102,7 +102,7 @@ public final class InstanceConfig {
         for (Entry<String, ?> mappingEntry : mappedConfig.entrySet()) {
             try {
                 strats.get(mappingEntry.getKey()).writeElement(parentElement, namespace, mappingEntry.getValue());
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new IllegalStateException("Unable to write value " + mappingEntry.getValue() + " for attribute "
                         + mappingEntry.getValue(), e);
             }
@@ -110,7 +110,7 @@ public final class InstanceConfig {
         return rootElement;
     }
 
-    private void resolveConfiguration(InstanceConfigElementResolved mappedConfig, ServiceRegistryWrapper depTracker, final EnumResolver enumResolver) {
+    private void resolveConfiguration(final InstanceConfigElementResolved mappedConfig, final ServiceRegistryWrapper depTracker, final EnumResolver enumResolver) {
 
         // TODO make field, resolvingStrategies can be instantiated only once
         Map<String, AttributeResolvingStrategy<?, ? extends OpenType<?>>> resolvingStrategies = new ObjectResolver(
@@ -127,16 +127,16 @@ public final class InstanceConfig {
                 value.resolveValue(attributeResolvingStrategy, attributeName);
                 value.setJmxName(
                         yangToAttrConfig.get(attributeName).getUpperCaseCammelCase());
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new IllegalStateException("Unable to resolve value " + value
                         + " to attribute " + attributeName, e);
             }
         }
     }
 
-    public InstanceConfigElementResolved fromXml(XmlElement moduleElement, ServiceRegistryWrapper services, String moduleNamespace,
-                                                 EditStrategyType defaultStrategy,
-                                                 Map<String, Map<Date, IdentityMapping>> identityMap, final EnumResolver enumResolver) throws DocumentedException {
+    public InstanceConfigElementResolved fromXml(XmlElement moduleElement, final ServiceRegistryWrapper services, final String moduleNamespace,
+                                                 final EditStrategyType defaultStrategy,
+                                                 final Map<String, Map<Date, IdentityMapping>> identityMap, final EnumResolver enumResolver) throws DocumentedException {
         Map<String, AttributeConfigElement> retVal = Maps.newHashMap();
 
         Map<String, AttributeReadingStrategy> strats = new ObjectXmlReader().prepareReading(yangToAttrConfig, identityMap);
@@ -159,7 +159,7 @@ public final class InstanceConfig {
             if (size == expectedChildNodes) {
                 try {
                     moduleElement = moduleElement.getOnlyChildElement(nullableDummyContainerName, moduleNamespace);
-                } catch (DocumentedException e) {
+                } catch (final DocumentedException e) {
                     throw new DocumentedException("Error reading module " + typeElement.getTextContent() + " : " +
                             nameElement.getTextContent() + " - Expected child node with name " + nullableDummyContainerName +
                             "." + e.getMessage());
@@ -177,7 +177,7 @@ public final class InstanceConfig {
         recognisedChildren.addAll(typeAndNameElements);
         try {
             moduleElement.checkUnrecognisedElements(recognisedChildren);
-        } catch (DocumentedException e) {
+        } catch (final DocumentedException e) {
             throw new DocumentedException("Error reading module " + typeElement.getTextContent() + " : " +
                     nameElement.getTextContent() + " - " +
                     e.getMessage(), e.getErrorType(), e.getErrorTag(),e.getErrorSeverity(),e.getErrorInfo());
@@ -193,8 +193,8 @@ public final class InstanceConfig {
         return instanceConfigElementResolved;
     }
 
-    private List<XmlElement> getConfigNodes(XmlElement moduleElement, String moduleNamespace, String name,
-            List<XmlElement> recognisedChildren, List<XmlElement> typeAndName) throws DocumentedException {
+    private List<XmlElement> getConfigNodes(final XmlElement moduleElement, final String moduleNamespace, final String name,
+            final List<XmlElement> recognisedChildren, final List<XmlElement> typeAndName) throws DocumentedException {
         List<XmlElement> foundConfigNodes = moduleElement.getChildElementsWithinNamespace(name, moduleNamespace);
         if (foundConfigNodes.isEmpty()) {
             LOG.debug("No config nodes {}:{} found in {}", moduleNamespace, name, moduleElement);
@@ -225,7 +225,7 @@ public final class InstanceConfig {
         return foundConfigNodes;
     }
 
-    private static Map<String, AttributeIfc> reverseMap(Map<String, AttributeIfc> yangNameToAttr) {
+    private static Map<String, AttributeIfc> reverseMap(final Map<String, AttributeIfc> yangNameToAttr) {
         Map<String, AttributeIfc> reversednameToAtr = Maps.newHashMap();
 
         for (Entry<String, AttributeIfc> entry : yangNameToAttr.entrySet()) {
index a17c96c48af71e0edfe2157c80429a15b459a289..76cf9dbf2a568b057032292ab72d3c90b235b176 100644 (file)
@@ -24,20 +24,20 @@ public class InstanceConfigElementResolved {
     private final EditStrategyType editStrategy;
     private final Map<String, AttributeConfigElement> configuration;
 
-    public InstanceConfigElementResolved(String currentStrategy, Map<String, AttributeConfigElement> configuration,
-                                         EditStrategyType defaultStrategy)
+    public InstanceConfigElementResolved(final String currentStrategy, final Map<String, AttributeConfigElement> configuration,
+                                         final EditStrategyType defaultStrategy)
             throws DocumentedException {
         this.editStrategy = parseStrategy(currentStrategy, defaultStrategy);
         this.configuration = configuration;
     }
 
-    public InstanceConfigElementResolved(Map<String, AttributeConfigElement> configuration, EditStrategyType defaultStrategy) {
+    public InstanceConfigElementResolved(final Map<String, AttributeConfigElement> configuration, final EditStrategyType defaultStrategy) {
         editStrategy = defaultStrategy;
         this.configuration = configuration;
     }
 
 
-    static EditStrategyType parseStrategy(String currentStrategy, EditStrategyType defaultStrategy) throws OperationNotPermittedException {
+    static EditStrategyType parseStrategy(final String currentStrategy, final EditStrategyType defaultStrategy) throws OperationNotPermittedException {
         EditStrategyType parsedStrategy = EditStrategyType.valueOf(currentStrategy);
         EditStrategyType.compareParsedStrategyToDefaultEnforcing(parsedStrategy,defaultStrategy);
         return parsedStrategy;
index 1b0aaa2668230db81d328069ab876fce3eb2adb5..90108ce72da6bfeab7504b31fdaeb0d0154202ed 100644 (file)
@@ -28,12 +28,12 @@ public class ModuleConfig {
     private final String moduleName;
     private final InstanceConfig instanceConfig;
 
-    public ModuleConfig(String moduleName, InstanceConfig mbeanMapping) {
+    public ModuleConfig(final String moduleName, final InstanceConfig mbeanMapping) {
         this.moduleName = moduleName;
         this.instanceConfig = mbeanMapping;
     }
 
-    public Element toXml(ObjectName instanceON, Document document, String namespace, final EnumResolver enumResolver) {
+    public Element toXml(final ObjectName instanceON, final Document document, final String namespace, final EnumResolver enumResolver) {
         final Optional<String> configNs =
                 Optional.of(XmlMappingConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG);
         Element root = XmlUtil.createElement(document, XmlMappingConstants.MODULE_KEY, configNs);
@@ -55,8 +55,8 @@ public class ModuleConfig {
         return root;
     }
 
-    public ModuleElementResolved fromXml(XmlElement moduleElement, ServiceRegistryWrapper depTracker, String instanceName,
-                                         String moduleNamespace, EditStrategyType defaultStrategy, Map<String, Map<Date, IdentityMapping>> identityMap, final EnumResolver enumResolver) throws DocumentedException {
+    public ModuleElementResolved fromXml(final XmlElement moduleElement, final ServiceRegistryWrapper depTracker, final String instanceName,
+                                         final String moduleNamespace, final EditStrategyType defaultStrategy, final Map<String, Map<Date, IdentityMapping>> identityMap, final EnumResolver enumResolver) throws DocumentedException {
 
         InstanceConfigElementResolved ice = instanceConfig.fromXml(moduleElement, depTracker, moduleNamespace, defaultStrategy, identityMap, enumResolver);
         return new ModuleElementResolved(instanceName, ice);
index 6dae445ad5f4bd45f79c3e50566a55d4221355b2..15f2b380d35ae7a31a83ea513d9e685d402bcf31 100644 (file)
@@ -25,7 +25,7 @@ public class ModuleElementDefinition {
     private final EditStrategyType editStrategy;
     private static final Logger LOG = LoggerFactory.getLogger(ModuleElementDefinition.class);
 
-    public ModuleElementDefinition(String instanceName, String currentStrategy, EditStrategyType defaultStrategy) {
+    public ModuleElementDefinition(final String instanceName, final String currentStrategy, final EditStrategyType defaultStrategy) {
         this.instanceName = instanceName;
         if (currentStrategy == null || currentStrategy.isEmpty()) {
             this.editStrategy = defaultStrategy;
@@ -33,7 +33,7 @@ public class ModuleElementDefinition {
             EditStrategyType _edStrategy = null;
             try {
                 _edStrategy = InstanceConfigElementResolved.parseStrategy(currentStrategy, defaultStrategy);
-            } catch (OperationNotPermittedException e) {
+            } catch (final OperationNotPermittedException e) {
                 _edStrategy = defaultStrategy;
                 LOG.warn("Operation not permitted on current strategy {} while default strategy is {}. Element definition strategy set to default.",
                         currentStrategy,
index 9939bb0cd73aaa466c71c0f635962b947d0f43aa..44418eb9817ea5a309e35e3b9fa2ca12064af026 100644 (file)
@@ -13,7 +13,7 @@ public class ModuleElementResolved {
     private final String instanceName;
     private final InstanceConfigElementResolved instanceConfigElementResolved;
 
-    public ModuleElementResolved(String instanceName, InstanceConfigElementResolved instanceConfigElementResolved) {
+    public ModuleElementResolved(final String instanceName, final InstanceConfigElementResolved instanceConfigElementResolved) {
         this.instanceName = instanceName;
         this.instanceConfigElementResolved = instanceConfigElementResolved;
     }
index 054c064a361a5e14e2f81b58d03853649501196b..b9e5f0f5b56005eeb29f34411ac0276c314f3b5a 100644 (file)
@@ -21,11 +21,11 @@ public class ServiceRegistryWrapper {
 
     private final ServiceReferenceReadableRegistry configServiceRefRegistry;
 
-    public ServiceRegistryWrapper(ServiceReferenceReadableRegistry configServiceRefRegistry) {
+    public ServiceRegistryWrapper(final ServiceReferenceReadableRegistry configServiceRefRegistry) {
         this.configServiceRefRegistry = configServiceRefRegistry;
     }
 
-    public ObjectName getByServiceAndRefName(String namespace, String serviceType, String refName) {
+    public ObjectName getByServiceAndRefName(final String namespace, final String serviceType, final String refName) {
         Map<String, Map<String, Map<String, String>>> mappedServices = getMappedServices();
         Map<String, Map<String, String>> serviceNameToRefNameToInstance = mappedServices.get(namespace);
 
@@ -56,7 +56,7 @@ public class ServiceRegistryWrapper {
             */
             return ObjectNameUtil.withoutTransactionName(
                     configServiceRefRegistry.getServiceReference(qNameOfService, refName));
-        } catch (InstanceNotFoundException e) {
+        } catch (final InstanceNotFoundException e) {
             throw new IllegalArgumentException("No serviceInstance mapped to " + refName
                     + " under service name " + serviceType + " , " + refNameToInstance.keySet(), e);
 
index c2683d44ab68c2a412da3a2169a1e33a09da46cb..4ee1bcaf0b1a7f37ee8d5285924b996a67ef65dd 100644 (file)
@@ -46,7 +46,7 @@ public final class Services {
         return namespaceToServiceNameToRefNameToInstance;
     }
 
-    private static Services resolveServices(Map<String, Map<String, Map<String, String>>> mappedServices) {
+    private static Services resolveServices(final Map<String, Map<String, Map<String, String>>> mappedServices) {
         Services tracker = new Services();
 
         for (Entry<String, Map<String, Map<String, String>>> namespaceEntry : mappedServices.entrySet()) {
@@ -85,7 +85,7 @@ public final class Services {
 
     // TODO support edit strategies on services
 
-    public static Services fromXml(XmlElement xml) throws DocumentedException {
+    public static Services fromXml(final XmlElement xml) throws DocumentedException {
         Map<String, Map<String, Map<String, String>>> retVal = Maps.newHashMap();
 
         List<XmlElement> services = xml.getChildElements(SERVICE_KEY);
@@ -141,7 +141,7 @@ public final class Services {
         return resolveServices(retVal);
     }
 
-    public static Element toXml(ServiceRegistryWrapper serviceRegistryWrapper, Document document) {
+    public static Element toXml(final ServiceRegistryWrapper serviceRegistryWrapper, final Document document) {
         final Optional<String> configNs = Optional.of(XmlMappingConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG);
         Element root = XmlUtil.createElement(document, XmlMappingConstants.SERVICES_KEY, configNs);
 
@@ -183,7 +183,7 @@ public final class Services {
     public static final class ServiceInstance {
         public static final ServiceInstance EMPTY_SERVICE_INSTANCE = new ServiceInstance("", "");
 
-        public ServiceInstance(String moduleName, String instanceName) {
+        public ServiceInstance(final String moduleName, final String instanceName) {
             this.moduleName = moduleName;
             this.instanceName = instanceName;
         }
@@ -210,7 +210,7 @@ public final class Services {
             return serviceName;
         }
 
-        public void setServiceName(String serviceName) {
+        public void setServiceName(final String serviceName) {
             this.serviceName = serviceName;
         }
 
@@ -258,7 +258,7 @@ public final class Services {
         }
 
         @Override
-        public boolean equals(Object obj) {
+        public boolean equals(final Object obj) {
             if (this == obj){
                 return true;
             }
@@ -286,11 +286,11 @@ public final class Services {
             return true;
         }
 
-        public ObjectName getObjectName(String transactionName) {
+        public ObjectName getObjectName(final String transactionName) {
             return ObjectNameUtil.createTransactionModuleON(transactionName, moduleName, instanceName);
         }
 
-        public static ServiceInstance fromObjectName(ObjectName on) {
+        public static ServiceInstance fromObjectName(final ObjectName on) {
             return new ServiceInstance(ObjectNameUtil.getFactoryName(on), ObjectNameUtil.getInstanceName(on));
         }
     }
index 175b3f092784959a06b48e8f14ac649bd50e462d..c513100aea6a73af948112e8a0be5900ad490ce6 100644 (file)
@@ -34,13 +34,13 @@ public final class InstanceRuntimeRpc {
     private final Rpc rpc;
     private final EnumResolver enumResolver;
 
-    public InstanceRuntimeRpc(Rpc rpc, final EnumResolver enumResolver) {
+    public InstanceRuntimeRpc(final Rpc rpc, final EnumResolver enumResolver) {
         this.enumResolver = enumResolver;
         this.yangToAttrConfig = map(rpc.getParameters());
         this.rpc = rpc;
     }
 
-    private Map<String, AttributeIfc> map(List<JavaAttribute> parameters) {
+    private Map<String, AttributeIfc> map(final List<JavaAttribute> parameters) {
         Map<String, AttributeIfc> mapped = Maps.newHashMap();
         for (JavaAttribute javaAttribute : parameters) {
             mapped.put(javaAttribute.getAttributeYangName(), javaAttribute);
@@ -48,7 +48,7 @@ public final class InstanceRuntimeRpc {
         return mapped;
     }
 
-    private void resolveConfiguration(Map<String, AttributeConfigElement> mappedConfig) {
+    private void resolveConfiguration(final Map<String, AttributeConfigElement> mappedConfig) {
 
         // TODO make field, resolvingStrategies can be instantiated only once
         Map<String, AttributeResolvingStrategy<?, ? extends OpenType<?>>> resolvingStrategies = new ObjectResolver(null)
@@ -63,14 +63,14 @@ public final class InstanceRuntimeRpc {
                 configDefEntry.getValue().resolveValue(attributeResolvingStrategy, configDefEntry.getKey());
                 configDefEntry.getValue().setJmxName(
                         yangToAttrConfig.get(configDefEntry.getKey()).getUpperCaseCammelCase());
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new IllegalStateException("Unable to resolve value " + configDefEntry.getValue()
                         + " to attribute " + configDefEntry.getKey(), e);
             }
         }
     }
 
-    public Map<String, AttributeConfigElement> fromXml(XmlElement configRootNode) throws DocumentedException {
+    public Map<String, AttributeConfigElement> fromXml(final XmlElement configRootNode) throws DocumentedException {
         Map<String, AttributeConfigElement> retVal = Maps.newHashMap();
 
         // FIXME add identity map to runtime data
index eebc1ba00164b2c8ba73c68631617d66cb426f18..d742238ba26e01efaa18691360902cf50dc3109c 100644 (file)
@@ -35,7 +35,7 @@ public class TransactionProvider implements AutoCloseable {
     private final List<ObjectName> allOpenedTransactions = new ArrayList<>();
     private static final String NO_TRANSACTION_FOUND_FOR_SESSION = "No transaction found for session ";
 
-    public TransactionProvider(ConfigRegistryClient configRegistryClient, String sessionIdForReporting) {
+    public TransactionProvider(final ConfigRegistryClient configRegistryClient, final String sessionIdForReporting) {
         this.configRegistryClient = configRegistryClient;
         this.sessionIdForReporting = sessionIdForReporting;
     }
@@ -47,7 +47,7 @@ public class TransactionProvider implements AutoCloseable {
                 if (isStillOpenTransaction(tx)) {
                     configRegistryClient.getConfigTransactionClient(tx).abortConfig();
                 }
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 LOG.debug("Ignoring exception while closing transaction {}", tx, e);
             }
         }
@@ -84,7 +84,7 @@ public class TransactionProvider implements AutoCloseable {
         return Optional.of(readTx);
     }
 
-    private boolean isStillOpenTransaction(ObjectName transaction) {
+    private boolean isStillOpenTransaction(final ObjectName transaction) {
         return configRegistryClient.getOpenConfigs().contains(transaction);
     }
 
@@ -144,11 +144,11 @@ public class TransactionProvider implements AutoCloseable {
             allOpenedTransactions.remove(candidateTx);
             candidateTx = null;
             return status;
-        } catch (ValidationException validationException) {
+        } catch (final ValidationException validationException) {
             // no clean up: user can reconfigure and recover this transaction
             LOG.warn("Transaction {} failed on {}", taON, validationException.toString());
             throw validationException;
-        } catch (ConflictingVersionException e) {
+        } catch (final ConflictingVersionException e) {
             LOG.debug("Exception while commit of {}, aborting transaction", taON, e);
             // clean up
             abortTransaction();
@@ -178,7 +178,7 @@ public class TransactionProvider implements AutoCloseable {
         readTx = null;
     }
 
-    public synchronized void abortTestTransaction(ObjectName testTx) {
+    public synchronized void abortTestTransaction(final ObjectName testTx) {
         LOG.debug("Aborting transaction {}", testTx);
         ConfigTransactionClient transactionClient = configRegistryClient.getConfigTransactionClient(testTx);
         allOpenedTransactions.remove(testTx);
@@ -193,19 +193,19 @@ public class TransactionProvider implements AutoCloseable {
         transactionClient.validateConfig();
     }
 
-    public void validateTestTransaction(ObjectName taON) throws ValidationException {
+    public void validateTestTransaction(final ObjectName taON) throws ValidationException {
         ConfigTransactionClient transactionClient = configRegistryClient.getConfigTransactionClient(taON);
         transactionClient.validateConfig();
     }
 
-    public void wipeTestTransaction(ObjectName taON) {
+    public void wipeTestTransaction(final ObjectName taON) {
         wipeInternal(taON, true);
     }
 
     /**
      * Wiping means removing all module instances keeping the transaction open + service references.
      */
-    synchronized void wipeInternal(ObjectName taON, boolean isTest) {
+    synchronized void wipeInternal(final ObjectName taON, final boolean isTest) {
         ConfigTransactionClient transactionClient = configRegistryClient.getConfigTransactionClient(taON);
 
         Set<ObjectName> lookupConfigBeans = transactionClient.lookupConfigBeans();
@@ -213,7 +213,7 @@ public class TransactionProvider implements AutoCloseable {
         for (ObjectName instance : lookupConfigBeans) {
             try {
                 transactionClient.destroyModule(instance);
-            } catch (InstanceNotFoundException e) {
+            } catch (final InstanceNotFoundException e) {
                 if (isTest){
                     LOG.debug("Unable to clean configuration in transactiom {}", taON, e);
                 } else {