[Compare] undo/apply with several DiffElement [message #103548] |
Thu, 22 November 2007 10:41 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: firstname.name.gmail.com
Hey,
I am using compare for a project. I have to apply/undo several DiffElement. To
do that, I collect all the elements of a diffModel, if this element is a
DiffElement and not a DiffGroup, then I call the merger:
for(TreeIterator<EObject> iterator=diffModel.eAllContents();iterator.hasNext();){
eObject = iterator.next();
if ((eObject instanceof DiffElement) && !(eObject instanceof DiffGroup)){
merger = MergeFactoryCopy.createMerger((DiffElement) eObject);
merger.applyInOrigin();
}
}
I have some problems with values of a reference that have changed to a an added
element. When I debug it, I can see that the value is changed to element A, but
next, element A is removed, and a copy of element A is added. Reference is then
lost...
BTW:
1. I had to modify the merger. Is it possible to consider the package
org.eclipse.emf.compare.diff.generic.merge.impl as an exported one.
2. I did certainly something wrong, but I also modified
removeDanglingReferences() to make sure that the feature to remove is not an
instance of InternalEList.Unsettable (for instance a derived union)
thanks.
--
F. Lagarde
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04146 seconds