| Summary: | [1.7] Add Java 7 support for API Tools | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] PDE | Reporter: | Michael Rennie <Michael_Rennie> | ||||||||||||
| Component: | API Tools | Assignee: | Michael Rennie <Michael_Rennie> | ||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||||
| Severity: | enhancement | ||||||||||||||
| Priority: | P1 | CC: | ankur_sharma, curtis.windatt.public, daniel_megert, darin.eclipse, deepakazad, kim.moir, Olivier_Thomann | ||||||||||||
| Version: | 3.7 | ||||||||||||||
| Target Milestone: | 3.7.1 | ||||||||||||||
| Hardware: | All | ||||||||||||||
| OS: | All | ||||||||||||||
| Whiteboard: | |||||||||||||||
| Bug Depends on: | 349706 | ||||||||||||||
| Bug Blocks: | |||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
Michael Rennie
I'll take care of the API description part for JavaSE-1.7 EE. I have branched api.tools and api.tools.tests for BETA_JAVA7 Created attachment 198040 [details]
update
This patch makes sure we are creating the correct level of AST in API tools. Our ASTVisitors should not need updating as we only care about types (TypeDeclaration, etc) and Javadoc nodes.
I get NPEs from the non-plugin JUnit tests: java.lang.NullPointerException at org.eclipse.pde.api.tools.model.tests.ClassFileScannerTests.getRefSet(ClassFileScannerTests.java:55) at org.eclipse.pde.api.tools.model.tests.ClassFileScannerTests.testScanInnerStaticInnerClass(ClassFileScannerTests.java:205) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:243) at junit.framework.TestSuite.run(TestSuite.java:238) at junit.framework.TestSuite.runTest(TestSuite.java:243) at junit.framework.TestSuite.run(TestSuite.java:238) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) (In reply to comment #4) > I get NPEs from the non-plugin JUnit tests: The plug-in test suite is even worse: 201 failures + 7 errors after only having run 400 tests. All of the tests pass on the IBM 1.7 VM, but fail on the Oracle 1.7 VM: java version "1.7.0-ea" Java(TM) SE Runtime Environment (build 1.7.0-ea-b145) Java HotSpot(TM) 64-Bit Server VM (build 21.0-b15, mixed mode) That Oracle VM probably has a JIT bug which we already reported to Oracle. Please retry with -Xint. If that's not the case then verify that your tests don't depend on the order. Plug-in tests all pass using Sun VM with -Xint argument (In reply to comment #8) > Plug-in tests all pass using Sun VM with -Xint argument I had mistakenly run the tests on the wrong VM. Rerunning them resulted in two failures in the preference tests (seems like configuration problems, not VM problems). junit.framework.AssertionFailedError: The value for RESTRICTION_NOINSTANTIATE should be 'Error' expected:<2> but was:<1> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:283) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:195) at org.eclipse.pde.api.tools.util.tests.PreferencesTests.testGetNonDefaultValue(PreferencesTests.java:78) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:243) at junit.framework.TestSuite.run(TestSuite.java:238) at junit.framework.TestSuite.runTest(TestSuite.java:243) at junit.framework.TestSuite.run(TestSuite.java:238) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62) at org.eclipse.pde.internal.junit.runtime.PlatformUITestHarness$1.run(PlatformUITestHarness.java:47) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3561) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3210) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.runApp(NonUIThreadTestApplication.java:54) at org.eclipse.pde.internal.junit.runtime.UITestApplication.runApp(UITestApplication.java:41) at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.start(NonUIThreadTestApplication.java:48) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) 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:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410) at org.eclipse.equinox.launcher.Main.main(Main.java:1386) I get no NPEs or failures from the Non-plugin tests when run with -Xint (In reply to comment #10) > I get no NPEs or failures from the Non-plugin tests when run with -Xint -Xint also resolves my failures, although I also do not see the PreferencesTests failure. I opened a new bug (bug 349706) to track those failures because it is a problem with the tests. Status update: 1) Olivier is still planning to create the API Description 2) New tests could be added 3) Tests pass with the fix on bug 349706 4) Patch for updating AST creation is applied and functioning correctly I will discuss (2) more with Mike when he returns. Ankur will be working on adding builder tests. Created attachment 198770 [details]
Proposed fix
Fix to support the JavaSE-1.7 description. The fragment is ready. I'll see how I can release this into the branch only.
(In reply to comment #14) > Created attachment 198770 [details] [diff] > Proposed fix Released. > Fix to support the JavaSE-1.7 description. The fragment is ready. I'll see how > I can release this into the branch only. The fragment will be released once we find out if this can be done before Java 7 is out. Created attachment 198868 [details]
Builder Tests v1
This patch adds a number of new builder usage tests to test Java 7. Tests Try with resources, String switch statements, and Multi-Catch. We still need at least one test case for diamond operator (not sure about polymorphic methods?).
I will apply these tests to the branch. The tests can only run if you have a Java 7 JRE available.
Added diamond operator tests to the builder suite. Marking fixed. All the AST handling has been updated and tested. All of the new code patterns have been tested and added to our builder test suite. Verified most of it but it looks like the EE description for 1.7 is not in the feature patch repo. Olivier, am I right here? (In reply to comment #19) > Verified most of it but it looks like the EE description for 1.7 is not in the > feature patch repo. Olivier, am I right here? Yes, it is missing because I could not find the feature it belongs to. I'll talk with DJ to find out what the best way to add it is. Created attachment 200411 [details]
patch for merging BETA_JAVA7 branch
Re-opening so I can attach the patches for merging the branch back into HEAD and 3.7.1
Created attachment 200412 [details]
patch for merging into 3.7.1
The patch for HEAD has been committed. the patch for 3.7.1 has been committed. marking fixed. *** Bug 288841 has been marked as a duplicate of this bug. *** The EE description for 1.7 is still not available on the update site. Updating the description in the update site and adding org.eclipse.pde.api.tools.ee.javase17 fragment to the org.eclipse.pde.api.tools.ee.fragments feature is covered in bug 353365. |