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

jbonofre pushed a commit to branch karaf-4.2.x
in repository https://gitbox.apache.org/repos/asf/karaf.git


The following commit(s) were added to refs/heads/karaf-4.2.x by this push:
     new 1c2cb74  [KARAF-6239] Workaround (waiting Felix Utils fix release) to 
avoid duplicated of features to deploy
1c2cb74 is described below

commit 1c2cb74f374917c6ac2bc8dcdd3b7ee8d069c947
Author: Jean-Baptiste Onofré <[email protected]>
AuthorDate: Tue Apr 16 15:32:13 2019 +0200

    [KARAF-6239] Workaround (waiting Felix Utils fix release) to avoid 
duplicated of features to deploy
---
 .../org/apache/karaf/features/internal/service/Deployer.java   | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
 
b/features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
index f2eb18f..c33e272 100644
--- 
a/features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
+++ 
b/features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
@@ -1342,8 +1342,14 @@ public class Deployer {
 
             // Compute the list of resources to deploy in the region
             Set<Resource> bundlesInRegion = bundlesPerRegions.get(region);
-            List<Resource> toDeploy = bundlesInRegion != null
-                    ? new ArrayList<>(bundlesInRegion) : new ArrayList<>();
+            // 
**********************************************************************
+            // KARAF-6239: workaround to avoid several entries for the same 
resource
+            Map<String, Resource> deduplicatedMap = new HashMap<>();
+            for (Resource resource : bundlesInRegion) {
+                deduplicatedMap.put(getSymbolicName(resource) + "/" + 
getVersion(resource), resource);
+            }
+            List<Resource> toDeploy = new 
ArrayList<>(deduplicatedMap.values());
+            // 
**********************************************************************
 
             // Remove the system bundle
             Bundle systemBundle = dstate.bundles.get(0l);

Reply via email to