| Summary: | [linked mode] Pressing undo during rename refactoring fails and reverts all recent changes | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Tobias Oberlies <t-oberlies> |
| Component: | Text | Assignee: | Platform-Text-Inbox <platform-text-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | daniel_megert, markus.kell.r |
| Version: | 3.5 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | stalebug | ||
This is a problem in the Linked Mode implementation. The Undo is not propagated to the other linked positions because AbstractDocument#fAcceptPostNotificationReplaces is false and thus the other changes are dropped at the location shown below. See also bug 77575. Thread [main] (Suspended) owns: Object (id=13951) SynchronizableDocument(AbstractDocument).registerPostNotificationReplace(IDocumentListener, IDocumentExtension$IReplace) line: 1340 LinkedModeModel$DocumentListener.documentChanged(DocumentEvent) line: 238 SynchronizableDocument(AbstractDocument).doFireDocumentChanged2(DocumentEvent) line: 769 SynchronizableDocument(AbstractDocument).doFireDocumentChanged(DocumentEvent, boolean, IRegion) line: 736 SynchronizableDocument(AbstractDocument).doFireDocumentChanged(DocumentEvent) line: 721 SynchronizableDocument(AbstractDocument).fireDocumentChanged(DocumentEvent) line: 796 SynchronizableDocument(AbstractDocument).replace(int, int, String, long) line: 1191 SynchronizableDocument.replace(int, int, String, long) line: 194 DocumentUndoManager$UndoableTextChange.undoTextChange() line: 144 DocumentUndoManager$UndoableTextChange.undo(IProgressMonitor, IAdaptable) line: 264 DefaultOperationHistory.doUndo(IProgressMonitor, IAdaptable, IUndoableOperation) line: 417 DefaultOperationHistory.undo(IUndoContext, IProgressMonitor, IAdaptable) line: 1282 UndoActionHandler.runCommand(IProgressMonitor) line: 78 OperationHistoryActionHandler$4.run(IProgressMonitor) line: 311 ModalContext.runInCurrentThread(IRunnableWithProgress, IProgressMonitor) line: 464 ModalContext.run(IRunnableWithProgress, boolean, IProgressMonitor, Display) line: 372 TimeTriggeredProgressMonitorDialog(ProgressMonitorDialog).run(boolean, boolean, IRunnableWithProgress) line: 507 TimeTriggeredProgressMonitorDialog.access$6(TimeTriggeredProgressMonitorDialog, boolean, boolean, IRunnableWithProgress) line: 1 TimeTriggeredProgressMonitorDialog$2.run() line: 203 BusyIndicator.showWhile(Display, Runnable) line: 70 TimeTriggeredProgressMonitorDialog.run(boolean, boolean, IRunnableWithProgress) line: 216 UndoActionHandler(OperationHistoryActionHandler).run() line: 326 UndoActionHandler(Action).runWithEvent(Event) line: 498 ActionHandler.execute(Map) line: 185 LegacyHandlerWrapper.execute(ExecutionEvent) line: 109 Command.executeWithChecks(ExecutionEvent) line: 476 ParameterizedCommand.executeWithChecks(Object, Object) line: 508 HandlerService.executeCommand(ParameterizedCommand, Event) line: 169 WorkbenchKeyboard.executeCommand(Binding, Event) line: 468 WorkbenchKeyboard.press(List, Event) line: 786 WorkbenchKeyboard.processKeyEvent(List, Event) line: 885 WorkbenchKeyboard.filterKeySequenceBindings(Event) line: 567 WorkbenchKeyboard.access$3(WorkbenchKeyboard, Event) line: 508 WorkbenchKeyboard$KeyDownFilter.handleEvent(Event) line: 123 EventTable.sendEvent(Event) line: 89 Display.filterEvent(Event) line: 1262 StyledText(Widget).sendEvent(Event) line: 1061 StyledText(Widget).sendEvent(int, Event, boolean) line: 1086 StyledText(Widget).sendEvent(int, Event) line: 1071 StyledText(Widget).sendKeyEvent(int, int, int, int, Event) line: 1113 StyledText(Widget).sendKeyEvent(int, int, int, int) line: 1109 StyledText(Widget).wmChar(int, int, int) line: 1518 StyledText(Control).WM_CHAR(int, int) line: 4623 StyledText(Canvas).WM_CHAR(int, int) line: 345 StyledText(Control).windowProc(int, int, int, int) line: 4511 StyledText(Canvas).windowProc(int, int, int, int) line: 341 Display.windowProc(int, int, int, int) line: 4970 OS.$$YJP$$CallWindowProcW(int, int, int, int, int) line: not available [native method] OS.CallWindowProcW(int, int, int, int, int) line: not available OS.CallWindowProc(int, int, int, int, int) line: 2420 BidiUtil.windowProc(int, int, int, int) line: 639 OS.$$YJP$$DispatchMessageW(MSG) line: not available [native method] OS.DispatchMessageW(MSG) line: not available OS.DispatchMessage(MSG) line: 2526 Display.readAndDispatch() line: 3750 Deepak, please investigate. > See also bug 77575.
This one is not directly related. The bug got introduced during 3.5 and most likely not by a change in linked mode but by a fix for the rename refactoring.
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. If the bug is still relevant, please remove the "stalebug" whiteboard tag. |
I know that I could have done this differently - and I agree that this does not need to work - but trying the following steps should not lead to data loss: Initial situation: a) I have changes in the undo history of a class b) The following code exists in the class private void abc() { String newname = "a"; oldname += "bc"; System.out.println(oldname); // more uses of oldname } Steps to reproduce: 1) Copy "oldname", select "newname", hit CTRL+V 2) CTRL+SHIFT+R -> linked edit of all occurrences of "oldname" 3) CTRL+Z -> only variable declaration changes to "newname", other occurrences of "oldname" are unchanged 4) ENTER -> an error dialog appears (which is kind of expected) 5) Confirm the dialog And this is the bug: All recend changes are undone, i.e. including everything I did before step 1! I realized later that I could have recovered my changes through Redo, but at that point I was so confused that I eventually typed something and lost my changes.