Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356090

Summary: Patterns - DeleteFeature hasDone problem
Product: [Modeling] Graphiti Reporter: Volker Wegert <eclipse>
Component: CoreAssignee: Project Inbox <graphiti-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matthias.gorning, michael.wenz
Version: 0.8.0Flags: michael.wenz: juno+
Target Milestone: 0.9.0   
Hardware: All   
OS: All   
Whiteboard: Juno M2 Theme_bugs
Attachments:
Description Flags
screenshot of debugger none

Description Volker Wegert CLA 2011-08-29 10:52:12 EDT
Build Identifier: 20110301-1815 / 0.9.0.v20110818-1338

The pattern implementations use the class DeleteFeatureForPattern that extends DefaultDeleteFeature and therefore contain its own property doneChanges. Following the attribute chain delegate --> pattern --> wrappedDeleteFeature, there's a different instance of DefaultDeleteFeature that handles the actual object deletion and sets its own attribute doneChanges to true. The command stack performs a check to see whether any changes were made, and as far as I can see, it only checks the "outer" DeleteFeatureForPattern instance. The doneChanges attribute of this class is never set to true, so the entire undo stack is reverted. I'll attach a screenshot to illustrate the problem. 

Reproducible: Always
Comment 1 Volker Wegert CLA 2011-08-29 10:52:41 EDT
Created attachment 202330 [details]
screenshot of debugger
Comment 2 Michael Wenz CLA 2011-08-29 10:56:39 EDT
After enabling delete in our SDDT sample this id reproducable
Comment 3 Matthias Gorning CLA 2011-09-09 09:34:58 EDT
Fixed. The "outer" feature delegates the call hasDonechanges() to the "inner" feature/pattern.
Comment 4 Michael Wenz CLA 2012-04-11 10:33:04 EDT
Bookkeeping: Set target release
Comment 5 Michael Wenz CLA 2012-06-28 10:40:53 EDT
Part of Graphiti 0.9.0 (Eclipse Juno)