Fix checkstyle warnings in config-persister-feature-adapter 94/12994/1
authorMarian Dubai <mdubai@cisco.com>
Thu, 20 Nov 2014 10:01:58 +0000 (11:01 +0100)
committerMarian Dubai <mdubai@cisco.com>
Thu, 20 Nov 2014 14:21:43 +0000 (15:21 +0100)
Change-Id: If961a029b48d85b58ca10b9b71f5fc29d41dbe9c
Signed-off-by: Marian Dubai <mdubai@cisco.com>
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/AbstractFeatureWrapper.java
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/ChildAwareFeatureWrapper.java
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/ConfigFeaturesListener.java
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/ConfigPushingRunnable.java
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/FeatureConfigSnapshotHolder.java

index 3e004b4..90b6d53 100644 (file)
@@ -7,12 +7,11 @@
  */
 package org.opendaylight.controller.configpusherfeature.internal;
 
+import com.google.common.base.Preconditions;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
-
 import javax.xml.bind.JAXBException;
-
 import org.apache.karaf.features.BundleInfo;
 import org.apache.karaf.features.Conditional;
 import org.apache.karaf.features.ConfigFileInfo;
@@ -21,8 +20,6 @@ import org.apache.karaf.features.Feature;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
-
 /*
  * Wrap a Feature for the purposes of extracting the FeatureConfigSnapshotHolders from
  * its underlying ConfigFileInfo's
@@ -30,7 +27,7 @@ import com.google.common.base.Preconditions;
  * Delegates the the contained feature and provides additional methods.
  */
 public class AbstractFeatureWrapper implements Feature {
-    private static final Logger LOGGER = LoggerFactory.getLogger(AbstractFeatureWrapper.class);
+    private static final Logger LOG = LoggerFactory.getLogger(AbstractFeatureWrapper.class);
     protected Feature feature = null;
 
     protected AbstractFeatureWrapper() {
@@ -55,7 +52,7 @@ public class AbstractFeatureWrapper implements Feature {
             try {
                 snapShotHolders.add(new FeatureConfigSnapshotHolder(c,this));
             } catch (JAXBException e) {
-                LOGGER.debug("{} is not a config subsystem config file",c.getFinalname());
+                LOG.debug("{} is not a config subsystem config file",c.getFinalname());
             }
         }
         return snapShotHolders;
index 2bff906..4ea3c5f 100644 (file)
@@ -7,11 +7,10 @@
  */
 package org.opendaylight.controller.configpusherfeature.internal;
 
+import com.google.common.base.Preconditions;
 import java.util.LinkedHashSet;
 import java.util.List;
-
 import javax.xml.bind.JAXBException;
-
 import org.apache.felix.utils.version.VersionRange;
 import org.apache.felix.utils.version.VersionTable;
 import org.apache.karaf.features.Dependency;
@@ -21,8 +20,6 @@ import org.osgi.framework.Version;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
-
 /*
  * Wrap a Feature for the purposes of extracting the FeatureConfigSnapshotHolders from
  * its underlying ConfigFileInfo's and those of its children recursively
@@ -30,7 +27,7 @@ import com.google.common.base.Preconditions;
  * Delegates the the contained feature and provides additional methods.
  */
 public class ChildAwareFeatureWrapper extends AbstractFeatureWrapper implements Feature {
-    private static final Logger LOGGER = LoggerFactory.getLogger(ChildAwareFeatureWrapper.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ChildAwareFeatureWrapper.class);
     private FeaturesService featuresService= null;
 
     protected ChildAwareFeatureWrapper(Feature f) {
@@ -79,7 +76,7 @@ public class ChildAwareFeatureWrapper extends AbstractFeatureWrapper implements
                     f = new FeatureConfigSnapshotHolder(h,this);
                     snapShotHolders.add(f);
                 } catch (JAXBException e) {
-                    LOGGER.debug("{} is not a config subsystem config file",h.getFileInfo().getFinalname());
+                    LOG.debug("{} is not a config subsystem config file",h.getFileInfo().getFinalname());
                 }
             }
         }
@@ -97,8 +94,8 @@ public class ChildAwareFeatureWrapper extends AbstractFeatureWrapper implements
                 Version v = VersionTable.getVersion(f.getVersion());
                 if (range.contains(v) &&
                     (fi == null || VersionTable.getVersion(fi.getVersion()).compareTo(v) < 0)) {
-                        fi = f;
-                        break;
+                    fi = f;
+                    break;
                 }
             }
         }
