sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [sling-org-apache-sling-feature-extension-content] branch master updated: Use copies when merging extensions rather than the original object
Date Mon, 03 Dec 2018 16:45:07 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new e777354  Use copies when merging extensions rather than the original object
e777354 is described below

commit e77735417c23b27fca3d591bc7a99dc09bdbd3a7
Author: David Bosschaert <bosschae@adobe.com>
AuthorDate: Mon Dec 3 16:43:42 2018 +0000

    Use copies when merging extensions rather than the original object
    
    Previously the original extension objects were used which caused
    extension content to bleed into the wrong features.
---
 pom.xml                                                 | 17 +++++++++++------
 .../extension/content/ContentOrderMergeProcessor.java   |  4 ++--
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/pom.xml b/pom.xml
index b53e3e8..afb9f41 100644
--- a/pom.xml
+++ b/pom.xml
@@ -114,27 +114,32 @@
     </build>
     <dependencies>
         <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>osgi.core</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.jackrabbit.vault</groupId>
             <artifactId>org.apache.jackrabbit.vault</artifactId>
             <version>3.2.5-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
-           <dependency>
+        <dependency>
             <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.feature.launcher</artifactId>
-            <version>0.8.0</version>
+            <artifactId>org.apache.sling.feature</artifactId>
+            <version>0.8.1-SNAPSHOT</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.feature.io</artifactId>
-            <version>0.8.0</version>
+            <version>0.8.1-SNAPSHOT</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.feature</artifactId>
-            <version>0.8.0</version>
+            <artifactId>org.apache.sling.feature.launcher</artifactId>
+            <version>0.8.1-SNAPSHOT</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
diff --git a/src/main/java/org/apache/sling/feature/extension/content/ContentOrderMergeProcessor.java
b/src/main/java/org/apache/sling/feature/extension/content/ContentOrderMergeProcessor.java
index 4de97b5..2d18a82 100644
--- a/src/main/java/org/apache/sling/feature/extension/content/ContentOrderMergeProcessor.java
+++ b/src/main/java/org/apache/sling/feature/extension/content/ContentOrderMergeProcessor.java
@@ -58,7 +58,7 @@ public class ContentOrderMergeProcessor implements MergeHandler {
         processFeature(source, sourceEx);
 
         if (targetEx == null) {
-            target.getExtensions().add(sourceEx);
+            target.getExtensions().add(sourceEx.copy());
             return;
         }
         for (final Artifact a : sourceEx.getArtifacts()) {
@@ -70,7 +70,7 @@ public class ContentOrderMergeProcessor implements MergeHandler {
 
             if (replace) {
                 targetEx.getArtifacts().removeSame(a.getId());
-                targetEx.getArtifacts().add(a);
+                targetEx.getArtifacts().add(a.copy(a.getId()));
             }
         }
     }


Mime
View raw message