X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-persister-feature-adapter%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfigpusherfeature%2Finternal%2FChildAwareFeatureWrapper.java;h=4ea3c5ff752968265d9f9513ba45dbb927a4e652;hb=4497e2212e73e13356447b9644bbdc935411949a;hp=8d2ae68a9a3af76c8f0db7c8f50b8739bb25888b;hpb=6faa900c307b5d97fc7726d31b6dad0e67077db8;p=controller.git diff --git a/opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/ChildAwareFeatureWrapper.java b/opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/ChildAwareFeatureWrapper.java index 8d2ae68a9a..4ea3c5ff75 100644 --- a/opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/ChildAwareFeatureWrapper.java +++ b/opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/ChildAwareFeatureWrapper.java @@ -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()); } } } @@ -95,11 +92,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) { - fi = f; - break; - } + if (range.contains(v) && + (fi == null || VersionTable.getVersion(fi.getVersion()).compareTo(v) < 0)) { + fi = f; + break; } } }