Fix checkstyle warnings in opendaylight/config
[controller.git] / opendaylight / config / config-persister-feature-adapter / src / main / java / org / opendaylight / controller / configpusherfeature / internal / FeatureConfigPusher.java
index 5c5061277b62f28c98e163f17c7fc1c721a91cd9..7b90580a660cac0a03a4b90c0c0f8d40a1d2eb68 100644 (file)
@@ -7,11 +7,11 @@
  */
 package org.opendaylight.controller.configpusherfeature.internal;
 
+import com.google.common.collect.LinkedHashMultimap;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.LinkedHashSet;
 import java.util.List;
-
 import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.FeaturesService;
 import org.opendaylight.controller.config.persist.api.ConfigPusher;
@@ -19,13 +19,11 @@ import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.collect.LinkedHashMultimap;
-
 /*
  * Simple class to push configs to the config subsystem from Feature's configfiles
  */
 public class FeatureConfigPusher {
-    private static final Logger LOGGER = LoggerFactory.getLogger(FeatureConfigPusher.class);
+    private static final Logger LOG = LoggerFactory.getLogger(FeatureConfigPusher.class);
     private static final int MAX_RETRIES=100;
     private static final int RETRY_PAUSE_MILLIS=1;
     private FeaturesService featuresService = null;
@@ -46,7 +44,7 @@ public class FeatureConfigPusher {
     /*
      * @param p - ConfigPusher to push ConfigSnapshotHolders
      */
-    public FeatureConfigPusher(ConfigPusher p, FeaturesService f) {
+    public FeatureConfigPusher(final ConfigPusher p, final FeaturesService f) {
         pusher = p;
         featuresService = f;
     }
@@ -59,7 +57,7 @@ public class FeatureConfigPusher {
      * If a Feature is not in the returned LinkedHashMultimap then we couldn't push its configs
      * (Ususally because it was not yet installed)
      */
-    public LinkedHashMultimap<Feature,FeatureConfigSnapshotHolder> pushConfigs(List<Feature> features) throws Exception, InterruptedException {
+    public LinkedHashMultimap<Feature,FeatureConfigSnapshotHolder> pushConfigs(final List<Feature> features) throws Exception, InterruptedException {
         LinkedHashMultimap<Feature,FeatureConfigSnapshotHolder> pushedFeatures = LinkedHashMultimap.create();
         for(Feature feature: features) {
             LinkedHashSet<FeatureConfigSnapshotHolder> configSnapShots = pushConfig(feature);
@@ -70,7 +68,7 @@ public class FeatureConfigPusher {
         return pushedFeatures;
     }
 
-    private LinkedHashSet<FeatureConfigSnapshotHolder> pushConfig(Feature feature) throws Exception, InterruptedException {
+    private LinkedHashSet<FeatureConfigSnapshotHolder> pushConfig(final Feature feature) throws Exception, InterruptedException {
         LinkedHashSet<FeatureConfigSnapshotHolder> configs = new LinkedHashSet<FeatureConfigSnapshotHolder>();
         if(isInstalled(feature)) {
             ChildAwareFeatureWrapper wrappedFeature = new ChildAwareFeatureWrapper(feature,featuresService);
@@ -83,20 +81,20 @@ public class FeatureConfigPusher {
         return configs;
     }
 
-    private boolean isInstalled(Feature feature) {
+    private boolean isInstalled(final Feature feature) {
         for(int retries=0;retries<MAX_RETRIES;retries++) {
             try {
                 List<Feature> installedFeatures = Arrays.asList(featuresService.listInstalledFeatures());
                 if(installedFeatures.contains(feature)) {
                     return true;
                 } else {
-                    LOGGER.warn("Karaf featuresService.listInstalledFeatures() has not yet finished installing feature (retry {}) {} {}",retries,feature.getName(),feature.getVersion());
+                    LOG.warn("Karaf featuresService.listInstalledFeatures() has not yet finished installing feature (retry {}) {} {}",retries,feature.getName(),feature.getVersion());
                 }
             } catch (Exception e) {
                 if(retries < MAX_RETRIES) {
-                    LOGGER.warn("Karaf featuresService.listInstalledFeatures() has thrown an exception, retry {}, Exception {}", retries,e);
+                    LOG.warn("Karaf featuresService.listInstalledFeatures() has thrown an exception, retry {}", retries, e);
                 } else {
-                    LOGGER.error("Giving up on Karaf featuresService.listInstalledFeatures() which has thrown an exception, retry {}, Exception {}", retries,e);
+                    LOG.error("Giving up on Karaf featuresService.listInstalledFeatures() which has thrown an exception, retry {}", retries, e);
                     throw e;
                 }
             }
@@ -106,11 +104,11 @@ public class FeatureConfigPusher {
                 throw new IllegalStateException(e1);
             }
         }
-        LOGGER.error("Giving up (after {} retries) on Karaf featuresService.listInstalledFeatures() which has not yet finished installing feature {} {}",MAX_RETRIES,feature.getName(),feature.getVersion());
+        LOG.error("Giving up (after {} retries) on Karaf featuresService.listInstalledFeatures() which has not yet finished installing feature {} {}",MAX_RETRIES,feature.getName(),feature.getVersion());
         return false;
     }
 
-    private LinkedHashSet<FeatureConfigSnapshotHolder> pushConfig(LinkedHashSet<FeatureConfigSnapshotHolder> configs) throws InterruptedException {
+    private LinkedHashSet<FeatureConfigSnapshotHolder> pushConfig(final LinkedHashSet<FeatureConfigSnapshotHolder> configs) throws InterruptedException {
         LinkedHashSet<FeatureConfigSnapshotHolder> configsToPush = new LinkedHashSet<FeatureConfigSnapshotHolder>(configs);
         configsToPush.removeAll(pushedConfigs);
         if(!configsToPush.isEmpty()) {