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-modelconverter] 04/40: Refactor start order handling
Date Fri, 27 Apr 2018 10:01:22 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-modelconverter.git

commit 5775a03073a53258e0bab9bb623bbe94683c758d
Author: Carsten Ziegeler <cziegeler@apache.org>
AuthorDate: Fri Jan 19 08:07:53 2018 +0100

    Refactor start order handling
---
 .../org/apache/sling/feature/modelconverter/impl/Main.java   | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/feature/modelconverter/impl/Main.java b/src/main/java/org/apache/sling/feature/modelconverter/impl/Main.java
index fedd964..9f5aaf9 100644
--- a/src/main/java/org/apache/sling/feature/modelconverter/impl/Main.java
+++ b/src/main/java/org/apache/sling/feature/modelconverter/impl/Main.java
@@ -656,13 +656,17 @@ public class Main {
         final Feature f = new Feature("application");
 
         // bundles
-        for(final Map.Entry<Integer, org.apache.sling.feature.Artifact> bundle : app.getBundles().getAllBundles())
{
-            final ArtifactId id = bundle.getValue().getId();
+        for(final org.apache.sling.feature.Artifact bundle : app.getBundles()) {
+            final ArtifactId id = bundle.getId();
             final Artifact newBundle = new Artifact(id.getGroupId(), id.getArtifactId(),
id.getVersion(), id.getClassifier(), id.getType());
-            for(final Map.Entry<String, String> prop : bundle.getValue().getMetadata())
{
+            for(final Map.Entry<String, String> prop : bundle.getMetadata()) {
                 newBundle.getMetadata().put(prop.getKey(), prop.getValue());
             }
-            f.getOrCreateRunMode(null).getOrCreateArtifactGroup(bundle.getKey()).add(newBundle);
+            int startLevel = bundle.getStartOrder();
+            if ( startLevel == 0 ) {
+                startLevel = 20;
+            }
+            f.getOrCreateRunMode(null).getOrCreateArtifactGroup(startLevel).add(newBundle);
         }
 
         // configurations

-- 
To stop receiving notification emails like this one, please contact
davidb@apache.org.

Mime
View raw message