Bug 84444 - OperationHistory and "invalid" operations
Summary: OperationHistory and "invalid" operations
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Susan McCourt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-04 10:56 EST by Dirk Baeumer CLA
Modified: 2005-03-30 14:58 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2005-02-04 10:56:52 EST
When executing, undoing or redoing an operation the history should check if the
operation can still be undone or redone. If not the stack should be flushed
instead of adding a not executable operation to it.
Comment 1 Dirk Baeumer CLA 2005-02-04 10:57:32 EST
Affected methods: exeute, doUndo, doRedo.
Comment 2 Susan McCourt CLA 2005-02-06 21:51:25 EST
In the current implementation:
- on execute, the history checks whether the operation can be executed.  If it 
cannot, it is not added to the history and an ERROR status (INVALID OPERATION) 
is reported.
- on undo and redo, the operation is already in the history.  The history 
checks whether the operation canXxx.  If it cannot, an ERROR status (INVALID 
OPERATION) is reported and the operation is removed from the history.
- on add, the operation is assumed to have already been executed, so no checks 
are performed.

When an invalid operation is discovered, we don't flush in the framework 
because we don't assume that all other operations are invalid.  We leave 
the "aggressiveness" of maintaining the history up to the application.  The 
action handlers DO flush when the error status is returned.

Please advise how this is different than you were expecting.  (Note:  there 
was a bug in execute() in the open composite case where the invalid check was 
not done.  Perhaps that is what you saw that triggered this bug?)  
Comment 3 Dirk Baeumer CLA 2005-02-07 04:31:27 EST
I am talking about the reverse operation. For example: after successfully
executing an operation the history can check if the operation can be undone. If
not the history shouldn't add the operation to the undo stack since undoing it
will not be possible in the future. Same for doUndo and doRedo. 

I agree that flushing the stack is too aggressive here. 
Comment 4 Susan McCourt CLA 2005-02-07 12:46:02 EST
Since the canXxxx methods are fast, I don't see a problem with adding this 
conservatism.  The execute, doUndo, and doRedo methods have been updated for 
the 0209 IBuild.  The spec for execute on IOperationHistory will not be updated 
since we do not want to encourage clients to execute operations that cannot be 
undone.  I will keep the existing language that says "if successful, the 
operation will be added to the history."
Comment 5 Susan McCourt CLA 2005-02-26 10:57:41 EST
This was implemented for M5 but keeping this bug open until refactoring 
integration is complete and tested during M6 cycle.
Comment 6 Susan McCourt CLA 2005-03-27 14:42:28 EST
this bug has been fixed in M6 cycle.
Comment 7 Susan McCourt CLA 2005-03-30 14:58:16 EST
verified on I20050330-0500