| Summary: | [exceptions] NPE when can't parse contents | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] JSDT | Reporter: | Patric Rufflar <patric> | ||||||||
| Component: | Web | Assignee: | Project Inbox <jsdt.web-inbox> | ||||||||
| Status: | RESOLVED WORKSFORME | QA Contact: | Chris Jaun <cmjaun> | ||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | broneubanks, eclipse-2021.bugzilla, jules, marshall.scorcio, Michael_Rennie, p.malishev, philipp, remy.suen, sinedanat, stetson.a, thatnitind, todd, vrubezhny | ||||||||
| Version: | 3.2.3 | ||||||||||
| Target Milestone: | Future | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows XP | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Patric Rufflar
I got a similar exception which might help: JavaScript Model Exception: java.lang.NullPointerException at org.eclipse.wst.jsdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:298) at org.eclipse.wst.jsdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:320) at org.eclipse.wst.jsdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:197) at org.eclipse.wst.jsdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:96) 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.CompilationUnit.reconcile(CompilationUnit.java:1202) at org.eclipse.wst.jsdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:95) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.wst.jsdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:76) at org.eclipse.wst.jsdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:143) at org.eclipse.wst.jsdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:85) at org.eclipse.wst.jsdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:94) at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77) at org.eclipse.wst.jsdt.internal.ui.text.JavaReconciler.process(JavaReconciler.java:371) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206) Caused by: java.lang.NullPointerException at org.eclipse.wst.jsdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:265) ... 15 more Caused by: java.lang.NullPointerException at org.eclipse.wst.jsdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:265) at org.eclipse.wst.jsdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:320) at org.eclipse.wst.jsdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:197) at org.eclipse.wst.jsdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:96) 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.CompilationUnit.reconcile(CompilationUnit.java:1202) at org.eclipse.wst.jsdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:95) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.wst.jsdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:76) at org.eclipse.wst.jsdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:143) at org.eclipse.wst.jsdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:85) at org.eclipse.wst.jsdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:94) at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77) at org.eclipse.wst.jsdt.internal.ui.text.JavaReconciler.process(JavaReconciler.java:371) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206) Created attachment 193698 [details]
file which will reproduce the bug
jsp to reproduce the bug. either open it in wtp, or copy and paste it into a new jsp editor.
additional note to my previous attachement: The test case reproduces a bug which might be different from the initial bug report/comment. I had been confused, sorry. Maybe we should open another bug report for the provided test case. Created attachment 194736 [details]
file which will reproduce the bug
This time providing the correct test case.
Just open the file within WTP to see the exception in your error log.
*** Bug 342980 has been marked as a duplicate of this bug. *** *** Bug 334393 has been marked as a duplicate of this bug. *** *** Bug 361944 has been marked as a duplicate of this bug. *** Reproducible on Eclipse SDK 3.7.2 (M20120208-0800) with JavaScript Development Tools 1.3.2 (20120210195245). Occurs quite often, sometimes more than once while editing a single line, and therefore is very annoying. This happens so often I almost cannot use eclipse to edit javascript. Is there a work-around? Or can the priority be upped? I agree with Todd Chaffee - I can't use Eclipse for edit javascript files. It is still reproduced in Eclipse 4.2.0 too. It's a great pity. Attaching a simpler test case that reproduces the problem. Stack trace is below (eclipse.buildId=I20120608-1400): 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.code.flow.ReturnFlowInfo.getReturnFlag(ReturnFlowInfo.java:31) at org.eclipse.wst.jsdt.internal.corext.refactoring.code.flow.ReturnFlowInfo.<init>(ReturnFlowInfo.java:19) at org.eclipse.wst.jsdt.internal.corext.refactoring.code.flow.FlowAnalyzer.createReturn(FlowAnalyzer.java:151) at org.eclipse.wst.jsdt.internal.corext.refactoring.code.flow.FlowAnalyzer.endVisit(FlowAnalyzer.java:679) at org.eclipse.wst.jsdt.core.dom.ReturnStatement.accept0(ReturnStatement.java:141) at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354) at org.eclipse.wst.jsdt.internal.corext.refactoring.code.flow.InOutFlowAnalyzer.perform(InOutFlowAnalyzer.java:41) at org.eclipse.wst.jsdt.internal.ui.search.MethodExitsFinder.markReferences(MethodExitsFinder.java:122) at org.eclipse.wst.jsdt.internal.ui.search.MethodExitsFinder.perform(MethodExitsFinder.java:92) at org.eclipse.wst.jsdt.internal.ui.javaeditor.JavaEditor.updateOccurrenceAnnotations(JavaEditor.java:2840) at org.eclipse.wst.jsdt.internal.ui.javaeditor.JavaEditor$7.selectionChanged(JavaEditor.java:2905) at org.eclipse.wst.jsdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:157) at org.eclipse.wst.jsdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run(SelectionListenerWithASTManager.java:134) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Created attachment 219097 [details] Simpler test case (see comment 11) (In reply to comment #11) > Attaching a simpler test case that reproduces the problem. Stack trace is > below (eclipse.buildId=I20120608-1400): > > java.lang.NullPointerException > at > org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope. > connectTypeHierarchy(CompilationUnitScope.java:669) This looks identical to the stack trace in Bug 359005 Still happening in JSDT 1.6.x: java.lang.NullPointerException at org.eclipse.wst.jsdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:280) at org.eclipse.wst.jsdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:335) at org.eclipse.wst.jsdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:197) at org.eclipse.wst.jsdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:96) 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.CompilationUnit.reconcile(CompilationUnit.java:1272) at org.eclipse.wst.jsdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:95) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.wst.jsdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:76) at org.eclipse.wst.jsdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:143) at org.eclipse.wst.jsdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:85) at org.eclipse.wst.jsdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:94) at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77) at org.eclipse.wst.jsdt.internal.ui.text.JavaReconciler.process(JavaReconciler.java:371) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206) Load the following file in your workspace to reproduce: https://raw.githubusercontent.com/Microsoft/TypeScript/master/bin/typescriptServices.js Whoa... 4 years passed since the bug was submitted! Is there any kind of workaround? Eclipse eats all my CPUs and throws this error on each file save attempt. I cannot reproduce any of exceptions by using the examples attached. Also, the line information in stacktraces is pretty outdated. So, closing this issue with one exception: Bug #467319 is created with a fresh stacktrace attached. It looks like other exceptions aren't reproducible anymore. Please, feel free to open new issues with fresh stacktraces and steps to reproduce (if possible). |