config-persister-impl: final parameters 67/56967/2
authorStephen Kitt <skitt@redhat.com>
Fri, 12 May 2017 13:13:20 +0000 (15:13 +0200)
committerTom Pantelis <tompantelis@gmail.com>
Mon, 15 May 2017 11:51:20 +0000 (11:51 +0000)
This automatically-generated patch flags all appropriate parameters as
final (including caught exceptions).

Change-Id: Ib950fb9560113b780898767f03c58edfa022c568
Signed-off-by: Stephen Kitt <skitt@redhat.com>
opendaylight/config/config-persister-impl/src/main/java/org/opendaylight/controller/config/persist/impl/CapabilityStrippingConfigSnapshotHolder.java
opendaylight/config/config-persister-impl/src/main/java/org/opendaylight/controller/config/persist/impl/ConfigPusherImpl.java
opendaylight/config/config-persister-impl/src/main/java/org/opendaylight/controller/config/persist/impl/NoOpStorageAdapter.java
opendaylight/config/config-persister-impl/src/main/java/org/opendaylight/controller/config/persist/impl/PersisterAggregator.java
opendaylight/config/config-persister-impl/src/main/java/org/opendaylight/controller/config/persist/impl/PropertiesProviderAdapterImpl.java
opendaylight/config/config-persister-impl/src/main/java/org/opendaylight/controller/config/persist/impl/osgi/ConfigPersisterActivator.java
opendaylight/config/config-persister-impl/src/main/java/org/opendaylight/controller/config/persist/impl/osgi/PropertiesProviderBaseImpl.java
opendaylight/config/config-persister-impl/src/test/java/org/opendaylight/controller/config/persist/impl/CapabilityStrippingConfigSnapshotHolderTest.java
opendaylight/config/config-persister-impl/src/test/java/org/opendaylight/controller/config/persist/impl/ConfigPusherImplTest.java
opendaylight/config/config-persister-impl/src/test/java/org/opendaylight/controller/config/persist/impl/DummyAdapter.java
opendaylight/config/config-persister-impl/src/test/java/org/opendaylight/controller/config/persist/impl/PersisterAggregatorTest.java

index 2794822..3d916f6 100644 (file)
@@ -33,7 +33,7 @@ public class CapabilityStrippingConfigSnapshotHolder implements ConfigSnapshotHo
     private final String configSnapshot;
     private final StripCapabilitiesResult stripCapabilitiesResult;
 