index 2af4719..72abca1 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.configpusherfeature.internal;
 
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
-
 import org.apache.karaf.features.FeatureEvent;
 import org.apache.karaf.features.FeaturesListener;
 import org.apache.karaf.features.FeaturesService;
@@ -19,7 +18,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class ConfigFeaturesListener implements  FeaturesListener,  AutoCloseable {
-    private static final Logger LOGGER = LoggerFactory.getLogger(ConfigFeaturesListener.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ConfigFeaturesListener.class);
     private static final int QUEUE_SIZE = 1000;
     private BlockingQueue<FeatureEvent> queue = new LinkedBlockingQueue<FeatureEvent>(QUEUE_SIZE);
     Thread pushingThread = null;
@@ -36,7 +35,7 @@ public class ConfigFeaturesListener implements  FeaturesListener,  AutoCloseable
 
     @Override
     public void repositoryEvent(RepositoryEvent event) {
-        LOGGER.debug("Repository: " + event.getType() + " " + event.getRepository());
+        LOG.debug("Repository: {} {}", event.getType(), event.getRepository());
     }
 
     @Override
index 1a40bb3..5c257ef 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.List;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.TimeUnit;
-
 import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.FeatureEvent;
 import org.apache.karaf.features.FeatureEvent.EventType;
@@ -20,10 +20,8 @@ import org.opendaylight.controller.config.persist.api.ConfigPusher;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.collect.LinkedHashMultimap;
-
 public class ConfigPushingRunnable implements Runnable {
-    private static final Logger LOGGER = LoggerFactory.getLogger(ConfigPushingRunnable.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ConfigPushingRunnable.class);
     private static final int POLL_TIME = 1;
     private BlockingQueue<FeatureEvent> queue;
     private FeatureConfigPusher configPusher;
@@ -49,14 +47,14 @@ public class ConfigPushingRunnable implements Runnable {
                         processFeatureEvent(event,toInstall);
                     }
                 } else if(toInstall.isEmpty()) {
-                    LOGGER.error("ConfigPushingRunnable - exiting");
+                    LOG.error("ConfigPushingRunnable - exiting");
                     return;
                 }
             } catch (InterruptedException e) {
-                LOGGER.error("ConfigPushingRunnable - interupted");
+                LOG.error("ConfigPushingRunnable - interupted");
                 interuppted = true;
             } catch (Exception e) {
-                LOGGER.error("Exception while processing features {}", e);
+                LOG.error("Exception while processing features ", e);
             }
         }
     }
@@ -73,7 +71,7 @@ public class ConfigPushingRunnable implements Runnable {
 
     protected void logPushResult(LinkedHashMultimap<Feature,FeatureConfigSnapshotHolder> results) {
         for(Feature f:results.keySet()) {
-            LOGGER.info("Pushed configs for feature {} {}",f,results.get(f));
+            LOG.info("Pushed configs for feature {} {}",f,results.get(f));
         }
     }
 }
index 5ab5c95..1bce5f2 100644 (file)
@@ -7,27 +7,24 @@
  */
 package org.opendaylight.controller.configpusherfeature.internal;
 
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
 import java.io.File;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.SortedSet;
-
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Unmarshaller;
-
 import org.apache.karaf.features.ConfigFileInfo;
 import org.apache.karaf.features.Feature;
 import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder;
 import org.opendaylight.controller.config.persist.storage.file.xml.model.ConfigSnapshot;
 
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
 /*
  * A ConfigSnapshotHolder that can track all the additional information
  * relavent to the fact we are getting these from a Feature.