Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 340800

Summary: [content assist] NPE in CompletionEngine.findExceptionFromTryStatement(..) when throws clause has a conditional expression
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Ayushman Jain <amj87.iitr>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: srikanth_sankaran
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Markus Keller CLA 2011-03-23 16:09:37 EDT
BETA_JAVA7

Content assist needs to be fixed / implemented for disjunctive types. In the example from bug 340059 comment 7, when I invoke content assist after Ex of ExceptionB here, I get no proposals:

        } catch (/*final*/ ExceptionA | ExceptionB ex) {

If I do the same after Ex of ExceptionA, I get an NPE:

java.lang.NullPointerException
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.findExceptionFromTryStatement(CompletionEngine.java:5699)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.findExceptionFromTryStatement(CompletionEngine.java:5873)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.completionOnSingleTypeReference(CompletionEngine.java:3233)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:1641)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:1863)
	at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:130)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:357)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:345)
	at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposalComputer.internalComputeCompletionProposals(JavaCompletionProposalComputer.java:244)
	at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposalComputer.computeCompletionProposals(JavaCompletionProposalComputer.java:206)
	at org.eclipse.jdt.internal.ui.text.java.JavaTypeCompletionProposalComputer.computeCompletionProposals(JavaTypeCompletionProposalComputer.java:61)
	at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:318)
	at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:267)
	at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:283)
	at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:243)
	at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1830)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:556)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:553)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:488)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:482)
	at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1656)
	at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:183)
	at org.eclipse.ui.texteditor.ContentAssistAction$1.run(ContentAssistAction.java:82)
Comment 1 Srikanth Sankaran CLA 2011-03-24 01:20:09 EDT
See also bug 338789.
Comment 2 Ayushman Jain CLA 2011-03-29 04:02:11 EDT
>If I do the same after Ex of ExceptionA, I get an NPE.
I noticed that this is a bug on HEAD and doesnt really have to do anything with disjunctive types.
>when I invoke content assist after Ex of ExceptionB here, I get no proposals:
This will be handled via bug 338789

Hence, changing the description of this bug
Comment 3 Eclipse Genie CLA 2019-03-04 17:15:29 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.