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

Bug 316960

Summary: NPE hovering in source
Product: [WebTools] JSDT Reporter: Michael Rennie <Michael_Rennie>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: RESOLVED WORKSFORME QA Contact: Victor Rubezhny <vrubezhny>
Severity: normal    
Priority: P3 CC: cmjaun
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
URL: https://www.eclipse.org/forums/index.php/t/1082067/
Whiteboard:
Attachments:
Description Flags
source none

Description Michael Rennie CLA 2010-06-15 15:04:31 EDT
JSDT 1.2.0.v201006041342-7C78FGDF9JgLWLMLM4Vsye

Hovering in the attached source on line 45 over "SocketTransport." will cause the following NPE:

java.lang.NullPointerException
at org.eclipse.wst.jsdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo(JavadocHover.java:198)
at org.eclipse.wst.jsdt.internal.ui.text.java.hover.AbstractJavaEditorTextHover.getHoverInfo(AbstractJavaEditorTextHover.java:116)
at org.eclipse.wst.jsdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo(BestMatchHover.java:99)
at org.eclipse.wst.jsdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy.getHoverInfo(JavaEditorTextHoverProxy.java:67)
at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:168)

The source file is in a normal non-JavaScript project
Comment 1 Michael Rennie CLA 2010-06-15 15:05:16 EDT
Created attachment 171978 [details]
source
Comment 2 Chris Jaun CLA 2010-06-21 15:43:48 EDT
I don't see an error when I hover over SocketTransport, but I do see the following when I hover over its prototype attribute...

JavaScript Model Exception: JavaScript Model Status [prototype [in Object [in system.js [in C:/DevWorkspaces/runtime-New_configuration//metadata//plugins/org/eclipse/wst/jsdt/core/libraries/system/js [in C:\DevWorkspaces\runtime-New_configuration\.metadata\.plugins\org.eclipse.wst.jsdt.core\libraries\system.js]]]] does not exist]
	at org.eclipse.wst.jsdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:519)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:550)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.getElementInfo(JavaElement.java:283)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.getElementInfo(JavaElement.java:269)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.exists(JavaElement.java:179)
	at org.eclipse.wst.jsdt.internal.core.SelectionRequestor.acceptField(SelectionRequestor.java:240)
	at org.eclipse.wst.jsdt.internal.codeassist.SelectionEngine.selectFrom(SelectionEngine.java:876)
	at org.eclipse.wst.jsdt.internal.codeassist.SelectionEngine.select(SelectionEngine.java:744)
	at org.eclipse.wst.jsdt.internal.core.Openable.codeSelect(Openable.java:167)
	at org.eclipse.wst.jsdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:318)
	at org.eclipse.wst.jsdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:312)
	at org.eclipse.wst.jsdt.internal.ui.text.java.hover.AbstractJavaEditorTextHover.getHoverInfo(AbstractJavaEditorTextHover.java:108)
	at org.eclipse.wst.jsdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo(BestMatchHover.java:99)
	at org.eclipse.wst.jsdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy.getHoverInfo(JavaEditorTextHoverProxy.java:67)
	at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:168)
JavaScript Model Exception: JavaScript Model Status [prototype [in Object [in system.js [in C:/DevWorkspaces/runtime-New_configuration//metadata//plugins/org/eclipse/wst/jsdt/core/libraries/system/js [in C:\DevWorkspaces\runtime-New_configuration\.metadata\.plugins\org.eclipse.wst.jsdt.core\libraries\system.js]]]] does not exist]
	at org.eclipse.wst.jsdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:519)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:550)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.getElementInfo(JavaElement.java:283)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.getElementInfo(JavaElement.java:269)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.exists(JavaElement.java:179)
	at org.eclipse.wst.jsdt.internal.core.SelectionRequestor.acceptField(SelectionRequestor.java:240)
	at org.eclipse.wst.jsdt.internal.codeassist.SelectionEngine.selectFrom(SelectionEngine.java:876)
	at org.eclipse.wst.jsdt.internal.codeassist.SelectionEngine.select(SelectionEngine.java:744)
	at org.eclipse.wst.jsdt.internal.core.Openable.codeSelect(Openable.java:167)
	at org.eclipse.wst.jsdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:318)
	at org.eclipse.wst.jsdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:312)
	at org.eclipse.wst.jsdt.internal.ui.text.java.hover.AbstractJavaEditorTextHover.getHoverInfo(AbstractJavaEditorTextHover.java:108)
	at org.eclipse.wst.jsdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo(BestMatchHover.java:99)
	at org.eclipse.wst.jsdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy.getHoverInfo(JavaEditorTextHoverProxy.java:67)
	at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:168)
Comment 3 Chris Jaun CLA 2010-06-21 15:44:06 EDT
Ian...see my comment.
Comment 4 Chris Jaun CLA 2010-06-22 16:06:48 EDT
This may have been fixed by some recent 3.2.1 or late 3.2 RC fixes. Ian and I both attempted to reproduce in a JavaScript and Non-JavaScript project.

I got hover help on SocketTransport and no error over prototype(with patches applied).