Community
Participate
Working Groups
I'm opening this bug in order to suggest an improvement for https://bugs.eclipse.org/bugs/show_bug.cgi?id=172820 fix. The patch from https://bugs.eclipse.org/bugs/show_bug.cgi?id=172820 is not quite correct: it composes the classpath for Apache Harmony by collecting all jars from $JRE/lib/boot, but it's not quite correct. The better way is to collect all jars from System.getProperty("sun.boot.class.path") - this is where Harmony stores its classpath entries. Otherwise some stub jars from $JRE/lib/boot that are not supposed to be used are put to the classpath, and the $JRE/bin/default/kernel.jar that introduces almost all kernel API is missed. In this case some Eclipse Automated tests fail (org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest.test0641 - 1.5, org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest.test0800 - 1.5) because Eclipse compiler uses this wrong classpath. The same issue for org/eclipse/jdt/internal/compiler/batch/Main.java was fixed in https://bugs.eclipse.org/bugs/show_bug.cgi?id=188648 - please see the patch attached to this issue, it looks to resolve the classpath correctly. But some tests call org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.getDefaultClassPaths() to compose the classpath for compiler and sometimes the stub jar-s in the classpath cause incorrect behavior. I'm attaching the simple patch that substitutes correct classpath for Harmony, but could you also please review the patch for https://bugs.eclipse.org/bugs/show_bug.cgi?id=188648? Thank you!
Created attachment 73099 [details] Patch fixes Harmony classpath issue
Philippe, ok for 3.3.1?
Created attachment 73117 [details] Proposed fix I propose this patch instead. This would match what is done in the batch compiler for all VMs. The bootclasspath property should be used for all VMs, if not found we would revert to the existing heuristic.
Created attachment 73122 [details] Better fix This new patch makes sure that all entries in the bootclasspath property exist. Surprisingly this is not always the case.
(In reply to comment #0) > I'm attaching the simple patch that substitutes correct classpath for Harmony, > but could you also please review the patch for > https://bugs.eclipse.org/bugs/show_bug.cgi?id=188648? Thank you! Did you find something wrong with the patch for bug 188548 ?
Released for 3.4M1.
+1 for 3.3.1
Created attachment 73141 [details] Proposed fix + regression test I had to update a test in the builder tests that made the assumption that classlibs length was 1. So this is the same fix + corresponding test updated.
Released for 3.3.1. Regression tests updated.
The issue is not reproducible on Harmony with the latest version from CVS (HEAD). Thanks.
You might want to use the version from branch R3_3_maintenance.
I actually don't have the Eclipse Automated sources from CVS, just the sources packed into binary bundle (eclipse-Automated-Tests-3.2.zip/eclipse-Automated-Tests-3.3.zip), so I just copy-pasted the lines that were changed from http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java?view=markup, hope that's ok.
Code verified for 3.4M1 using build I20070806-1800.
Code verified for 3.3.1 using build M20070831-2000