Community
Participate
Working Groups
Version: 4.2.0 Build id: I20120608-1400 After the changes in JDK8 b65 to use a new version (52.0) class file format, 6 tests are started to fail in org.eclipse.jdt.core.tests.compiler.regression package: test0308_warn_options - 1.5 test0309_warn_options - 1.5 test0308_warn_options - 1.6 test0309_warn_options - 1.6 test0308_warn_options - 1.7 test0309_warn_options - 1.7 ----------- Expected ------------ ------------ but was ------------ Annotation processing got disabled, since it requires a 1.6 compliant JVM\n --------- Difference is ---------- expected:<[]> but was:<[Annotation processing got disabled, since it requires a 1.6 compliant JVM\n ]> at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertStringEquals(TestCase.java:230) at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertEquals(TestCase.java:206) at org.eclipse.jdt.core.tests.compiler.regression.BatchCompilerTest.runTest(BatchCompilerTest.java:630) at org.eclipse.jdt.core.tests.compiler.regression.BatchCompilerTest.runConformTest(BatchCompilerTest.java:430) at org.eclipse.jdt.core.tests.compiler.regression.BatchCompilerTest.test0308_warn_options(BatchCompilerTest.java:12308) at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(CompilerTestSetup.java:55) at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:501) at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:259) at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:36) at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:32) at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) at org.eclipse.equinox.launcher.Main.run(Main.java:1438) at org.eclipse.equinox.launcher.Main.main(Main.java:1414) at org.eclipse.core.launcher.Main.main(Main.java:34) Reproducible: Always Steps to Reproduce: Use eclipse-Automated-Tests-4.2 to run automated tests with jdk8. 1. Install jdk8 b65 from http://jdk8.java.net/download.html 2. Run jdtcorecompiler tests
Moving to JDT/Core for comment.
Stephan, I don't have access to post b64 JDK versions. Do you see this with b65 or later?
(In reply to comment #2) > Stephan, I don't have access to post b64 JDK versions. Do you see this with > b65 or later? Actually, never mind. I can reproduce it with HEAD and b65 JDK.
Created attachment 224549 [details] Proposed fix This should do. Olivier, do you think anything else is required for the batch compiler?
(In reply to comment #4) > Created attachment 224549 [details] [diff] > Proposed fix > > This should do. > > Olivier, do you think anything else is required for the batch compiler? No, I think this should be good enough. In the code you modify, I would actually replace the 52, 51, 50, ... with the constants from ClassFileConstants. Something like this: private boolean checkVMVersion(long minimalSupportedVersion) { // the format of this property is supposed to be xx.x where x are digits. String classFileVersion = System.getProperty("java.class.version"); //$NON-NLS-1$ if (classFileVersion == null) { // by default we don't support a class file version we cannot recognize return false; } int index = classFileVersion.indexOf('.'); if (index == -1) { // by default we don't support a class file version we cannot recognize return false; } int majorVersion; try { majorVersion = Integer.parseInt(classFileVersion.substring(0, index)); } catch (NumberFormatException e) { // by default we don't support a class file version we cannot recognize return false; } switch(majorVersion) { case ClassFileConstants.MAJOR_VERSION_1_1 : // 1.0 and 1.1 return ClassFileConstants.JDK1_1 >= minimalSupportedVersion; case ClassFileConstants.MAJOR_VERSION_1_2 : // 1.2 return ClassFileConstants.JDK1_2 >= minimalSupportedVersion; case ClassFileConstants.MAJOR_VERSION_1_3 : // 1.3 return ClassFileConstants.JDK1_3 >= minimalSupportedVersion; case ClassFileConstants.MAJOR_VERSION_1_4 : // 1.4 return ClassFileConstants.JDK1_4 >= minimalSupportedVersion; case ClassFileConstants.MAJOR_VERSION_1_5 : // 1.5 return ClassFileConstants.JDK1_5 >= minimalSupportedVersion; case ClassFileConstants.MAJOR_VERSION_1_6 : // 1.6 return ClassFileConstants.JDK1_6 >= minimalSupportedVersion; case ClassFileConstants.MAJOR_VERSION_1_7 : // 1.7 return ClassFileConstants.JDK1_7 >= minimalSupportedVersion; case ClassFileConstants.MAJOR_VERSION_1_8 : return ClassFileConstants.JDK1_8 >= minimalSupportedVersion; } // unknown version return false; }
Created attachment 224610 [details] Patch to use constants instead of literals All tests pass. Will wait till M4 is out before releasing.
Released the fix via commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=5a4b4a5bb82958c7c1b641811ee8d4c999d39c4e
Verified for 4.3 M6 build id: I20130310-2000