You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2019/06/15 12:20:09 UTC

[sling-org-apache-sling-feature] branch master updated: SLING-8502 : Update to latest Apache Felix Utils

This is an automated email from the ASF dual-hosted git repository.

cziegeler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature.git


The following commit(s) were added to refs/heads/master by this push:
     new 6f10d8d  SLING-8502 : Update to latest Apache Felix Utils
6f10d8d is described below

commit 6f10d8db002a1e62a344424c3405214bcb98f774
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sat Jun 15 14:19:58 2019 +0200

    SLING-8502 : Update to latest Apache Felix Utils
---
 pom.xml                                            | 25 +++++++++++++++++++++-
 .../java/org/apache/sling/feature/Feature.java     | 15 -------------
 .../sling/feature/builder/FeatureBuilderTest.java  | 24 +++++++--------------
 3 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/pom.xml b/pom.xml
index ee0a9c1..3bacc23 100644
--- a/pom.xml
+++ b/pom.xml
@@ -65,6 +65,29 @@
                     </excludes>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>3.2.1</version>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <createSourcesJar>true</createSourcesJar>
+                            <shadeSourcesContent>true</shadeSourcesContent>
+                            <relocations>
+                                <relocation>
+                                    <pattern>org.apache.felix.utils</pattern>
+                                    <shadedPattern>org.apache.sling.feature.impl.felix.utils</shadedPattern>
+                                </relocation>
+                            </relocations>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
     <dependencies>
@@ -87,7 +110,7 @@
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.utils</artifactId>
-            <version>1.11.0</version>
+            <version>1.11.2</version>
             <scope>provided</scope>
         </dependency>
 
diff --git a/src/main/java/org/apache/sling/feature/Feature.java b/src/main/java/org/apache/sling/feature/Feature.java
index dadeb17..4303981 100644
--- a/src/main/java/org/apache/sling/feature/Feature.java
+++ b/src/main/java/org/apache/sling/feature/Feature.java
@@ -20,7 +20,6 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Objects;
 
 import org.apache.felix.utils.resource.CapabilityImpl;
 import org.apache.felix.utils.resource.RequirementImpl;
@@ -445,19 +444,5 @@ public class Feature implements Comparable<Feature> {
         public MatchingRequirementImpl(Resource res, String ns, Map<String, String> dirs, Map<String, Object> attrs) {
             super(res, ns, dirs, attrs);
         }
-
-        @Override
-        public boolean equals(final Object o) {
-            if (this == o) {
-                return true;
-            }
-            if (o == null || !(o instanceof RequirementImpl)) {
-                return false;
-            }
-            final RequirementImpl that = (RequirementImpl) o;
-            return Objects.equals(resource, that.getResource()) && Objects.equals(namespace, that.getNamespace())
-                    && Objects.equals(attributes, that.getAttributes())
-                    && Objects.equals(directives, that.getDirectives());
-        }
     }
 }
diff --git a/src/test/java/org/apache/sling/feature/builder/FeatureBuilderTest.java b/src/test/java/org/apache/sling/feature/builder/FeatureBuilderTest.java
index f2a05fe..7b7f374 100644
--- a/src/test/java/org/apache/sling/feature/builder/FeatureBuilderTest.java
+++ b/src/test/java/org/apache/sling/feature/builder/FeatureBuilderTest.java
@@ -172,7 +172,10 @@ public class FeatureBuilderTest {
         for(final Requirement r : expected.getRequirements()) {
             boolean found = false;
             for(final Requirement i : actuals.getRequirements()) {
-                if ( r.equals(i) ) {
+                if (Objects.equals(r.getResource(), i.getResource())
+                        && Objects.equals(r.getNamespace(), i.getNamespace())
+                        && Objects.equals(r.getAttributes(), i.getAttributes())
+                        && Objects.equals(i.getDirectives(), i.getDirectives())) {
                     found = true;
                     break;
                 }
@@ -185,7 +188,10 @@ public class FeatureBuilderTest {
         for(final Capability r : expected.getCapabilities()) {
             boolean found = false;
             for(final Capability i : actuals.getCapabilities()) {
-                if ( r.equals(i) ) {
+                if (Objects.equals(r.getResource(), i.getResource())
+                        && Objects.equals(r.getNamespace(), i.getNamespace())
+                        && Objects.equals(r.getAttributes(), i.getAttributes())
+                        && Objects.equals(i.getDirectives(), i.getDirectives())) {
                     found = true;
                     break;
                 }
@@ -866,19 +872,5 @@ public class FeatureBuilderTest {
         public MatchingRequirementImpl(Resource res, String ns, Map<String, String> dirs, Map<String, Object> attrs) {
             super(res, ns, dirs, attrs);
         }
-
-        @Override
-        public boolean equals(final Object o) {
-            if (this == o) {
-                return true;
-            }
-            if (o == null || !(o instanceof RequirementImpl)) {
-                return false;
-            }
-            final RequirementImpl that = (RequirementImpl) o;
-            return Objects.equals(resource, that.getResource()) && Objects.equals(namespace, that.getNamespace())
-                    && Objects.equals(attributes, that.getAttributes())
-                    && Objects.equals(directives, that.getDirectives());
-        }
     }
 }