Hello!
Recently I have been working on compiling the JOnAS test suite
with cacao and I found a problem in the implementation of
getBootPackages: When getResources returnes an endores jar before
glibj.zip and this jar has a META-INF/INDEX.LIST, getBootPackages
tries to pull the boot packages only from this (first) jar.
I changed the VMClassLoader.java of cacao to read all the resources.
The patch is appended below. Caution: As my Java skills are practically
non-existant this may be a bad solution. It worked for me. I used
a quick-and-dirty script to add INDEX.LIST to glibj.zip (available on
http://c1.complang.tuwien.ac.at/cacaowiki/BootPackages
) and with the patch to cacao the JOnAS genic tool finally worked.
You may want to make a similar change to the reference implementation
of getBootPackages.
-Edwin
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()]);
}