Author: cziegeler
Date: Sat Aug  5 09:10:21 2017
New Revision: 1804181

URL: http://svn.apache.org/viewvc?rev=1804181&view=rev
Log:
Simplify descriptor aggregation

Modified:
    
sling/whiteboard/cziegeler/feature-analyser/src/main/java/org/apache/sling/feature/analyser/ApplicationDescriptor.java
    
sling/whiteboard/cziegeler/feature-analyser/src/main/java/org/apache/sling/feature/analyser/ContainerDescriptor.java
    
sling/whiteboard/cziegeler/feature-analyser/src/main/java/org/apache/sling/feature/analyser/Scanner.java

Modified: 
sling/whiteboard/cziegeler/feature-analyser/src/main/java/org/apache/sling/feature/analyser/ApplicationDescriptor.java
URL: 
http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/feature-analyser/src/main/java/org/apache/sling/feature/analyser/ApplicationDescriptor.java?rev=1804181&r1=1804180&r2=1804181&view=diff
==============================================================================
--- 
sling/whiteboard/cziegeler/feature-analyser/src/main/java/org/apache/sling/feature/analyser/ApplicationDescriptor.java
 (original)
+++ 
sling/whiteboard/cziegeler/feature-analyser/src/main/java/org/apache/sling/feature/analyser/ApplicationDescriptor.java
 Sat Aug  5 09:10:21 2017
@@ -27,4 +27,13 @@ public abstract class ApplicationDescrip
     public abstract Application getApplication();
 
     public abstract BundleDescriptor getFrameworkDescriptor();
+
+    @Override
+    public void lock() {
+        if ( this.isLocked() ) {
+            return;
+        }
+        this.aggregate(this.getFrameworkDescriptor());
+        super.lock();
+    }
 }
\ No newline at end of file

Modified: 
sling/whiteboard/cziegeler/feature-analyser/src/main/java/org/apache/sling/feature/analyser/ContainerDescriptor.java
URL: 
http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/feature-analyser/src/main/java/org/apache/sling/feature/analyser/ContainerDescriptor.java?rev=1804181&r1=1804180&r2=1804181&view=diff
==============================================================================
--- 
sling/whiteboard/cziegeler/feature-analyser/src/main/java/org/apache/sling/feature/analyser/ContainerDescriptor.java
 (original)
+++ 
sling/whiteboard/cziegeler/feature-analyser/src/main/java/org/apache/sling/feature/analyser/ContainerDescriptor.java
 Sat Aug  5 09:10:21 2017
@@ -56,6 +56,9 @@ public abstract class ContainerDescripto
 
     @Override
     public void lock() {
+        if ( this.isLocked() ) {
+            return;
+        }
         for(final BundleDescriptor bd : this.bundles) {
             this.aggregate(bd);
         }

Modified: 
sling/whiteboard/cziegeler/feature-analyser/src/main/java/org/apache/sling/feature/analyser/Scanner.java
URL: 
http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/feature-analyser/src/main/java/org/apache/sling/feature/analyser/Scanner.java?rev=1804181&r1=1804180&r2=1804181&view=diff
==============================================================================
--- 
sling/whiteboard/cziegeler/feature-analyser/src/main/java/org/apache/sling/feature/analyser/Scanner.java
 (original)
+++ 
sling/whiteboard/cziegeler/feature-analyser/src/main/java/org/apache/sling/feature/analyser/Scanner.java
 Sat Aug  5 09:10:21 2017
@@ -165,12 +165,6 @@ public class Scanner {
             for(final Artifact bundle : entry.getValue() ) {
                 final BundleDescriptor bundleDesc = scan(bundle, 
entry.getKey());
                 desc.getBundleDescriptors().add(bundleDesc);
-                // aggregate
-                desc.getRequirements().addAll(bundleDesc.getRequirements());
-                desc.getCapabilities().addAll(bundleDesc.getCapabilities());
-                
desc.getExportedPackages().addAll(bundleDesc.getExportedPackages());
-                
desc.getImportedPackages().addAll(bundleDesc.getImportedPackages());
-                
desc.getDynamicImportedPackages().addAll(bundleDesc.getDynamicImportedPackages());
             }
         }
     }
@@ -257,13 +251,6 @@ public class Scanner {
             throw new IOException("No scanner found for framework " + 
app.getFramework().toMvnId());
         }
 
-        // aggregate
-        desc.getRequirements().addAll(fwk.getRequirements());
-        desc.getCapabilities().addAll(fwk.getCapabilities());
-        desc.getExportedPackages().addAll(fwk.getExportedPackages());
-        desc.getImportedPackages().addAll(fwk.getImportedPackages());
-        
desc.getDynamicImportedPackages().addAll(fwk.getDynamicImportedPackages());
-
         desc.setFrameworkDescriptor(fwk);
 
         desc.lock();


Reply via email to