Do not inline karaf.features.internal.model 21/65921/7
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 26 Nov 2017 23:20:42 +0000 (00:20 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 15 Jan 2018 13:59:51 +0000 (14:59 +0100)
Since karaf-4.1.2+ exposes proper model-level indicator of version
non-presence, we do not need to muck around in internals -- leading
to us not inlining ~90KiB of classes.

Also trims duplicate dependencies, as features-core already contains
a copy of felix.utils -- eliminating a bundle warning.

Change-Id: Ic6e3645a56a2e4a3072c50da52a34effe4a0b71a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/config/config-persister-feature-adapter/pom.xml
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/ChildAwareFeatureWrapper.java

index cd6f6b1..8a84e22 100644 (file)
     <packaging>bundle</packaging>
 
     <dependencies>
+        <dependency>
+           <groupId>com.google.guava</groupId>
+           <artifactId>guava</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>config-persister-directory-xml-adapter</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.utils</artifactId>
-            <version>1.6.0</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-           <groupId>com.google.guava</groupId>
-           <artifactId>guava</artifactId>
-        </dependency>
     </dependencies>
 
     <build>
@@ -68,7 +62,6 @@
                         <Bundle-Version>${project.version}</Bundle-Version>
                         <Bundle-Activator>org.opendaylight.controller.configpusherfeature.ConfigPusherFeatureActivator</Bundle-Activator>
                         <Private-Package>
-                            org.apache.karaf.features.internal.model,
                             org.apache.felix.utils.version,
                             org.opendaylight.controller.configpusherfeature.internal
                         </Private-Package>
index 9129500..2a23fd2 100644 (file)
@@ -9,11 +9,9 @@ package org.opendaylight.controller.configpusherfeature.internal;
 
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
-
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
-
 import org.apache.felix.utils.version.VersionRange;
 import org.apache.felix.utils.version.VersionTable;
 import org.apache.karaf.features.Dependency;
@@ -94,8 +92,8 @@ public class ChildAwareFeatureWrapper extends AbstractFeatureWrapper implements
 
     protected Feature extractFeatureFromDependency(final Dependency dependency) throws Exception {
         Feature[] features = featuresService.listFeatures();
-        VersionRange range = org.apache.karaf.features.internal.model.Feature.DEFAULT_VERSION.equals(dependency
-                .getVersion()) ? VersionRange.ANY_VERSION : new VersionRange(dependency.getVersion(), true, true);
+        VersionRange range = dependency.hasVersion() ? new VersionRange(dependency.getVersion(), true, true)
+                : VersionRange.ANY_VERSION;
         Feature fi = null;
         for (Feature f : features) {
             if (f.getName().equals(dependency.getName())) {

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.