Community
Participate
Working Groups
N20070303-0010 and N20070304-0010 In latest N-builds, there are 4 test failures in org.eclipse.jdt.text.tests.contentassist.MethodParameterGuessingCompletionTest With jdt.core v_739 (remove JME from IClassFile#getType()), the tests are passing. First failure trace: expected:<... null; fList.add([obj])bar } private ja...> but was:<... null; fList.add([bar])bar } private ja...> junit.framework.ComparisonFailure: expected:<... null; fList.add([obj])bar } private ja...> but was:<... null; fList.add([bar])bar } private ja...> at org.eclipse.jdt.text.tests.contentassist.AbstractCompletionTest.assertProposal(AbstractCompletionTest.java:300) at org.eclipse.jdt.text.tests.contentassist.AbstractCompletionTest.assertMethodBodyProposal(AbstractCompletionTest.java:194) at org.eclipse.jdt.text.tests.contentassist.MethodParameterGuessingCompletionTest.testInsertMethodWithParam1(MethodParameterGuessingCompletionTest.java:57) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) at junit.extensions.TestSetup$1.protect(TestSetup.java:21) at junit.extensions.TestSetup.run(TestSetup.java:25) at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:332) at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:202) at org.eclipse.test.UITestApplication$3.run(UITestApplication.java:195) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3644) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3284) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2306) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2270) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2145) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:460) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:455) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:101) at org.eclipse.test.UITestApplication.runApplication(UITestApplication.java:138) at org.eclipse.test.UITestApplication.run(UITestApplication.java:60) at org.eclipse.test.UITestApplication.start(UITestApplication.java:210) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:146) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:476) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:416) at org.eclipse.equinox.launcher.Main.run(Main.java:1124) at org.eclipse.equinox.launcher.Main.main(Main.java:1099) at org.eclipse.core.launcher.Main.main(Main.java:24)
These failures are caused by the fix for bug 162865. I forgot to run jdt/text tests before release the fix and i didn't see the bug in my fix. To guess parameters jdt/txt call jdt/core code assist at the beginning of the completed line. eg. package test1; public class Completion_testInsertMethodWithParam1<T> { public void testMethod(int param) { int foo= 3; Object obj= null; | fList.bar //code assist called at | } private java.util.List fList; } In this case jdt/core code assist has a bug and propose 'bar' as an unresolved simple name (bug 162865) but 'bar' is preceded by '.' so isn't a simple name. A simpler test case is public class X { void foo() { | zzz1.zzz2 //do ctrl+space at | } } zzz2 is proposed and should not.
Created attachment 60275 [details] Proposed fix
Released for 3.3M6. Test added CompletionTests#testNameWithUnresolvedReferences011()
Verified for 3.3 M6 using build I20070320-0010.