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

rombert pushed a commit to annotated tag maven-launchpad-plugin-2.0.10
in repository 
https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git

commit d2e796202ebf17b280410749a919c83d361f977a
Author: Ian Boston <[email protected]>
AuthorDate: Wed Feb 24 16:42:32 2010 +0000

    SLING-1351 When the xpp parser loads a Bundle it only sets the attributes 
specified on the bundle, and takes no account of
    any containers, hence on merge the container start level must be inspected 
to determine where a bundle should be merged.
    If not specified (ie 0) it should be merged in the containing bundle. This 
means that its not going to be possible
    to specify a bundle as loading in start level 0 by setting the level on the 
bundle. To load in start level 0 you must
    put the bundle element inside a startLevel element of 0.
    
    git-svn-id: 
https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@915859
 13f79535-47bb-0310-9956-ffa450edef68
---
 .../projectsupport/bundlelist/BaseBundleList.java      | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git 
a/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseBundleList.java
 
b/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseBundleList.java
index 43b78fc..97b185a 100644
--- 
a/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseBundleList.java
+++ 
b/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseBundleList.java
@@ -55,7 +55,7 @@ public abstract class BaseBundleList {
     public void merge(BundleList bundleList) {
         for (StartLevel sl : bundleList.getStartLevels()) {
             for (Bundle bnd : sl.getBundles()) {
-                add(bnd);
+                add(sl, bnd);
             }
         }
     }
@@ -67,11 +67,25 @@ public abstract class BaseBundleList {
      * @param newBnd the bundle to add
      */
     public void add(Bundle newBnd) {
+       add(null, newBnd);
+    }
+
+    /**
+     * Merge bundle into a start level using the supplied level if present.
+     * @param mergeStartLevel
+     * @param newBnd
+     */
+    private void add(StartLevel mergeStartLevel, Bundle newBnd) {
         Bundle current = get(newBnd, false);
         if (current != null) {
 
         } else {
-            StartLevel startLevel = 
getOrCreateStartLevel(newBnd.getStartLevel());
+            StartLevel startLevel = null;
+            if ( mergeStartLevel == null || newBnd.getStartLevel() > 0) {
+                startLevel = getOrCreateStartLevel(newBnd.getStartLevel());
+            } else {
+                startLevel = getOrCreateStartLevel(mergeStartLevel.getLevel());
+            }
             startLevel.getBundles().add(newBnd);
         }
 

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to