Community
Participate
Working Groups
Created attachment 171542 [details] The script that produces the NPEs version: 1.2.0.v201006041342-7C78FGDF9JgLWLMLM4Vsye while hovering around in the JS editor I was hit with this gem: java.lang.NullPointerException at org.eclipse.wst.jsdt.internal.compiler.lookup.ArrayBinding.getExactMethod(ArrayBinding.java:233) at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.findExactMethod(Scope.java:401) at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.getMethod(Scope.java:1813) at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:307) at org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration.resolve0(LocalDeclaration.java:234) at org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration.resolve(LocalDeclaration.java:129) at org.eclipse.wst.jsdt.internal.compiler.ast.Block.resolve(Block.java:89) at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:337) at org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:139) at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:291) at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:362) at org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:394) at org.eclipse.wst.jsdt.internal.codeassist.SelectionEngine.select(SelectionEngine.java:733) 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) I have no exact steps other than "try hovering in the attached script". I had opened the root script node from www.google.ca in an editor, and hovering would produce the given NPE constantly. I will attach the script.
That is a very unusual spot for a NPE. My guess is this has something to do with your project set up. Please explain your set up.
(In reply to comment #1) > My guess is this has something to do with your project set up. Please explain > your set up. My setup is very simple. Put the attached script is a normal (non-JavaScript) project and open it with the JSDT editor.
Created attachment 171674 [details] patch - added null checks
This happens when not in a JS project because it cannot resolve the Array type leading to the NPE. If we can't resolve the Array type we need to make sure ArrayBinding does not throw NPE's.
Approving, but should ArrayBinding#getInferredType() ever return null?
Patch checked in. Not sure getInferredType should ever return null. Probably not, but at least it won't throw a NPE for now.
*** Bug 304894 has been marked as a duplicate of this bug. ***