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

Bug 526601

Summary: NPE while computing debug hover on captured variable
Product: [Eclipse Project] JDT Reporter: Andrey Loskutov <loskutov>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.8   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/110696
Whiteboard: stalebug

Description Andrey Loskutov CLA 2017-10-28 10:31:57 EDT
Start debugging some lambda, which captures some variables. Inside lambda, hover the mouse over such variable and enjoy an error in the log:

java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.util.HashtableOfObjectToInt.put(HashtableOfObjectToInt.java:93)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:765)
	at org.eclipse.jdt.core.dom.ASTParser.createBindings(ASTParser.java:1059)
	at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverBinding(JavadocHover.java:926)
	at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getInfoText(JavadocHover.java:809)
	at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo(JavadocHover.java:752)
	at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.internalGetHoverInfo(JavadocHover.java:675)
	at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo2(JavadocHover.java:667)
	at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:164)
	at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:130)
	at org.eclipse.jdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy.getHoverInfo2(JavaEditorTextHoverProxy.java:86)
	at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:166)

Funny enough, this happens only if the project has the NPE analysis enabled.
Unfortunately I forgot to capture the right snippet causing the issue, but this was some code from plugins in the platform I was debugging.
Comment 1 Eclipse Genie CLA 2017-10-28 10:35:02 EDT
New Gerrit change created: https://git.eclipse.org/r/110696
Comment 2 Eclipse Genie CLA 2020-04-07 14:35:42 EDT
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.