Bug 262721 - Logged NPE on hover of 'confirm'
Summary: Logged NPE on hover of 'confirm'
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.0.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0.5   Edit
Assignee: Chris Jaun CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords: contributed
: 259169 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-01-28 05:30 EST by Chris West (Faux) CLA
Modified: 2010-03-03 11:16 EST (History)
0 users

See Also:
thatnitind: review+


Attachments
Fixes the invalid error message (2.15 KB, patch)
2009-04-01 13:38 EDT, Chris Jaun CLA
thatnitind: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris West (Faux) CLA 2009-01-28 05:30:33 EST
Build ID: M20080911-1700

Steps To Reproduce:
1. Create a .js file containing "confirm;"
2. Mouse-over the word "confirm".
3. Observe the error log.

The error below is logged.

Also,
1| function f() {
2|   var r = confirm("Pony?");
3|   return r;
4| }

gives "Cannot return a void result" on line 3, I guess this is related.

Logged error:
java.lang.NullPointerException
	at org.eclipse.wst.jsdt.internal.compiler.lookup.ClassScope.buildInferredType(ClassScope.java:1254)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope.buildSuperType(CompilationUnitScope.java:431)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope.buildTypeBindings(CompilationUnitScope.java:366)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.buildTypeBindings(LookupEnvironment.java:245)
	at org.eclipse.wst.jsdt.internal.core.hierarchy.HierarchyResolver.accept(HierarchyResolver.java:146)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.addUnitsContainingBinding(LookupEnvironment.java:185)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope.buildTypeBindings(CompilationUnitScope.java:357)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.buildTypeBindings(LookupEnvironment.java:245)
	at org.eclipse.wst.jsdt.internal.core.hierarchy.HierarchyResolver.accept(HierarchyResolver.java:146)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.addUnitsContainingBinding(LookupEnvironment.java:185)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope.buildTypeBindings(CompilationUnitScope.java:357)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.buildTypeBindings(LookupEnvironment.java:245)
	at org.eclipse.wst.jsdt.internal.core.hierarchy.HierarchyResolver.accept(HierarchyResolver.java:146)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:119)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:49)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:107)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.BinaryTypeBinding.superclass(BinaryTypeBinding.java:938)
	at org.eclipse.wst.jsdt.internal.core.hierarchy.HierarchyResolver.resolve(HierarchyResolver.java:658)
	at org.eclipse.wst.jsdt.internal.core.hierarchy.HierarchyBuilder.buildSupertypes(HierarchyBuilder.java:126)
	at org.eclipse.wst.jsdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.build(IndexBasedHierarchyBuilder.java:152)
	at org.eclipse.wst.jsdt.internal.core.hierarchy.TypeHierarchy.compute(TypeHierarchy.java:325)
	at org.eclipse.wst.jsdt.internal.core.hierarchy.TypeHierarchy.refresh(TypeHierarchy.java:1273)
	at org.eclipse.wst.jsdt.internal.core.CreateTypeHierarchyOperation.executeOperation(CreateTypeHierarchyOperation.java:90)
	at org.eclipse.wst.jsdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:742)
	at org.eclipse.wst.jsdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:802)
	at org.eclipse.wst.jsdt.internal.core.SourceType.newSupertypeHierarchy(SourceType.java:669)
	at org.eclipse.wst.jsdt.internal.core.SourceType.newSupertypeHierarchy(SourceType.java:645)
	at org.eclipse.wst.jsdt.ui.JSdocContentAccess.findDocInHierarchy(JSdocContentAccess.java:171)
	at org.eclipse.wst.jsdt.ui.JSdocContentAccess.getContentReader(JSdocContentAccess.java:104)
	at org.eclipse.wst.jsdt.ui.JSdocContentAccess.getHTMLContentReader(JSdocContentAccess.java:146)
	at org.eclipse.wst.jsdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo(JavadocHover.java:169)
	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)

eclipse.buildId=M20080911-1700
java.version=1.6.0_11
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB
Command-line arguments:  -os win32 -ws win32 -arch x86

ftp://ftp.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/webtools/downloads/drops/R3.0/M-3.0.4-20090124030800/wtp-M-3.0.4-20090124030800.zip
Comment 1 Chris Jaun CLA 2009-04-01 13:38:02 EDT
Created attachment 130590 [details]
Fixes the invalid error message
Comment 2 Chris Jaun CLA 2009-04-01 13:39:42 EDT
I never saw the NPE on hover, but this fixes the invalid error message.

Should be fixed in 3.0.5 and 3.1.
Comment 3 Chris Jaun CLA 2009-04-01 13:52:33 EDT
*** Bug 259169 has been marked as a duplicate of this bug. ***
Comment 4 Nitin Dahyabhai CLA 2009-04-02 01:53:00 EDT
Applied to 3.1m7
Comment 5 Nitin Dahyabhai CLA 2009-04-13 15:26:24 EDT
Applied to 3.0.5.  Thanks, Chris.