Community
Participate
Working Groups
Using eclipse.buildId=I20081028-0100 java.version=1.6.0_10 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=fr_CA Command-line arguments: -os win32 -ws win32 -arch x86 -debug -consolelog -console, I got this in my .log file while editing a file. Unfortunately no steps to reproduce. java.lang.NullPointerException at org.eclipse.jdt.internal.codeassist.SelectionEngine.findAllTypes(SelectionEngine.java:733) at org.eclipse.jdt.internal.codeassist.SelectionEngine.select(SelectionEngine.java:927) at org.eclipse.jdt.internal.core.Openable.codeSelect(Openable.java:162) at org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:375) at org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:369) at org.eclipse.jdt.internal.ui.javaeditor.JavaElementHyperlinkDetector.detectHyperlinks(JavaElementHyperlinkDetector.java:67) at org.eclipse.ui.texteditor.HyperlinkDetectorRegistry$HyperlinkDetectorDelegate.detectHyperlinks(HyperlinkDetectorRegistry.java:80) at org.eclipse.jface.text.hyperlink.HyperlinkManager.findHyperlinks(HyperlinkManager.java:265) at org.eclipse.jface.text.hyperlink.HyperlinkManager.mouseMove(HyperlinkManager.java:465) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:199) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3848) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3446) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:333) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) 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:370) 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:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1236) at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
I found steps to reproduce a similar bug 1) create an empty X.java 2) copy on the following content in X.java ZZZZZ 3) select ZZZZZ 4) do F3 This exception occurs java.lang.NullPointerException at org.eclipse.jdt.internal.codeassist.SelectionEngine.findAllTypes(SelectionEngine.java:733) at org.eclipse.jdt.internal.codeassist.SelectionEngine.select(SelectionEngine.java:927) at org.eclipse.jdt.internal.core.Openable.codeSelect(Openable.java:162) at org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:375) at org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:369) at org.eclipse.jdt.internal.ui.actions.SelectionConverter.codeResolve(SelectionConverter.java:252) at org.eclipse.jdt.internal.ui.actions.SelectionConverter$1$CodeResolveRunnable.run(SelectionConverter.java:236) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
We should fix for M3 since this is a regression comparing to M2.
Created attachment 116431 [details] Proposed fix This patch add a null check to avoid the NPE.
Philippe, ok to put in 3.5M3 since this is an exception, this a regression comparing to M2 and the fix is trivial ?
+1 for 3.5M3. Discussed in arch call.
Released for 3.5M3. Test added ResolveTests#testEmptyCU1() When i fixed this bug i noticed some issues in SelectionEngine#checkSelection() (see bug 252481)
The bug reference in my previous comment is incorrect it should be bug 252598
Verified for 3.5M4 using I20081208-1800 build