Community
Participate
Working Groups
Build Identifier: Build id: M20120208-0800 NullPointerException occures under certain circumstances when pointing a text cursor into a string value like the following 'print'. See the stack trace: !ENTRY org.eclipse.jface.text 4 0 2012-05-05 20:29:57.762 !MESSAGE Unexpected runtime error while computing a text hover !STACK 0 java.lang.NullPointerException at org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy(CompilationUnitScope.java:669) at org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy(CompilationUnitScope.java:674) at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:387) at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:443) at org.eclipse.wst.jsdt.internal.core.CompilationUnitProblemFinder.accept(CompilationUnitProblemFinder.java:174) at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.askForBinding(LookupEnvironment.java:279) at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:132) at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.getType(LookupEnvironment.java:766) at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.getResolvedType(LookupEnvironment.java:720) at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.getJavaLangString(Scope.java:1745) at org.eclipse.wst.jsdt.core.dom.DefaultBindingResolver.resolveExpressionType(DefaultBindingResolver.java:604) at org.eclipse.wst.jsdt.core.dom.Expression.resolveTypeBinding(Expression.java:111) at org.eclipse.wst.jsdt.internal.corext.refactoring.nls.NLSHintHelper.getAccessorClassReference(NLSHintHelper.java:97) at org.eclipse.wst.jsdt.internal.ui.text.java.hover.NLSStringHover.getHoverInfo(NLSStringHover.java:96) at org.eclipse.wst.jsdt.internal.ui.text.java.hover.AbstractJavaEditorTextHover.getHoverInfo2(AbstractJavaEditorTextHover.java:95) at org.eclipse.wst.jsdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:147) at org.eclipse.wst.jsdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy.getHoverInfo2(JavaEditorTextHoverProxy.java:78) at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:166) Reproducible: Always Steps to Reproduce: 1. Create a JavaScript project. Add the JS-file attached to the project and open it in JavaScript Editor 2. Find some String value in the text like 'print' and select it by clicking left mouse button. 3. Close the editor (the best chance to reproduce the issue is when the editor is just opened) 3. See the Error log.
Created attachment 215128 [details] JS-File to reproduce the issue JavaScript file to reproduce the issue is OverLibWS_print.js taken from issue #375703
Created attachment 215130 [details] The patch fixes the issue The patch just adds an additional check for null for classScope field of inferred type binding (if found in connectTypeHierarchy(char[][] typeNames) method).
Sorry, looks like a duplication of #359005
Comment on attachment 215130 [details] The patch fixes the issue Marking the patch as obsolete, since the double check for nulls doesn't solves the root problem. IMHO, this issue could be closed as duplicate of #359005. The only steps to reproduce could be used from this issue.
*** This bug has been marked as a duplicate of bug 359005 ***