-    public CapabilityStrippingConfigSnapshotHolder(Element snapshot, Set<String> capabilities) {
+    public CapabilityStrippingConfigSnapshotHolder(final Element snapshot, final Set<String> capabilities) {
         final XmlElement configElement = XmlElement.fromDomElement(snapshot);
         configSnapshot = XmlUtil.toString(configElement.getDomElement());
         stripCapabilitiesResult = stripCapabilities(configElement, capabilities);
@@ -43,7 +43,7 @@ public class CapabilityStrippingConfigSnapshotHolder implements ConfigSnapshotHo
         private final SortedSet<String> requiredCapabilities;
         private final SortedSet<String> obsoleteCapabilities;
 
-        private StripCapabilitiesResult(SortedSet<String> requiredCapabilities, SortedSet<String> obsoleteCapabilities) {
+        private StripCapabilitiesResult(final SortedSet<String> requiredCapabilities, final SortedSet<String> obsoleteCapabilities) {
             this.requiredCapabilities = Collections.unmodifiableSortedSet(requiredCapabilities);
             this.obsoleteCapabilities = Collections.unmodifiableSortedSet(obsoleteCapabilities);
         }
@@ -51,7 +51,7 @@ public class CapabilityStrippingConfigSnapshotHolder implements ConfigSnapshotHo
 
 
     @VisibleForTesting
-    static StripCapabilitiesResult stripCapabilities(XmlElement configElement, Set<String> allCapabilitiesFromHello) {
+    static StripCapabilitiesResult stripCapabilities(final XmlElement configElement, final Set<String> allCapabilitiesFromHello) {
         // collect all namespaces
         Set<String> foundNamespacesInXML = getNamespaces(configElement);
         LOG.trace("All capabilities {}\nFound namespaces in XML {}", allCapabilitiesFromHello, foundNamespacesInXML);
@@ -74,7 +74,7 @@ public class CapabilityStrippingConfigSnapshotHolder implements ConfigSnapshotHo
         return new StripCapabilitiesResult(requiredCapabilities, obsoleteCapabilities);
     }
 
-    static Set<String> getNamespaces(XmlElement element){
+    static Set<String> getNamespaces(final XmlElement element){
         Set<String> result = new HashSet<>();
         for (Entry<String,Attr> attribute : element.getAttributes().entrySet()) {
             if  (attribute.getKey().startsWith("xmlns")){
index 6fcc7dc..ae4fb09 100644 (file)
@@ -58,21 +58,21 @@ public class ConfigPusherImpl implements ConfigPusher {
     private final ConfigSubsystemFacadeFactory facade;
     private ConfigPersisterNotificationHandler jmxNotificationHandler;
 
-    public ConfigPusherImpl(ConfigSubsystemFacadeFactory facade, long maxWaitForCapabilitiesMillis,
-                        long conflictingVersionTimeoutMillis) {
+    public ConfigPusherImpl(final ConfigSubsystemFacadeFactory facade, final long maxWaitForCapabilitiesMillis,
+                        final long conflictingVersionTimeoutMillis) {
         this.maxWaitForCapabilitiesMillis = maxWaitForCapabilitiesMillis;
         this.conflictingVersionTimeoutMillis = conflictingVersionTimeoutMillis;
         this.facade = facade;
     }
 
-    public void process(List<AutoCloseable> autoCloseables, MBeanServerConnection platformMBeanServer,
-            Persister persisterAggregator, boolean propagateExceptions) throws InterruptedException {
+    public void process(final List<AutoCloseable> autoCloseables, final MBeanServerConnection platformMBeanServer,
+            final Persister persisterAggregator, final boolean propagateExceptions) throws InterruptedException {
         while(processSingle(autoCloseables, platformMBeanServer, persisterAggregator, propagateExceptions)) {
         }
     }
 
     boolean processSingle(final List<AutoCloseable> autoCloseables, final MBeanServerConnection platformMBeanServer,
-            final Persister persisterAggregator, boolean propagateExceptions) throws InterruptedException {
+            final Persister persisterAggregator, final boolean propagateExceptions) throws InterruptedException {
         final List<? extends ConfigSnapshotHolder> configs = queue.take();
         try {
             internalPushConfigs(configs);
@@ -87,7 +87,7 @@ public class ConfigPusherImpl implements ConfigPusher {
             }
 
             LOG.debug("ConfigPusher has pushed configs {}", configs);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             // Exceptions are logged to error downstream
             LOG.debug("Failed to push some of configs: {}", configs, e);
 
@@ -106,12 +106,12 @@ public class ConfigPusherImpl implements ConfigPusher {
     }
 
     @Override
-    public void pushConfigs(List<? extends ConfigSnapshotHolder> configs) throws InterruptedException {
+    public void pushConfigs(final List<? extends ConfigSnapshotHolder> configs) throws InterruptedException {
         LOG.debug("Requested to push configs {}", configs);
         this.queue.put(configs);
     }
 
-    private LinkedHashMap<? extends ConfigSnapshotHolder, Boolean> internalPushConfigs(List<? extends ConfigSnapshotHolder> configs)
+    private LinkedHashMap<? extends ConfigSnapshotHolder, Boolean> internalPushConfigs(final List<? extends ConfigSnapshotHolder> configs)
             throws DocumentedException {
         LOG.debug("Last config snapshots to be pushed to netconf: {}", configs);
         LinkedHashMap<ConfigSnapshotHolder, Boolean> result = new LinkedHashMap<>();
@@ -122,11 +122,11 @@ public class ConfigPusherImpl implements ConfigPusher {
                 boolean pushResult = false;
                 try {
                     pushResult = pushConfigWithConflictingVersionRetries(configSnapshotHolder);
-                } catch (ConfigSnapshotFailureException e) {
+                } catch (final ConfigSnapshotFailureException e) {
                     LOG.error("Failed to apply configuration snapshot: {}. Config snapshot is not semantically correct and will be IGNORED. " +
                             "for detailed information see enclosed exception.", e.getConfigIdForReporting(), e);
                     throw new IllegalStateException("Failed to apply configuration snapshot " + e.getConfigIdForReporting(), e);
-                }  catch (Exception e) {
+                }  catch (final Exception e) {
                     String msg = String.format("Failed to apply configuration snapshot: %s", configSnapshotHolder);
                     LOG.error(msg, e);
                     throw new IllegalStateException(msg, e);
@@ -140,7 +140,7 @@ public class ConfigPusherImpl implements ConfigPusher {
         return result;
     }
 
-    private synchronized boolean pushConfigWithConflictingVersionRetries(ConfigSnapshotHolder configSnapshotHolder) throws ConfigSnapshotFailureException {
+    private synchronized boolean pushConfigWithConflictingVersionRetries(final ConfigSnapshotHolder configSnapshotHolder) throws ConfigSnapshotFailureException {
         ConflictingVersionException lastException;
         Stopwatch stopwatch = Stopwatch.createUnstarted();
         do {
@@ -157,7 +157,7 @@ public class ConfigPusherImpl implements ConfigPusher {
                     stopwatch.start();
                 }
                 return pushConfig(configSnapshotHolder);
-            } catch (ConflictingVersionException e) {
+            } catch (final ConflictingVersionException e) {
                 lastException = e;
                 LOG.info("Conflicting version detected, will retry after timeout");
                 sleep();
@@ -167,7 +167,7 @@ public class ConfigPusherImpl implements ConfigPusher {
                 lastException);
     }
 
-    private void waitForCapabilities(Set<String> expectedCapabilities, String idForReporting) {
+    private void waitForCapabilities(final Set<String> expectedCapabilities, final String idForReporting) {
         Stopwatch stopwatch = Stopwatch.createStarted();
         ConfigPusherException lastException;
         do {
@@ -184,7 +184,7 @@ public class ConfigPusherImpl implements ConfigPusher {
                     throw new NotEnoughCapabilitiesException(
                             "Not enough capabilities for " + idForReporting + ". Expected but not found: " + notFoundCapabilities, notFoundCapabilities);
                 }
-            } catch (ConfigPusherException e) {
+            } catch (final ConfigPusherException e) {
                 LOG.debug("Not enough capabilities: {}", e.toString());
                 lastException = e;
                 sleep();
@@ -204,7 +204,7 @@ public class ConfigPusherImpl implements ConfigPusher {
                 + ((NotEnoughCapabilitiesException) lastException).getMissingCaps(), lastException);
     }
 
-    private static Set<String> computeNotFoundCapabilities(Set<String> expectedCapabilities, Set<Capability> currentCapabilities) {
+    private static Set<String> computeNotFoundCapabilities(final Set<String> expectedCapabilities, final Set<Capability> currentCapabilities) {
         Collection<String> actual = transformCapabilities(currentCapabilities);
         Set<String> allNotFound = new HashSet<>(expectedCapabilities);
         allNotFound.removeAll(actual);
@@ -235,7 +235,7 @@ public class ConfigPusherImpl implements ConfigPusher {
         private static final long serialVersionUID = 1L;
         private final Set<String> missingCaps;
 
-        NotEnoughCapabilitiesException(String message, Set<String> missingCaps) {
+        NotEnoughCapabilitiesException(final String message, final Set<String> missingCaps) {
             super(message);
             this.missingCaps = missingCaps;
         }
@@ -262,13 +262,13 @@ public class ConfigPusherImpl implements ConfigPusher {
     private void sleep() {
         try {
             Thread.sleep(100);
-        } catch (InterruptedException e) {
+        } catch (final InterruptedException e) {
             Thread.currentThread().interrupt();
             throw new IllegalStateException(e);
         }
     }
 
-    private synchronized boolean pushConfig(ConfigSnapshotHolder configSnapshotHolder) throws ConfigSnapshotFailureException, ConflictingVersionException {
+    private synchronized boolean pushConfig(final ConfigSnapshotHolder configSnapshotHolder) throws ConfigSnapshotFailureException, ConflictingVersionException {
         Element xmlToBePersisted;
         try {
             xmlToBePersisted = XmlUtil.readXmlToElement(configSnapshotHolder.getConfigSnapshot());
@@ -299,7 +299,7 @@ public class ConfigPusherImpl implements ConfigPusher {
         return true;
     }
 
-    private void executeWithMissingModuleFactoryRetries(ConfigSubsystemFacade facade, ConfigExecution configExecution)
+    private void executeWithMissingModuleFactoryRetries(final ConfigSubsystemFacade facade, final ConfigExecution configExecution)
             throws DocumentedException, ValidationException, ModuleFactoryNotFoundException {
         Stopwatch stopwatch = Stopwatch.createStarted();
         ModuleFactoryNotFoundException lastException = null;
@@ -307,7 +307,7 @@ public class ConfigPusherImpl implements ConfigPusher {
             try {
                 facade.executeConfigExecution(configExecution);
                 return;
-            } catch (ModuleFactoryNotFoundException e) {
+            } catch (final ModuleFactoryNotFoundException e) {
                 LOG.debug("{} - will retry after timeout", e.toString());
                 lastException = e;
                 sleep();
@@ -317,7 +317,7 @@ public class ConfigPusherImpl implements ConfigPusher {
         throw lastException;
     }
 
-    private ConfigExecution createConfigExecution(Element xmlToBePersisted, final ConfigSubsystemFacade currentFacade) throws DocumentedException {
+    private ConfigExecution createConfigExecution(final Element xmlToBePersisted, final ConfigSubsystemFacade currentFacade) throws DocumentedException {
         final Config configMapping = currentFacade.getConfigMapping();
         return currentFacade.getConfigExecution(configMapping, xmlToBePersisted);
     }
index a558601..c8f48d7 100644 (file)
@@ -22,13 +22,13 @@ public class NoOpStorageAdapter implements StorageAdapter, Persister {
     private static final Logger LOG = LoggerFactory.getLogger(NoOpStorageAdapter.class);
 
     @Override
-    public Persister instantiate(PropertiesProvider propertiesProvider) {
+    public Persister instantiate(final PropertiesProvider propertiesProvider) {
         LOG.debug("instantiate called with {}", propertiesProvider);
         return this;
     }
 
     @Override
-    public void persistConfig(ConfigSnapshotHolder holder) throws IOException {
+    public void persistConfig(final ConfigSnapshotHolder holder) throws IOException {
         LOG.debug("persistConfig called with {}", holder);
     }
 
index ebe9982..8926b4c 100644 (file)
@@ -63,7 +63,7 @@ public final class PersisterAggregator implements Persister {
         private final Persister storage;
         private final boolean readOnly;
 
-        public PersisterWithConfiguration(Persister storage, boolean readOnly) {
+        public PersisterWithConfiguration(final Persister storage, final boolean readOnly) {
             this.storage = storage;
             this.readOnly = readOnly;
         }
@@ -92,7 +92,7 @@ public final class PersisterAggregator implements Persister {
      */
     private final List<PersisterWithConfiguration> persisterWithConfigurations;
 
-    public PersisterAggregator(List<PersisterWithConfiguration> persisterWithConfigurations) {
+    public PersisterAggregator(final List<PersisterWithConfiguration> persisterWithConfigurations) {
         this.persisterWithConfigurations = persisterWithConfigurations;
     }
 
@@ -126,7 +126,7 @@ public final class PersisterAggregator implements Persister {
         }
     }
 
-    public static PersisterAggregator createFromProperties(PropertiesProvider propertiesProvider) {
+    public static PersisterAggregator createFromProperties(final PropertiesProvider propertiesProvider) {
         List<PersisterWithConfiguration> persisterWithConfigurations = new ArrayList<>();
         String prefixes = propertiesProvider.getProperty("active");
         if (prefixes!=null && !prefixes.isEmpty()) {
@@ -140,7 +140,7 @@ public final class PersisterAggregator implements Persister {
     }
 
     @Override
-    public void persistConfig(ConfigSnapshotHolder holder) throws IOException {
+    public void persistConfig(final ConfigSnapshotHolder holder) throws IOException {
         for (PersisterWithConfiguration persisterWithConfiguration: persisterWithConfigurations){
             if (!persisterWithConfiguration.readOnly){
                 LOG.debug("Calling {}.persistConfig", persisterWithConfiguration.getStorage());
@@ -161,7 +161,7 @@ public final class PersisterAggregator implements Persister {
             List<ConfigSnapshotHolder> configs = null;
             try {
                 configs = persisterWithConfiguration.storage.loadLastConfigs();
-            } catch (IOException e) {
+            } catch (final IOException e) {
                 throw new RuntimeException("Error while calling loadLastConfig on " +  persisterWithConfiguration, e);
             }
             if (!configs.isEmpty()) {
@@ -185,7 +185,7 @@ public final class PersisterAggregator implements Persister {
         for (PersisterWithConfiguration persisterWithConfiguration: persisterWithConfigurations){
             try{
                 persisterWithConfiguration.storage.close();
-            }catch(RuntimeException e) {
+            }catch(final RuntimeException e) {
                 LOG.error("Error while closing {}", persisterWithConfiguration.storage, e);
                 if (lastException == null){
                     lastException = e;
index 2ac059b..acef56f 100644 (file)
@@ -13,13 +13,13 @@ public class PropertiesProviderAdapterImpl implements PropertiesProvider {
     private final PropertiesProvider inner;
     private final String index;
 
-    public PropertiesProviderAdapterImpl(PropertiesProvider inner, String index) {
+    public PropertiesProviderAdapterImpl(final PropertiesProvider inner, final String index) {
         this.inner = inner;
         this.index = index;
     }
 
     @Override
-    public String getProperty(String key) {
+    public String getProperty(final String key) {
         String fullKey = getFullKeyForReporting(key);
         return inner.getPropertyWithoutPrefix(fullKey);
     }
@@ -29,13 +29,13 @@ public class PropertiesProviderAdapterImpl implements PropertiesProvider {
     }
 
     @Override
-    public String getPropertyWithoutPrefix(String fullKey) {
+    public String getPropertyWithoutPrefix(final String fullKey) {
         return inner.getPropertyWithoutPrefix(fullKey);
     }
 
 
     @Override
-    public String getFullKeyForReporting(String key) {
+    public String getFullKeyForReporting(final String key) {
         return getPrefix()  + "." + key;
     }
 }
index c67522e..412309b 100644 (file)
@@ -65,7 +65,7 @@ public class ConfigPersisterActivator implements BundleActivator {
         ServiceTrackerCustomizer<ConfigSubsystemFacadeFactory, ConfigSubsystemFacadeFactory> schemaServiceTrackerCustomizer = new ServiceTrackerCustomizer<ConfigSubsystemFacadeFactory, ConfigSubsystemFacadeFactory>() {
 
             @Override
-            public ConfigSubsystemFacadeFactory addingService(ServiceReference<ConfigSubsystemFacadeFactory> reference) {
+            public ConfigSubsystemFacadeFactory addingService(final ServiceReference<ConfigSubsystemFacadeFactory> reference) {
                 LOG.debug("Got addingService(SchemaContextProvider) event");
                 // Yang store service should not be registered multiple times
                 ConfigSubsystemFacadeFactory configSubsystemFacadeFactory = reference.getBundle().getBundleContext().getService(reference);
@@ -74,12 +74,12 @@ public class ConfigPersisterActivator implements BundleActivator {
             }
 
             @Override
-            public void modifiedService(ServiceReference<ConfigSubsystemFacadeFactory> reference, ConfigSubsystemFacadeFactory service) {
+            public void modifiedService(final ServiceReference<ConfigSubsystemFacadeFactory> reference, final ConfigSubsystemFacadeFactory service) {
                 LOG.warn("Config manager facade was modified unexpectedly");
             }
 
             @Override
-            public void removedService(ServiceReference<ConfigSubsystemFacadeFactory> reference, ConfigSubsystemFacadeFactory service) {
+            public void removedService(final ServiceReference<ConfigSubsystemFacadeFactory> reference, final ConfigSubsystemFacadeFactory service) {
                 LOG.warn("Config manager facade was removed unexpectedly");
             }
         };
@@ -89,18 +89,18 @@ public class ConfigPersisterActivator implements BundleActivator {
         schemaContextProviderServiceTracker.open();
     }
 
-    private long getConflictingVersionTimeoutMillis(PropertiesProviderBaseImpl propertiesProvider) {
+    private long getConflictingVersionTimeoutMillis(final PropertiesProviderBaseImpl propertiesProvider) {
         String timeoutProperty = propertiesProvider.getProperty(CONFLICTING_VERSION_TIMEOUT_MILLIS_PROPERTY);
         return timeoutProperty == null ? CONFLICTING_VERSION_TIMEOUT_MILLIS_DEFAULT : Long.valueOf(timeoutProperty);
     }
 
-    private long getMaxWaitForCapabilitiesMillis(PropertiesProviderBaseImpl propertiesProvider) {
+    private long getMaxWaitForCapabilitiesMillis(final PropertiesProviderBaseImpl propertiesProvider) {
         String timeoutProperty = propertiesProvider.getProperty(MAX_WAIT_FOR_CAPABILITIES_MILLIS_PROPERTY);
         return timeoutProperty == null ? MAX_WAIT_FOR_CAPABILITIES_MILLIS_DEFAULT : Long.valueOf(timeoutProperty);
     }
 
     @Override
-    public void stop(BundleContext context) throws Exception {
+    public void stop(final BundleContext context) throws Exception {
         synchronized(autoCloseables) {
             CloseableUtil.closeAll(autoCloseables);
             autoCloseables.clear();
@@ -132,7 +132,7 @@ public class ConfigPersisterActivator implements BundleActivator {
                         } else {
                             LOG.warn("Unable to process configs as BundleContext is null");
                         }
-                    } catch (InterruptedException e) {
+                    } catch (final InterruptedException e) {
                         LOG.info("ConfigPusher thread stopped");
                     }
                     LOG.info("Configuration Persister initialization completed.");
index 5ad31e8..5a5f7e7 100644 (file)
@@ -17,17 +17,17 @@ public class PropertiesProviderBaseImpl implements PropertiesProvider {
     private static final Logger LOG = LoggerFactory.getLogger(PropertiesProviderBaseImpl.class);
     private final BundleContext bundleContext;
 
-    public PropertiesProviderBaseImpl(BundleContext bundleContext) {
+    public PropertiesProviderBaseImpl(final BundleContext bundleContext) {
         this.bundleContext = bundleContext;
     }
 
     @Override
-    public String getProperty(String key) {
+    public String getProperty(final String key) {
         String fullKey = getFullKeyForReporting(key);
         return getPropertyWithoutPrefix(fullKey);
     }
 
-    public String getPropertyWithoutPrefix(String fullKey){
+    public String getPropertyWithoutPrefix(final String fullKey){
         LOG.trace("Full key {}", fullKey);
         return bundleContext.getProperty(fullKey);
     }
@@ -37,7 +37,7 @@ public class PropertiesProviderBaseImpl implements PropertiesProvider {
     }
 
     @Override
-    public String getFullKeyForReporting(String key) {
+    public String getFullKeyForReporting(final String key) {
         return getPrefix() + "." + key;
     }
 }
index 970805e..2a20939 100644 (file)
@@ -36,11 +36,11 @@ public class CapabilityStrippingConfigSnapshotHolderTest {
         assertEquals(obsoleteCapabilities, tested.getObsoleteCapabilities());
     }
 
-    private Set<String> readLines(String fileName) throws IOException {
+    private Set<String> readLines(final String fileName) throws IOException {
         return new HashSet<>(Resources.readLines(getClass().getResource(fileName), StandardCharsets.UTF_8));
     }
 
-    private String readToString(String fileName) throws IOException {
+    private String readToString(final String fileName) throws IOException {
         return Resources.toString(getClass().getResource(fileName), StandardCharsets.UTF_8);
     }
 
index 8bfb3d7..bfb606e 100644 (file)
@@ -93,7 +93,7 @@ public class ConfigPusherImplTest {
         try {
             configPusher.process(Lists.<AutoCloseable>newArrayList(), ManagementFactory.getPlatformMBeanServer(),
                     mockedAggregator, true);
-        } catch(IllegalStateException e) {
+        } catch(final IllegalStateException e) {
             Throwable cause = Throwables.getRootCause(e);
             assertTrue(cause instanceof ConfigPusherImpl.NotEnoughCapabilitiesException);
             final Set<String> missingCaps = ((ConfigPusherImpl.NotEnoughCapabilitiesException) cause).getMissingCaps();
@@ -145,7 +145,7 @@ public class ConfigPusherImplTest {
         configPusher.pushConfigs(Collections.singletonList(mockedConfigSnapshot));
         try {
             configPusher.processSingle(Lists.<AutoCloseable>newArrayList(), mBeanServer, mockedAggregator, true);
-        } catch (IllegalStateException e) {
+        } catch (final IllegalStateException e) {
             Throwable cause = Throwables.getRootCause(e);
             assertTrue(cause instanceof ConflictingVersionException);
             return;
index a111290..9984b14 100644 (file)
@@ -20,7 +20,7 @@ public class DummyAdapter implements StorageAdapter, Persister {
     static int persist = 0;
 
     @Override
-    public void persistConfig(ConfigSnapshotHolder holder) throws IOException {
+    public void persistConfig(final ConfigSnapshotHolder holder) throws IOException {
         persist++;
     }
 
@@ -35,7 +35,7 @@ public class DummyAdapter implements StorageAdapter, Persister {
     static int props = 0;
 
     @Override
-    public Persister instantiate(PropertiesProvider propertiesProvider) {
+    public Persister instantiate(final PropertiesProvider propertiesProvider) {
         props++;
         return this;
     }
index cf183b8..f176267 100644 (file)
@@ -38,33 +38,33 @@ public class PersisterAggregatorTest {
 
         private final Properties prop;
 
-        public TestingPropertiesProvider(Properties prop) {
+        public TestingPropertiesProvider(final Properties prop) {
             super(null);
             this.prop = prop;
         }
 
-        public static TestingPropertiesProvider loadFile(String fileName) {
+        public static TestingPropertiesProvider loadFile(final String fileName) {
             Properties prop = new Properties();
             try {
                 prop.load(TestingPropertiesProvider.class.getClassLoader().getResourceAsStream(fileName));
-            } catch (IOException e) {
+            } catch (final IOException e) {
                 throw new RuntimeException(e);
             }
             return new TestingPropertiesProvider(prop);
         }
 
         @Override
-        public String getFullKeyForReporting(String key) {
+        public String getFullKeyForReporting(final String key) {
             return ConfigPersisterActivator.NETCONF_CONFIG_PERSISTER + "." + key;
         }
 
         @Override
-        public String getProperty(String key) {
+        public String getProperty(final String key) {
             return prop.getProperty(getFullKeyForReporting(key));
         }
 
         @Override
-        public String getPropertyWithoutPrefix(String fullKey){
+        public String getPropertyWithoutPrefix(final String fullKey){
             return prop.getProperty(fullKey);
         }
     }
@@ -127,20 +127,20 @@ public class PersisterAggregatorTest {
         try {
             PersisterAggregator.createFromProperties(TestingPropertiesProvider.loadFile("test3.properties"));
             fail();
-        } catch (RuntimeException e) {
+        } catch (final RuntimeException e) {
             assertThat(
                     e.getMessage(),
                     containsString("numberOfBackups property should be either set to positive value, or ommited. Can not be set to 0."));
         }
     }
 
-    private ConfigSnapshotHolder mockHolder(String name){
+    private ConfigSnapshotHolder mockHolder(final String name){
         ConfigSnapshotHolder result = mock(ConfigSnapshotHolder.class);
         doReturn("mock:" + name).when(result).toString();
         return result;
     }
 
-    private Persister mockPersister(String name){
+    private Persister mockPersister(final String name){
         Persister result = mock(Persister.class);
         doReturn("mock:" + name).when(result).toString();
         doNothing().when(result).close();

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.