Bug 162939 - [EditorMgmt] Navigation history does not handle editor reuse if editor input is not persistable
Summary: [EditorMgmt] Navigation history does not handle editor reuse if editor input ...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted, usability
: 295046 413505 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-31 12:03 EST by John Arthorne CLA
Modified: 2021-03-26 13:53 EDT (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2006-10-31 12:03:45 EST
Build: I20061031-0656

1) Open the sync view with several outgoing changes
2) Click on several files in succession so that the compare editor gets reused
3) Close the compare editor
4) Hit Alt+Back arrow to go back in the navigation history

An error occurs reopening the compare editor:

java.lang.NullPointerException
	at org.eclipse.compare.CompareConfiguration.getImage(CompareConfiguration.java:266)
	at org.eclipse.compare.contentmergeviewer.TextMergeViewer$Diff.getImage(TextMergeViewer.java:965)
	at org.eclipse.compare.contentmergeviewer.TextMergeViewer.updateControls(TextMergeViewer.java:3273)
	at org.eclipse.compare.contentmergeviewer.TextMergeViewer.setCurrentDiff(TextMergeViewer.java:4276)
	at org.eclipse.compare.contentmergeviewer.TextMergeViewer.selectFirstDiff(TextMergeViewer.java:3643)
	at org.eclipse.compare.contentmergeviewer.TextMergeViewer.updateContent(TextMergeViewer.java:2331)
	at org.eclipse.compare.contentmergeviewer.ContentMergeViewer.internalRefresh(ContentMergeViewer.java:701)
	at org.eclipse.compare.contentmergeviewer.ContentMergeViewer.inputChanged(ContentMergeViewer.java:603)
	at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:250)
	at org.eclipse.jdt.internal.ui.compare.JavaMergeViewer.setInput(JavaMergeViewer.java:134)
	at org.eclipse.compare.CompareViewerSwitchingPane.setInput(CompareViewerSwitchingPane.java:300)
	at org.eclipse.compare.CompareEditorInput$12.run(CompareEditorInput.java:582)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.compare.CompareEditorInput.feed1(CompareEditorInput.java:577)
	at org.eclipse.compare.CompareEditorInput.feedInput(CompareEditorInput.java:572)
	at org.eclipse.compare.CompareEditorInput.createContents(CompareEditorInput.java:424)
	at org.eclipse.compare.internal.CompareEditor.createPartControl(CompareEditor.java:191)
	at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:596)
	at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:372)
	at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566)
	at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:214)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2571)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2504)
	at org.eclipse.ui.internal.WorkbenchPage.access$10(WorkbenchPage.java:2496)
	at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2481)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2476)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2461)
	at org.eclipse.ui.internal.NavigationHistoryEntry.restoreLocation(NavigationHistoryEntry.java:66)
	at org.eclipse.ui.internal.NavigationHistory.gotoEntry(NavigationHistory.java:398)
	at org.eclipse.ui.internal.NavigationHistory.shiftEntry(NavigationHistory.java:449)
	at org.eclipse.ui.internal.NavigationHistory.backward(NavigationHistory.java:433)
	at org.eclipse.ui.internal.NavigationHistoryAction.run(NavigationHistoryAction.java:201)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
	at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:119)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:461)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:424)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:160)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:465)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:791)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:838)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:563)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:505)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:122)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1005)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:924)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:949)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:934)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:962)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:958)
	at org.eclipse.swt.widgets.Widget.wmSysKeyDown(Widget.java:2316)
	at org.eclipse.swt.widgets.Control.WM_SYSKEYDOWN(Control.java:4125)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:3443)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4145)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1989)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3075)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1924)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1888)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:348)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:165)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:615)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:341)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:285)
	at org.eclipse.core.launcher.Main.run(Main.java:987)
	at org.eclipse.core.launcher.Main.main(Main.java:962)
Comment 1 Tod Creasey CLA 2006-11-27 09:52:58 EST
Is this is Vista specific problem?
Comment 2 Michael Valenta CLA 2006-12-08 12:55:15 EST
This bug is not Vista specific.
Comment 3 Michael Valenta CLA 2006-12-08 13:13:55 EST
This is a bug in the workbench. The CompareEditorInput returns false in the exists method to indicate that the editor should not appear in the Editor MRU list after the editor is closed. But when a compare editor is reused (i.e. opening several files from the sync view reuses the same editor) and then closed, this seems to throw off the list so that the compare editor stays in there even though it has been closed. Reopening the editor then causes an NPE since the editor was not designed to be reopened (more specifically, the editor input was not designed to be reopened).
Comment 4 Susan McCourt CLA 2009-07-09 19:09:10 EDT
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
Comment 5 Boris Bokowski CLA 2009-11-17 13:04:36 EST
Remy is now responsible for watching the [EditorMgmt] component area.
Comment 6 Tomasz Zarna CLA 2009-11-19 06:13:49 EST
Bug 295046 is very similar to this one, maybe even a duplicate. I've just moved it to Platform/UI.
Comment 7 Dani Megert CLA 2009-12-16 06:59:11 EST
*** Bug 295046 has been marked as a duplicate of this bug. ***
Comment 8 Dani Megert CLA 2009-12-16 07:04:52 EST
> The CompareEditorInput returns false in the exists method 
This is not the point but it returns false in CompareEditorInput.getPersistable().

This is a general issue of the navigation history in combination with reusing editors on non-persistable input: since the history only stores the editor ID and editor input, it cannot handle this case correctly. The NavigationHistoryEditorInfo should have a reference to the editor as long as the editor is open.
Comment 9 Remy Suen CLA 2009-12-16 07:42:46 EST
Some shuffling around but back to me it seems.
Comment 10 Eclipse Genie CLA 2018-10-11 18:35:57 EDT
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.

If you have further information on the current state of the bug, please add it. 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.
Comment 11 Lars Vogel CLA 2018-11-15 06:17:40 EST
(In reply to Dani Megert from comment #8)

> This is a general issue of the navigation history in combination with
> reusing editors on non-persistable input: since the history only stores the
> editor ID and editor input, it cannot handle this case correctly. The
> NavigationHistoryEditorInfo should have a reference to the editor as long as
> the editor is open.

I experience frequently that the navigation history is not correct. Super annoying.
Comment 12 Lars Vogel CLA 2018-11-15 09:38:03 EST
*** Bug 413505 has been marked as a duplicate of this bug. ***
Comment 13 Eclipse Genie CLA 2021-03-26 13:53:59 EDT
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.