Issue fix for config subsystem
[controller.git] / opendaylight / config / config-persister-feature-adapter / src / main / java / org / opendaylight / controller / configpusherfeature / internal / ChildAwareFeatureWrapper.java
index 8d2ae68a9a3af76c8f0db7c8f50b8739bb25888b..2bff9069007baa515c8f175740a79fe5e1b325a4 100644 (file)
@@ -30,7 +30,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 LOGGER = LoggerFactory.getLogger(ChildAwareFeatureWrapper.class);
     private FeaturesService featuresService= null;
 
     protected ChildAwareFeatureWrapper(Feature f) {
@@ -79,7 +79,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());
+                    LOGGER.debug("{} is not a config subsystem config file",h.getFileInfo().getFinalname());
                 }
             }
         }
@@ -95,11 +95,10 @@ public class ChildAwareFeatureWrapper extends AbstractFeatureWrapper implements
         for(Feature f: features) {
             if (f.getName().equals(dependency.getName())) {
                 Version v = VersionTable.getVersion(f.getVersion());
-                if (range.contains(v)) {
-                    if (fi == null || VersionTable.getVersion(fi.getVersion()).compareTo(v) < 0) {
+                if (range.contains(v) &&
+                    (fi == null || VersionTable.getVersion(fi.getVersion()).compareTo(v) < 0)) {
                         fi = f;
                         break;
-                    }
                 }
             }
         }