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

Bug 425005

Summary: NPE in EmptyCompletionProposal.getCamelCaseCompound
Product: z_Archived Reporter: Andreas Sewe <sewe>
Component: RecommendersAssignee: Andreas Sewe <sewe>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Andreas Sewe CLA 2014-01-07 07:29:12 EST
The following stack trace shows up in the Error Log when completing on "sysout". Debugging the currently running Eclipse instance showed that the AbstractJavaCompletionProposal in question was the EmptyCompletionProposal:

Caused by: java.lang.NullPointerException
at org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal.getCamelCaseCompound(AbstractJavaCompletionProposal.java:876)
at org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal.getPrefixCompletionText(AbstractJavaCompletionProposal.java:723)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.completeCommonPrefix(CompletionProposalPopup.java:1643)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$35(CompletionProposalPopup.java:1607)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup$14.run(CompletionProposalPopup.java:1582)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.incrementalComplete(CompletionProposalPopup.java:1565)
at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1686)
at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:183)
at org.eclipse.ui.texteditor.ContentAssistAction$1.run(ContentAssistAction.java:82)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.texteditor.ContentAssistAction.run(ContentAssistAction.java:80)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:120)
... 65 more

I am not entirely sure what the root cause of this problem is (Johannes hasn't been able to reproduce this in his install).

Also, DiscoverCompletionProposal may suffer from the same problem. Will investigate further.
Comment 1 Andreas Sewe CLA 2014-01-07 07:50:15 EST
Fix in Gerrit: <https://git.eclipse.org/r/#/c/20330/>.
Comment 2 Andreas Sewe CLA 2014-01-08 08:22:23 EST
Fix merged: <https://git.eclipse.org/r/#/c/20330/>
Comment 3 Andreas Sewe CLA 2014-01-08 08:45:14 EST
Latest head solves the problem for me.