Bug 12374 - NPE in ResultCollector
Summary: NPE in ResultCollector
Status: RESOLVED 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.0 M6   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-27 13:40 EST by Michael Fraenkel CLA
Modified: 2002-05-16 15:04 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Fraenkel CLA 2002-03-27 13:40:17 EST
0321 Stable Win32

I was typing in the editor when an Internal Error pop-up appeared:
java.lang.NullPointerException
	at 
org.eclipse.jdt.internal.ui.text.java.ResultCollector.createMethodCompletion
(ResultCollector.java:317)
	at 
org.eclipse.jdt.internal.ui.text.java.ResultCollector.createMethodCallCompletio
n(ResultCollector.java:329)
	at org.eclipse.jdt.internal.ui.text.java.ResultCollector.acceptMethod
(ResultCollector.java:205)
	at 
org.eclipse.jdt.internal.core.CompletionRequestorWrapper.acceptMethod
(CompletionRequestorWrapper.java:178)
	at 
org.eclipse.jdt.internal.codeassist.CompletionEngine.findLocalMethods
(CompletionEngine.java:1675)
	at 
org.eclipse.jdt.internal.codeassist.CompletionEngine.findIntefacesMethods
(CompletionEngine.java:1457)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.findMethods
(CompletionEngine.java:1898)
	at 
org.eclipse.jdt.internal.codeassist.CompletionEngine.findFieldsAndMethods
(CompletionEngine.java:1195)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete
(CompletionEngine.java:352)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete
(CompletionEngine.java:806)
	at org.eclipse.jdt.internal.core.Openable.codeComplete
(Openable.java:113)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete
(CompilationUnit.java:84)
	at 
org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor.computeCompletion
Proposals(JavaCompletionProcessor.java:340)
	at 
org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposal
s(ContentAssistant.java:1197)
	at 
org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals
(CompletionProposalPopup.java:103)
	at 
org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$3
(CompletionProposalPopup.java:102)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup$1.run
(CompletionProposalPopup.java:71)
	at org.eclipse.swt.custom.BusyIndicator.showWhile
(BusyIndicator.java:56)
	at 
org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals
(CompletionProposalPopup.java:66)
	at 
org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions
(ContentAssistant.java:1132)
	at 
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$InternalSourceView
er.doOperation(CompilationUnitEditor.java:152)
	at org.eclipse.ui.texteditor.TextOperationAction.run
(TextOperationAction.java:61)
	at org.eclipse.ui.texteditor.RetargetTextEditorAction.run
(RetargetTextEditorAction.java:103)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
	at 
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:407)
	at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java(Compiled Code))
	at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java(Compiled Code))
	at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java(Compiled Code))
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java
(Compiled Code))
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled 
Code))
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java
(Compiled Code))
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java
(Compiled Code))
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java
(Compiled Code))
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:705)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:777)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:196)
	at org.eclipse.core.launcher.Main.run(Main.java:555)
	at org.eclipse.core.launcher.Main.main(Main.java:396)
Comment 1 Erich Gamma CLA 2002-03-30 07:01:09 EST
not clear whether this in the code assist UI or whether we are getting an 
incorrect completion proposal.
Comment 2 Kai-Uwe Maetzel CLA 2002-04-02 03:36:37 EST
Added guards to ResultCollector. However, the information passed into the 
result collector should not be null. Moving to JDT core.
Comment 3 Philipe Mulet CLA 2002-04-02 09:22:11 EST
Could be a #sourceName() from a type binding (problem one?) ?
Comment 4 David Audel CLA 2002-05-16 03:43:29 EDT
method.returnType.qualifiedSourceName() inside 
CompletionEngine#findLocalMethods return null

I can not reproduce this problem and guards was added to ResultCollector.

Later.
Comment 5 David Audel CLA 2002-05-16 15:03:34 EDT
The problem occur when the return type of a binary method is unresolved.
Comment 6 David Audel CLA 2002-05-16 15:04:08 EDT
The bugs is in BinaryTypeBinding#availableMethods.
The correct code must be 'return availableMethods;' and not 'return methods;'

Fixed.