-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
6
-
Cause Known
-
generic
-
generic
The description of the method UndoableEdit.addEdit(UndoableEdit anEdit) has the following assertion:
"If true is returned, from now on anEdit must return false from canUndo and canRedo, and must throw the appropriate exception on undo or redo."
This assertion needs some clarification. Imagine that anEdit was added. It means that anEdit is subedit of some UndoableEdit (CompoundEdit for example) edit. In order to make undo/redo the main edit has to do it on subedits too. From above assertion it follows that anEdit will be dead after absorbing (at least for AbstractUndoableEdit, if canRedo(), canUndo() return false then alive property is false). And it makes no sense to call undo/redo on it. So it looks like any added edits will be lost for later undo/redo operations (it'll cause CannotUn(Re)doException).
At least the implementation of CompoundEdit class does not follow above assertion. Added edit is continuing to be alive.
###@###.### 2005-2-21 15:39:07 GMT
"If true is returned, from now on anEdit must return false from canUndo and canRedo, and must throw the appropriate exception on undo or redo."
This assertion needs some clarification. Imagine that anEdit was added. It means that anEdit is subedit of some UndoableEdit (CompoundEdit for example) edit. In order to make undo/redo the main edit has to do it on subedits too. From above assertion it follows that anEdit will be dead after absorbing (at least for AbstractUndoableEdit, if canRedo(), canUndo() return false then alive property is false). And it makes no sense to call undo/redo on it. So it looks like any added edits will be lost for later undo/redo operations (it'll cause CannotUn(Re)doException).
At least the implementation of CompoundEdit class does not follow above assertion. Added edit is continuing to be alive.
###@###.### 2005-2-21 15:39:07 GMT