bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/27458] New: VMClassLoader.getBootPackages does not work w


From: edwin dot steiner at gmx dot net
Subject: [Bug classpath/27458] New: VMClassLoader.getBootPackages does not work with endorsed jars
Date: 6 May 2006 17:19:38 -0000

VMClassLoader.getBootPackages only looks at the first URL returned by
getResources. This is a problem in case this first entry is the
META-INF/INDEX.LIST of an endorsed jar instead of glibj.zip. In this
case the boot packages are not found.

The following is a patch against VMClassLoader.java of CACAO that solves
the problem by reading the package lists of all URLs returned by
getResources:

Index: src/lib/vm/reference/java/lang/VMClassLoader.java
===================================================================
--- src/lib/vm/reference/java/lang/VMClassLoader.java   (revision 4867)
+++ src/lib/vm/reference/java/lang/VMClassLoader.java   (working copy)
@@ -265,12 +265,15 @@
    */
   private static String[] getBootPackages()
   {
-    URL indexList = getResource("META-INF/INDEX.LIST");
-    if (indexList != null)
-      {
+       Enumeration urls = getResources("META-INF/INDEX.LIST");
+       Set packageSet = new HashSet();
+
+    while (urls.hasMoreElements())
+         {
+        URL indexList = (URL) urls.nextElement();
+
         try
           {
-            Set packageSet = new HashSet();
             String line;
             int lineToSkip = 3;
             BufferedReader reader = new BufferedReader(
@@ -289,15 +292,12 @@
                   lineToSkip--;
               }
             reader.close();
-            return (String[]) packageSet.toArray(new
String[packageSet.size()]);
           }
         catch (IOException e)
           {
-            return new String[0];
           }
-      }
-    else
-      return new String[0];
+         }
+       return (String[]) packageSet.toArray(new String[packageSet.size()]);
   }


-- 
           Summary: VMClassLoader.getBootPackages does not work with
                    endorsed jars
           Product: classpath
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: classpath
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: edwin dot steiner at gmx dot net
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27458





reply via email to

[Prev in Thread] Current Thread [Next in Thread]