Bug 25233 - NPE in CompletionParser.buildMoreCompletionContext
Summary: NPE in CompletionParser.buildMoreCompletionContext
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 major (vote)
Target Milestone: 2.1 M3   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-23 06:20 EDT by Jerome Lanneluc CLA
Modified: 2002-11-13 04:45 EST (History)
0 users

See Also:


Attachments
ClasspathTest.java (60.36 KB, text/plain)
2002-10-23 06:21 EDT, Jerome Lanneluc CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jerome Lanneluc CLA 2002-10-23 06:20:32 EDT
Build 20021022

1. Replace ClasspathTests with the attached version
2. Position the cursor in testDeleteProjectSetCPAnotherProject() where 
indicated.
3. Ctrl-Space
Observe: You get the following NPE:
java.lang.NullPointerException
        at 
org.eclipse.jdt.internal.codeassist.complete.CompletionParser.buildMoreCompletio
nContext(CompletionParser.java:207)
        at 
org.eclipse.jdt.internal.codeassist.complete.CompletionParser.attachOrphanComple
tionNode(CompletionParser.java:167)
        at 
org.eclipse.jdt.internal.codeassist.complete.CompletionParser.updateRecoveryStat
e(CompletionParser.java:1555)
        at org.eclipse.jdt.internal.compiler.parser.Parser.resumeOnSyntaxError
(Parser.java:7440)
        at org.eclipse.jdt.internal.compiler.parser.Parser.parse
(Parser.java:6793)
        at 
org.eclipse.jdt.internal.codeassist.impl.AssistParser.parseBlockStatements
(AssistParser.java:853)
        at 
org.eclipse.jdt.internal.codeassist.impl.AssistParser.parseBlockStatements
(AssistParser.java:767)
        at org.eclipse.jdt.internal.codeassist.impl.Engine.parseMethod
(Engine.java:166)
        at org.eclipse.jdt.internal.codeassist.impl.Engine.parseMethod
(Engine.java:135)
        at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete
(CompletionEngine.java:813)
        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:66)
        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:226)
        at org.eclipse.ui.texteditor.ContentAssistAction$1.run
(ContentAssistAction.java:84)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:66)
        at org.eclipse.ui.texteditor.ContentAssistAction.run
(ContentAssistAction.java:82)
        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:325)
        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:833)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1622)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1368)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1420)
        at org.eclipse.ui.internal.Workbench.run(Workbench.java:1403)
        at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:775)
        at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462)
        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:324)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:247)
        at org.eclipse.core.launcher.Main.run(Main.java:703)
        at org.eclipse.core.launcher.Main.main(Main.java:539)
Comment 1 Jerome Lanneluc CLA 2002-10-23 06:21:49 EDT
Created attachment 2255 [details]
ClasspathTest.java
Comment 2 David Audel CLA 2002-10-23 11:29:55 EDT
Null check added

Fixed.
Comment 3 David Audel CLA 2002-11-13 04:45:57 EST
Verified.