felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r379424 - /incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DefaultBundleArchive.java
Date Tue, 21 Feb 2006 11:22:24 GMT
Author: rickhall
Date: Tue Feb 21 03:22:20 2006
New Revision: 379424

URL: http://svn.apache.org/viewcvs?rev=379424&view=rev
Log:
Clean up some code to make it more sensible.

Modified:
    incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DefaultBundleArchive.java

Modified: incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DefaultBundleArchive.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DefaultBundleArchive.java?rev=379424&r1=379423&r2=379424&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DefaultBundleArchive.java
(original)
+++ incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DefaultBundleArchive.java
Tue Feb 21 03:22:20 2006
@@ -802,27 +802,14 @@
 
         // Get the bundle's manifest header.
         Map map = getManifestHeader(revision);
-        if (map == null)
-        {
-            map = new HashMap();
-        }
 
         // Find class path meta-data.
-        String classPathString = null;
-        Iterator iter = map.entrySet().iterator();
-        while ((classPathString == null) && iter.hasNext())
-        {
-            Map.Entry entry = (Map.Entry) iter.next();
-            if (entry.getKey().toString().toLowerCase().equals(
-                FelixConstants.BUNDLE_CLASSPATH.toLowerCase()))
-            {
-                classPathString = entry.getValue().toString();
-            }
-        }
+        String classPath = (map == null)
+            ? null : (String) map.get(FelixConstants.BUNDLE_CLASSPATH);
 
         // Parse the class path into strings.
         String[] classPathStrings = Util.parseDelimitedString(
-            classPathString, FelixConstants.CLASS_PATH_SEPARATOR);
+            classPath, FelixConstants.CLASS_PATH_SEPARATOR);
 
         if (classPathStrings == null)
         {
@@ -835,12 +822,12 @@
         {
             bundleJar = openBundleJar(revisionDir);
             IContent self = new JarContent(new File(revisionDir, BUNDLE_JAR_FILE));
-            IContent[] classPath = new IContent[classPathStrings.length];
+            IContent[] contentPath = new IContent[classPathStrings.length];
             for (int i = 0; i < classPathStrings.length; i++)
             {
                 if (classPathStrings[i].equals(FelixConstants.CLASS_PATH_DOT))
                 {
-                    classPath[i] = self;
+                    contentPath[i] = self;
                 }
                 else
                 {
@@ -849,23 +836,23 @@
                     ZipEntry entry = bundleJar.getEntry(classPathStrings[i]);
                     if ((entry != null) && entry.isDirectory())
                     {
-                        classPath[i] = new ContentDirectoryContent(self, classPathStrings[i]);
+                        contentPath[i] = new ContentDirectoryContent(self, classPathStrings[i]);
                     }
                     else
                     {
-                        classPath[i] = new JarContent(new File(embedDir, classPathStrings[i]));
+                        contentPath[i] = new JarContent(new File(embedDir, classPathStrings[i]));
                     }
                 }
             }
     
             // If there is nothing on the class path, then include
             // "." by default, as per the spec.
-            if (classPath.length == 0)
+            if (contentPath.length == 0)
             {
-                classPath = new IContent[] { self };
+                contentPath = new IContent[] { self };
             }
 
-            return classPath;
+            return contentPath;
         }
         finally
         {



Mime
View raw message