Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 430867

Summary: Test Case reports different set of errors for JRE 1.7 and JRE 1.8
Product: [Eclipse Project] JDT Reporter: shankha banerjee <shankhba>
Component: CoreAssignee: shankha banerjee <shankhba>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, shankhba, srikanth_sankaran
Version: 4.4   
Target Milestone: 4.4 M7   
Hardware: PC   
OS: All   
URL: http://download.eclipse.org/eclipse/downloads/drops4/N20140320-2000/testresults/html/org.eclipse.jdt.core.tests.compiler_win32.win32.x86_7.0.html
Whiteboard:

Description shankha banerjee CLA 2014-03-21 06:57:17 EDT
Build ID: N20140320-2000
Platform Windows.
Test Results:

http://download.eclipse.org/eclipse/downloads/drops4/N20140320-2000/testresults/html/org.eclipse.jdt.core.tests.compiler_win32.win32.x86_7.0.html

test429110 - 1.7
junit.framework.ComparisonFailure: Invalid problem log .
----------- Expected ------------
----------\n
1. ERROR in X.java (at line 7)\n
List<@NonNull String> foo(List<@NonNull String> arg) {\n
^^^^^^^^\n
Syntax error, type annotations are available only when source level is at least 1.8\n
----------\n
2. ERROR in X.java (at line 7)\n
List<@NonNull String> foo(List<@NonNull String> arg) {\n
^^^^^^^^\n
Syntax error, type annotations are available only when source level is at least 1.8\n
----------\n

------------ but was ------------
----------\n
1. ERROR in X.java (at line 5)\n
@Target(ElementType.TYPE_USE)\n
^^^^^^^^\n
TYPE_USE cannot be resolved or is not a field\n
----------\n
2. ERROR in X.java (at line 7)\n
List<@NonNull String> foo(List<@NonNull String> arg) {\n
^^^^^^^^\n
Syntax error, type annotations are available only when source level is at least 1.8\n
----------\n
3. ERROR in X.java (at line 7)\n
List<@NonNull String> foo(List<@NonNull String> arg) {\n
^^^^^^^^\n
Syntax error, type annotations are available only when source level is at least 1.8\n
----------\n

--------- Difference is ----------
expected:<... in X.java (at line [7)\n
List<@NonNull String> foo(List<@NonNull String> arg) {\n
^^^^^^^^\n
Syntax error, type annotations are available only when source level is at least 1.8\n
----------\n
2]. ERROR in X.java (a...> but was:<... in X.java (at line [5)\n
@Target(ElementType.TYPE_USE)\n
^^^^^^^^\n
TYPE_USE cannot be resolved or is not a field\n
----------\n
2. ERROR in X.java (at line 7)\n
List<@NonNull String> foo(List<@NonNull String> arg) {\n
^^^^^^^^\n
Syntax error, type annotations are available only when source level is at least 1.8\n
----------\n
3]. ERROR in X.java (a...>
at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertStringEquals(TestCase.java:250)
at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertEquals(TestCase.java:226)
at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.checkCompilerLog(AbstractRegressionTest.java:1074)
at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runTest(AbstractRegressionTest.java:2624)
at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runTest(AbstractRegressionTest.java:2425)
at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runNegativeTest(AbstractRegressionTest.java:2063)
at org.eclipse.jdt.core.tests.compiler.parser.ComplianceDiagnoseTest.test429110(ComplianceDiagnoseTest.java:3382)
at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(CompilerTestSetup.java:55)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:657)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:310)
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:133)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:103)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:378)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:232)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1462)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
at org.eclipse.core.launcher.Main.main(Main.java:34)


==========================================================================

The issue is nightly is run with the JRE 1.7. Generally while 1.8 defects we run the tests with JRE 1.8. 

Different set of errors are thrown up in both cases.
Comment 1 Jay Arthanareeswaran CLA 2014-03-21 07:10:36 EDT
This is expected, as we are supposed to be running the tests with 1.8, but for the timing being they are run with 1.7. Eventually we will upgrade to 1.8.

TYPE_USE is not available with a JRE 1.7 so, the error is indeed as expected. There's a releng bug (bug 425071) for upgrading to 1.8 JRE.

I suggest we close this bug, unless the issue is something else.
Comment 2 shankha banerjee CLA 2014-03-21 07:42:06 EDT

*** This bug has been marked as a duplicate of bug 425071 ***
Comment 3 Jay Arthanareeswaran CLA 2014-03-24 09:21:06 EDT
Shankha, I was wrong earlier. We should take another look at the failing test. If we are using ElementType.TYPE_USE, then we should not allow this test be run at 1.7. Please fix the test.
Comment 4 Jay Arthanareeswaran CLA 2014-03-26 08:43:28 EDT
Fixed the failing test via:

http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=0df9f1687f9162f2dcdfeec3aed4b01b8d385a19
Comment 5 Jay Arthanareeswaran CLA 2014-04-29 08:53:55 EDT
All reported tests have been running fine with both 1.7 and 1.8 JRE in builds since fixed.

Verified for 4.4 M7 with build I20140428-2000