Bug 460 - Fix warning throughout netconf subsystem
[controller.git] / opendaylight / netconf / config-persister-impl / src / main / java / org / opendaylight / controller / netconf / persist / impl / PersisterAggregator.java
index 31a4f080368515c075872173e9ba066c830f5e0e..a0e7974b942951c521305ae4726baa4a5a74d74a 100644 (file)
@@ -9,20 +9,19 @@
 package org.opendaylight.controller.netconf.persist.impl;
 
 import com.google.common.annotations.VisibleForTesting;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.ListIterator;
 import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder;
 import org.opendaylight.controller.config.persist.api.Persister;
+import org.opendaylight.controller.config.persist.api.PropertiesProvider;
 import org.opendaylight.controller.config.persist.api.StorageAdapter;
 import org.opendaylight.controller.netconf.persist.impl.osgi.ConfigPersisterActivator;
-import org.opendaylight.controller.netconf.persist.impl.osgi.PropertiesProviderBaseImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.ListIterator;
-
 /**
  * {@link Persister} implementation that delegates persisting functionality to
  * underlying {@link Persister} storages. Each storage has unique id, class, readonly value.
@@ -88,7 +87,7 @@ public final class PersisterAggregator implements Persister {
         }
     }
 
-    private static PersisterWithConfiguration loadConfiguration(final String index, final PropertiesProviderBaseImpl propertiesProvider) {
+    private static PersisterWithConfiguration loadConfiguration(final String index, final PropertiesProvider propertiesProvider) {
 
         String classKey = index + "." + ConfigPersisterActivator.STORAGE_ADAPTER_CLASS_PROP_SUFFIX;
         String storageAdapterClass = propertiesProvider.getProperty(classKey);
@@ -102,7 +101,7 @@ public final class PersisterAggregator implements Persister {
         try {
             Class<?> clazz = Class.forName(storageAdapterClass);
             boolean implementsCorrectIfc = StorageAdapter.class.isAssignableFrom(clazz);
-            if (implementsCorrectIfc == false) {
+            if (!implementsCorrectIfc) {
                 throw new IllegalArgumentException("Storage adapter " + clazz + " does not implement " + StorageAdapter.class);
             }
             storageAdapter = StorageAdapter.class.cast(clazz.newInstance());
@@ -131,10 +130,10 @@ public final class PersisterAggregator implements Persister {
 
     }
 
-    public static PersisterAggregator createFromProperties(PropertiesProviderBaseImpl propertiesProvider) {
+    public static PersisterAggregator createFromProperties(PropertiesProvider propertiesProvider) {
         List<PersisterWithConfiguration> persisterWithConfigurations = new ArrayList<>();
         String prefixes = propertiesProvider.getProperty("active");
-        if (prefixes!=null && prefixes.isEmpty() == false) {
+        if (prefixes!=null && !prefixes.isEmpty()) {
             String [] keys = prefixes.split(",");
             for (String index: keys) {
                 persisterWithConfigurations.add(PersisterAggregator.loadConfiguration(index, propertiesProvider));
@@ -169,7 +168,7 @@ public final class PersisterAggregator implements Persister {
             } catch (IOException e) {
                 throw new RuntimeException("Error while calling loadLastConfig on " +  persisterWithConfiguration, e);
             }
-            if (configs.isEmpty() == false) {
+            if (!configs.isEmpty()) {
                 logger.debug("Found non empty configs using {}:{}", persisterWithConfiguration, configs);
                 return configs;
             }