This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | CannotUndoException removes UndoableEdit from undo vector | ||
---|---|---|---|
Product: | platform | Reporter: | Jan Becicka <jbecicka> |
Component: | Text | Assignee: | Miloslav Metelka <mmetelka> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | mmetelka |
Priority: | P2 | ||
Version: | 7.2 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 48427 |
Description
Jan Becicka
2012-01-11 13:29:04 UTC
I can workaround indexOfNextAdd using reflection: try { } catch (CannotUndoException ex) { Field index = javax.swing.undo.UndoManager.class.getDeclaredField("indexOfNextAdd"); index.setAccessible(true); index.setInt(m, index.getInt(m) - 1); } but all UndoableEdits are Wrapped by WrapEdit, which delegates to some saveEdits etc... and I'm not able to recover them from hasBeenDone state. Reassigning to Mila. Both o.o.awt.UndoRedo.Manager and o.o.text.UndoRedoManager are now stable in terms of failing myEdit.undo() or myEdit.redo(). http://hg.netbeans.org/jet-main/rev/b794e7191c99 Integrated into 'main-golden', will be available in build *201203010400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/b794e7191c99 User: Miloslav Metelka <mmetelka@netbeans.org> Log: #207174 - CannotUndoException removes UndoableEdit from undo vector. |