Fix override of installed bundles
[lgpl/argeo-commons.git] / org.argeo.init / src / org / argeo / init / a2 / A2Component.java
index cc2f564716858b5dee3389404bf7fcf8a431dd1e..8942706300ee74b423c6e5cec959e68e600b9faa 100644 (file)
@@ -28,10 +28,11 @@ public class A2Component implements Comparable<A2Component> {
        }
 
        A2Branch getOrAddBranch(String branchId) {
-               if (branches.containsKey(branchId))
-                       return branches.get(branchId);
-               else
-                       return new A2Branch(this, branchId);
+               if (!branches.containsKey(branchId)) {
+                       A2Branch a2Branch = new A2Branch(this, branchId);
+                       branches.put(branchId, a2Branch);
+               }
+               return branches.get(branchId);
        }
 
        A2Module getOrAddModule(Version version, Object locator) {