| Summary: | [implementation] NPE in JavaEditor.handleCursorPositionChanged(JavaEditor.java:3745) | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Boris Bokowski <bokowski> | ||||||||
| Component: | Compare | Assignee: | Platform-Compare-Inbox <platform-compare-inbox> | ||||||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | daniel_megert, g.watson, mauromol, pwebster, stephan.herrmann, tomasz.zarna | ||||||||
| Version: | 3.6 | ||||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| Whiteboard: | stalebug | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Boris Bokowski
This happened when I pasted a patch into the Package Explorer to open the Apply Patch wizard. Since I do this all the time but the NPE hasn't happened before, I don't think I can reproduce. *** Bug 322696 has been marked as a duplicate of this bug. *** *** Bug 284619 has been marked as a duplicate of this bug. *** I'm seeing these every now and then, lately. Once it happened every subsequent save in that editor will throw that NPE. Is CleanUpRefactoring$CleanUpChange.perform() a save action? If so, the list of enabled save actions should be relevant, I have: Organize Imports Update IBM Copyright to current year Add final modifier to private fields Add missing '@Override' annotations Add missing '@Override' annotations to implementations of interface methods Add missing '@Deprecated' annotations Remove unnecessary casts > Is CleanUpRefactoring$CleanUpChange.perform() a save action?
> If so, the list of enabled save actions should be relevant, I have:
Yes.
in I20110803-1800 I'm seeing a shallow dup of this exception: java.lang.NullPointerException at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.handleCursorPositionChanged(JavaEditor.java:3746) at org.eclipse.ui.texteditor.AbstractTextEditor$16.selectionChanged(AbstractTextEditor.java:3134) at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:164) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:162) at org.eclipse.jface.text.TextViewer.fireSelectionChanged(TextViewer.java:2732) at org.eclipse.jface.text.TextViewer.selectionChanged(TextViewer.java:2711) at org.eclipse.jface.text.TextViewer$4.widgetSelected(TextViewer.java:1830) ... further frames differ from comment 0 ... I assume the slight variations in line numbers just reflect the source changes over that last year? This time the bug threw an error dialog at my face *on every keystroke*. Not nice.. While I have no ways of giving steps for reproduction, I hope analysing the broken state might give some insights. Error log shows two earlier incidents: -------------------------- Conflict for 'org.eclipse.compare.copyAllRightToLeft': HandlerActivation(commandId=org.eclipse.compare.copyAllRightToLeft, handler=ActionHandler(org.eclipse.compare.contentmergeviewer.ContentMergeViewer$8@114c74f), expression=AndExpression(ActivePartExpression(org.eclipse.compare.internal.CompareEditor@119884a),WorkbenchWindowExpression(org.eclipse.ui.internal.WorkbenchWindow@18a8bfa)),sourcePriority=1064960) HandlerActivation(commandId=org.eclipse.compare.copyAllRightToLeft, handler=ActionHandler(org.eclipse.compare.contentmergeviewer.ContentMergeViewer$8@129444d), expression=AndExpression(ActivePartExpression(org.eclipse.compare.internal.CompareEditor@119884a),WorkbenchWindowExpression(org.eclipse.ui.internal.WorkbenchWindow@18a8bfa)),sourcePriority=1064960) ----------------------- I have the *feeling* that this always happens when Eclipse starts to go into this kind of bad state. ----------------------- java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.JavaReconciler.uninstall(JavaReconciler.java:345) at org.eclipse.jface.text.source.SourceViewer.unconfigure(SourceViewer.java:705) at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.unconfigure(JavaSourceViewer.java:393) at org.eclipse.jface.text.source.SourceViewer.handleDispose(SourceViewer.java:758) at org.eclipse.jface.text.source.projection.ProjectionViewer.handleDispose(ProjectionViewer.java:1363) at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.handleDispose(JavaSourceViewer.java:502) at org.eclipse.jface.text.TextViewer$2.widgetDisposed(TextViewer.java:1800) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:123) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258) .... ----------------------------------- I suspect that bad state being related to bug 353692. Just as reported in that bug I have closed all compare editors, yet they are still doing lots of background work. Heap dump shows: 6 instances of JavaMergeViewer - for each of these there seems to be an AbstractReconciler.BackgroundThread still running - the JavaMergeViewer has no reference in fSite, so lookup of getSite() will follow this chain: getCompareConfiguration().getContainer().getWorkbenchPart() fCompareConfiguration.fContainer is a org.eclipse.team.internal.ui.mapping.ModelCompareEditorInput this object has no reference in CompareEditorInput.fContainer, thus getWorkbenchPart() must return null. This seems to explain the NPE in JavaReconciler.java:345 Two questions: - could the bad state analysed above also help to explain the subsequent NPE in JavaEditor? Indeed the JavaMergeViewer.CompilationUnitEditorAdaptor has no reference fSourceViewer!! - could missing calls to dispose() as suggested in bug 353692 comment 14 really be the root cause of this bug?? >- could the bad state analysed above also help to explain the subsequent > NPE in JavaEditor? Indeed the JavaMergeViewer.CompilationUnitEditorAdaptor > has no reference fSourceViewer!! >- could missing calls to dispose() as suggested in bug 353692 comment 14 > really be the root cause of this bug?? Once the editor is in a bad state (e.g. partially disposed and then still be used) anything can happen. xref: as mentioned in bug 353692 comment 19 I have reason to believe that actually the fix for bug 348787 might have fixed this bug, too. I'll be back if it re-occurs in a build >= I20110830-1241. *** Bug 403252 has been marked as a duplicate of this bug. *** Created attachment 236666 [details]
The last lines of my log file
Encountered this today with Kepler SR1:
eclipse.buildId=4.3.0.M20130911-1000
java.version=1.7.0_25
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=it_IT
Command-line arguments: -os win32 -ws win32 -arch x86_64
This is a continuation of log file D:\ws\43\k-trunk\.metadata\.bak_0.log
Created Time: 2013-10-17 17:35:36.374
Error
Fri Oct 18 18:14:03 CEST 2013
Problems occurred when invoking code from plug-in: "org.eclipse.jface".
java.lang.NullPointerException
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.handleCursorPositionChanged(JavaEditor.java:3818)
at org.eclipse.ui.texteditor.AbstractTextEditor$16.selectionChanged(AbstractTextEditor.java:3151)
at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:164)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:162)
at org.eclipse.jface.text.TextViewer.fireSelectionChanged(TextViewer.java:2738)
at org.eclipse.jface.text.TextViewer.selectionChanged(TextViewer.java:2717)
at org.eclipse.jface.text.TextViewer.setSelectedRange(TextViewer.java:2402)
at org.eclipse.jface.text.TextViewer$ViewerState.restore(TextViewer.java:1237)
at org.eclipse.jface.text.TextViewer.enabledRedrawing(TextViewer.java:5124)
at org.eclipse.jface.text.TextViewer.enabledRedrawing(TextViewer.java:5099)
at org.eclipse.jface.text.TextViewer.setRedraw(TextViewer.java:5184)
at org.eclipse.jface.text.TextViewer.setRedraw(TextViewer.java:5158)
at org.eclipse.jface.text.TextViewer$RewriteTarget.setRedraw(TextViewer.java:1067)
at org.eclipse.jface.text.TextViewer$DocumentRewriteSessionListener.documentRewriteSessionChanged(TextViewer.java:1478)
at org.eclipse.jface.text.AbstractDocument.fireRewriteSessionChanged(AbstractDocument.java:1559)
at org.eclipse.jface.text.AbstractDocument.stopRewriteSession(AbstractDocument.java:1648)
at org.eclipse.core.internal.filebuffers.SynchronizableDocument.stopRewriteSession(SynchronizableDocument.java:113)
at org.eclipse.ltk.core.refactoring.TextChange.performEdits(TextChange.java:281)
at org.eclipse.ltk.core.refactoring.TextFileChange.access$0(TextFileChange.java:1)
at org.eclipse.ltk.core.refactoring.TextFileChange$1.run(TextFileChange.java:275)
at org.eclipse.ui.internal.editors.text.UISynchronizationContext.run(UISynchronizationContext.java:34)
at org.eclipse.core.internal.filebuffers.TextFileBufferManager.execute(TextFileBufferManager.java:629)
at org.eclipse.ltk.core.refactoring.TextFileChange.performEdits(TextFileChange.java:287)
at org.eclipse.ltk.core.refactoring.TextChange.perform(TextChange.java:238)
at org.eclipse.jdt.internal.corext.fix.CleanUpRefactoring$CleanUpChange.perform(CleanUpRefactoring.java:163)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation$1.run(PerformChangeOperation.java:258)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:306)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:223)
at org.eclipse.jdt.internal.corext.fix.CleanUpPostSaveListener.saved(CleanUpPostSaveListener.java:419)
at org.codehaus.groovy.eclipse.refactoring.actions.DelegatingCleanUpPostSaveListener.saved(DelegatingCleanUpPostSaveListener.java:122)
at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider$5.run(CompilationUnitDocumentProvider.java:1598)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.notifyPostSaveListeners(CompilationUnitDocumentProvider.java:1593)
at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.commitWorkingCopy(CompilationUnitDocumentProvider.java:1380)
at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider$4.execute(CompilationUnitDocumentProvider.java:1458)
at org.eclipse.ui.editors.text.TextFileDocumentProvider$DocumentProviderOperation.run(TextFileDocumentProvider.java:132)
at org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation.execute(WorkspaceModifyDelegatingOperation.java:69)
at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
at org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner.run(WorkspaceOperationRunner.java:75)
at org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner.run(WorkspaceOperationRunner.java:65)
at org.eclipse.ui.editors.text.TextFileDocumentProvider.executeOperation(TextFileDocumentProvider.java:456)
at org.eclipse.ui.editors.text.TextFileDocumentProvider.saveDocument(TextFileDocumentProvider.java:772)
at org.eclipse.ui.texteditor.AbstractTextEditor.performSave(AbstractTextEditor.java:5073)
at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.performSave(CompilationUnitEditor.java:1247)
at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSave(CompilationUnitEditor.java:1301)
at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.doSave(AbstractTextEditor.java:7206)
at org.eclipse.ui.Saveable.doSave(Saveable.java:214)
at org.eclipse.ui.internal.SaveableHelper.doSaveModel(SaveableHelper.java:348)
at org.eclipse.ui.internal.SaveableHelper$3.run(SaveableHelper.java:194)
at org.eclipse.ui.internal.SaveableHelper$5.run(SaveableHelper.java:276)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
at org.eclipse.ui.internal.WorkbenchWindow$13.run(WorkbenchWindow.java:1818)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:1815)
at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:284)
at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:263)
at org.eclipse.ui.internal.SaveableHelper.saveModels(SaveableHelper.java:206)
at org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelper.java:143)
at org.eclipse.ui.internal.WorkbenchPage.saveSaveable(WorkbenchPage.java:3769)
at org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:3782)
at org.eclipse.ui.internal.handlers.SaveHandler.execute(SaveHandler.java:53)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:290)
at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:243)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:224)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:167)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:285)
at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:504)
at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:555)
at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:376)
at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:322)
at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:84)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1056)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1081)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1108)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1104)
at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1525)
at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4723)
at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:344)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4611)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:340)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4977)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
This happened after changing a file and saving.
Previously I had some other exceptions, but I don't know if they're related. I'm attaching the last messages in my log file.
(In reply to Mauro Molinari from comment #10) > This happened after changing a file and saving. > > Previously I had some other exceptions, but I don't know if they're related. > I'm attaching the last messages in my log file. Please add the the complete log for that session. Created attachment 236704 [details]
Complete log
Hi Dani,
this is the complete log of 2013-10-17.
(In reply to Mauro Molinari from comment #12) > Created attachment 236704 [details] > Complete log > > Hi Dani, > this is the complete log of 2013-10-17. This does not include the reported NPE. Created attachment 236758 [details]
Complete log of 2013-10-18
Dani, I'm really sorry, I misread the original exception and took the part of the log of the wrong day (2013-10-17 instead of 2013-10-18). Here is the correct part.
The (In reply to Mauro Molinari from comment #14) > Created attachment 236758 [details] > Complete log of 2013-10-18 > > Dani, I'm really sorry, I misread the original exception and took the part > of the log of the wrong day (2013-10-17 instead of 2013-10-18). Here is the > correct part. Your case is caused by bug 241105. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |