Community
Participate
Working Groups
Using I22080227-1100, I got this stack trace in the .log file. No steps to reproduce so far. Might be related to exposing missing types. java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.invalidField(ProblemReporter.java:3059) at org.eclipse.jdt.internal.codeassist.select.SelectionOnQualifiedNameReference.resolveType(SelectionOnQualifiedNameReference.java:74) at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.resolve(LocalDeclaration.java:186) at org.eclipse.jdt.internal.compiler.ast.Block.resolve(Block.java:101) at org.eclipse.jdt.internal.compiler.ast.Block.resolve(Block.java:101) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:444) at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:191) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:403) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1096) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1175) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1014) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1184) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:534) at org.eclipse.jdt.internal.codeassist.SelectionEngine.select(SelectionEngine.java:699) at org.eclipse.jdt.internal.core.Openable.codeSelect(Openable.java:156) at org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:354) at org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:348) at org.eclipse.jdt.internal.ui.actions.SelectionConverter.codeResolve(SelectionConverter.java:252) at org.eclipse.jdt.internal.ui.actions.SelectionConverter.codeResolve(SelectionConverter.java:143) at org.eclipse.jdt.internal.ui.actions.SelectionConverter.codeResolve(SelectionConverter.java:128) at org.eclipse.mylyn.internal.java.ui.JavaEditingMonitor.handleWorkbenchPartSelection(JavaEditingMonitor.java:87) at org.eclipse.mylyn.monitor.ui.AbstractUserInteractionMonitor.selectionChanged(AbstractUserInteractionMonitor.java:66) at org.eclipse.ui.internal.AbstractSelectionService.firePostSelection(AbstractSelectionService.java:179) at org.eclipse.ui.internal.AbstractSelectionService$2.selectionChanged(AbstractSelectionService.java:71) at org.eclipse.jface.text.TextViewer.firePostSelectionChanged(TextViewer.java:2582) at org.eclipse.jface.text.TextViewer.firePostSelectionChanged(TextViewer.java:2534) at org.eclipse.jface.text.TextViewer$5.run(TextViewer.java:2513) at org.eclipse.swt.widgets.Display.runTimer(Display.java:3835) at org.eclipse.swt.widgets.Display.messageProc(Display.java:3041) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2333) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3369) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2402) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2366) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2232) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:476) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:471) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:107) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:77) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:362) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175) 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've found steps. Given: package test; public class Event { public int x; public void handle(Event e) { e.x. e.| } } 1. Replace '|' with cursor 2. Ctrl-Space Is: NPE is thrown
Olivier's trace looks like a codeselect operation. Strangely enough the line number is not telling much (see line >> below) if ((field.declaringClass.tagBits & TagBits.HasMissingType) != 0) { this.handle( IProblem.UndefinedType, new String[] {new String(field.declaringClass.readableName())}, new String[] {new String(field.declaringClass.shortReadableName())}, nameRef.sourceStart, nameRef.sourceEnd); >> return; }
Actually, Benno, your testcase is really good. public class Event { public int x; public void handle(Event e) { e.x. e.foo(); } } Selecting on 'e' (the 2nd occurrence acting as receiver for #foo()) reproduces exactly Olivier's trace.
(In reply to comment #3) > Actually, Benno, your testcase is really good. Thank you:-) Actually this can happen easily: I've typed '.' instead of ',' by mistake.
Added CompletionTests#testInvalidField1-2 Added ResolveTests#testInvalidField1-2
Created attachment 91624 [details] Proposed patch
Released for 3.4M6 Fixed
Verified for 3.4M6 using I20080324-1300.