ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r1056036 - in /ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo: BundleRepoDescriptor.java RepoDescriptor.java
Date Thu, 06 Jan 2011 19:46:18 GMT
Author: hibou
Date: Thu Jan  6 19:46:17 2011
New Revision: 1056036

URL: http://svn.apache.org/viewvc?rev=1056036&view=rev
Log:
adding bundle should be a generic function

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/BundleRepoDescriptor.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RepoDescriptor.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/BundleRepoDescriptor.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/BundleRepoDescriptor.java?rev=1056036&r1=1056035&r2=1056036&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/BundleRepoDescriptor.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/BundleRepoDescriptor.java Thu Jan
 6 19:46:17 2011
@@ -20,10 +20,7 @@ package org.apache.ivy.osgi.repo;
 import java.text.ParseException;
 import java.util.Iterator;
 
-import org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor;
-import org.apache.ivy.osgi.core.BundleCapability;
 import org.apache.ivy.osgi.core.BundleInfo;
-import org.apache.ivy.osgi.core.BundleInfoAdapter;
 import org.apache.ivy.osgi.core.ExecutionEnvironmentProfileProvider;
 import org.apache.ivy.osgi.core.ManifestParser;
 import org.apache.ivy.util.Message;
@@ -34,10 +31,8 @@ public class BundleRepoDescriptor extend
 
     private Long lastModified;
 
-    private final ExecutionEnvironmentProfileProvider profileProvider;
-
     public BundleRepoDescriptor(ExecutionEnvironmentProfileProvider profileProvider) {
-        this.profileProvider = profileProvider;
+        super(profileProvider);
     }
 
     public void setName(String name) {
@@ -71,15 +66,4 @@ public class BundleRepoDescriptor extend
         }
     }
 
-    public void addBundle(BundleInfo bundleInfo) {
-        DefaultModuleDescriptor md = BundleInfoAdapter.toModuleDescriptor(bundleInfo,
-            profileProvider);
-        add(BundleInfo.BUNDLE_TYPE, bundleInfo.getSymbolicName(), md);
-        Iterator itCapability = bundleInfo.getCapabilities().iterator();
-        while (itCapability.hasNext()) {
-            BundleCapability capability = (BundleCapability) itCapability.next();
-            add(capability.getType(), capability.getName(), md);
-        }
-    }
-
 }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RepoDescriptor.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RepoDescriptor.java?rev=1056036&r1=1056035&r2=1056036&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RepoDescriptor.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RepoDescriptor.java Thu Jan  6 19:46:17
2011
@@ -19,10 +19,16 @@ package org.apache.ivy.osgi.repo;
 
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor;
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
+import org.apache.ivy.osgi.core.BundleCapability;
+import org.apache.ivy.osgi.core.BundleInfo;
+import org.apache.ivy.osgi.core.BundleInfoAdapter;
+import org.apache.ivy.osgi.core.ExecutionEnvironmentProfileProvider;
 import org.apache.ivy.util.Message;
 
 public class RepoDescriptor {
@@ -31,6 +37,12 @@ public class RepoDescriptor {
 
     private final Set/* <ModuleDescriptor> */modules = new HashSet();
 
+    private final ExecutionEnvironmentProfileProvider profileProvider;
+
+    public RepoDescriptor(ExecutionEnvironmentProfileProvider profileProvider) {
+        this.profileProvider = profileProvider;
+    }
+
     public Set getModules() {
         return modules;
     }
@@ -70,6 +82,17 @@ public class RepoDescriptor {
         }
     }
 
+    public void addBundle(BundleInfo bundleInfo) {
+        DefaultModuleDescriptor md = BundleInfoAdapter.toModuleDescriptor(bundleInfo,
+            profileProvider);
+        add(BundleInfo.BUNDLE_TYPE, bundleInfo.getSymbolicName(), md);
+        Iterator itCapability = bundleInfo.getCapabilities().iterator();
+        while (itCapability.hasNext()) {
+            BundleCapability capability = (BundleCapability) itCapability.next();
+            add(capability.getType(), capability.getName(), md);
+        }
+    }
+
     public String toString() {
         return modules.toString();
     }



Mime
View raw message