Bug 25820 - NPE in Code Assist
Summary: NPE in Code Assist
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M3   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-07 08:53 EST by David Audel CLA
Modified: 2002-11-13 05:31 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Audel CLA 2002-11-07 08:53:22 EST
1) create class X (Y type does not exist)
public class X {
   void foo(){
      Y var = new <cursor>
   }
}
2) do ctrl+space at cursor location
an NPE occur

stacktrace:
java.lang.NullPointerException
	at java.lang.String.<init>(String.java:165)
	at org.eclipse.jdt.internal.ui.text.java.ResultCollector.acceptClass
(ResultCollector.java:81)
	at org.eclipse.jdt.internal.core.CompletionRequestorWrapper.acceptClass
(CompletionRequestorWrapper.java:68)
	at 
org.eclipse.jdt.internal.codeassist.CompletionEngine.findTypesAndPackages
(CompletionEngine.java:2315)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete
(CompletionEngine.java:402)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete
(CompletionEngine.java:842)
	at org.eclipse.jdt.internal.core.Openable.codeComplete
(Openable.java:124)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete
(CompilationUnit.java:101)
	at 
org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor.internalComputeCom
pletionProposals(JavaCompletionProcessor.java:342)
	at 
org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor.computeCompletionP
roposals(JavaCompletionProcessor.java:300)
	at 
org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals
(ContentAssistant.java:1279)
	at 
org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals
(CompletionProposalPopup.java:177)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$7
(CompletionProposalPopup.java:176)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup$3.run
(CompletionProposalPopup.java:138)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:65)
	at 
org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals
(CompletionProposalPopup.java:133)
	at 
org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions
(ContentAssistant.java:1199)
	at 
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer
.doOperation(CompilationUnitEditor.java:234)
	at org.eclipse.ui.texteditor.ContentAssistAction$1.run
(ContentAssistAction.java:84)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:65)
	at org.eclipse.ui.texteditor.ContentAssistAction.run
(ContentAssistAction.java:82)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:769)
	at org.eclipse.ui.internal.WWinKeyBindingService.invoke
(WWinKeyBindingService.java:134)
	at org.eclipse.ui.internal.WWinKeyBindingService.pressed
(WWinKeyBindingService.java:109)
	at org.eclipse.ui.internal.WWinKeyBindingService$5.widgetSelected
(WWinKeyBindingService.java:336)
	at org.eclipse.ui.internal.AcceleratorMenu$2.handleEvent
(AcceleratorMenu.java:53)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:825)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1692)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1410)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1419)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:1402)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:831)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:432)
	at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)
Comment 1 David Audel CLA 2002-11-07 09:29:08 EST
'expectedTypes' must be valid types.

Fixed.
Comment 2 David Audel CLA 2002-11-13 05:31:48 EST
Verified.