| Summary: | [EMF Change Model] applyAndReverse generates ChangeDescription with references to not contained objects | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Cyril Jaquier <cyril.jaquier> | ||||||
| Component: | Core | Assignee: | Ed Merks <Ed.Merks> | ||||||
| Status: | RESOLVED INVALID | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | ||||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Cyril Jaquier
Created attachment 173842 [details]
Test case v1
Sorry, there are some whitespace changes in the patch :-(
Created attachment 173860 [details]
Remove changes for not contained objects
This is an attempt at fixing this bug by removing changes for object that are not contained. This patch makes my previous test case pass but breaks ManualRecorderTest#testRecord1.
Again sorry for the whitespace changes in the patch but it seems that the code format changed since 2008. I'm using the formatter template from HEAD.
The change recorder is properly recording the state changes and restoring them. Both n2 and n3 are dangling references in the initial state. If we didn't record their changes, then two applyAndReverse calls wouldn't produce the correct final state so undo-redo would be broken. Of course in any specific application you'd be free to filter the objects, checking for recorded changes to dangling references, and remove those from the result, but I don't think the framework should just enforce that. Thank you Ed. Ok, it makes sense. In my case, I don't need to record such changes so I will filter them in my ChangeRecorder. Could you just have a quick look at my patch and tell me if eliminateNotContained looks good? The condition root.eContainer() == null will necessarily always be true for the result of getRootContainer for a well formed instance. Otherwise it looks fine. (In reply to comment #5) > The condition root.eContainer() == null will necessarily always be true for the > result of getRootContainer for a well formed instance. Otherwise it looks > fine. Thank you very much Ed. |