3 way comparison with DifferenceFilter [message #1820973] |
Mon, 03 February 2020 17:44 |
Anthony Giang Messages: 2 Registered: February 2020 |
Junior Member |
|
|
Hi,
I am applying a filter to a 3 way comparison and was wondering if the filter should show differences for the left compared to origin, and right compared to origin, or if the filter only applies if either of the left/right has a difference with the origin.
In the screenshot I have attached, the origin shows "monotonous", left shows "monotonous2" with whitespace, and right shows "monotonous" with white space. I have a filter that filters out no semantic differences, so whitespace in this example. So I would expect that only the left should show differences in this example. What's happening in my tool currently is that the filter is only applied if both have no differences instead of one or the other. This is because of the way the code is, because I couldn't figure out how to implement it if it were possible.
My first question is whether or not this functionality is included in EMF Compare, where I can see filter being applied to the left and right, and only showing differences.
My second question is how to go about implementing this. I am unsure where to start with this.
Thank you
-
Attachment: diff.PNG
(Size: 1.49KB, Downloaded 108 times)
|
|
|
Re: 3 way comparison with DifferenceFilter [message #1821273 is a reply to message #1820973] |
Mon, 10 February 2020 08:21 |
|
Hello Anthony,
I am not sure whether this is a question for EMF Compare or platform compare since what you're showing here is a textual difference. I'll assume it is a conflict in the textual value of a string attribute.
The case you're showing here is a conflict : left value differs from origin, and right value differs from origin. In such a case a manual resolution of the conflict is necessary, so I'll assume showing the whitespace changes is the best way to allow users to understand exactly what happened for this conflict.
If you do not want EMF Compare to detect this conflict, what you need to redefine is the IEqualityHelper, from which you will have to override org.eclipse.emf.compare.utils.IEqualityHelper.matchingAttributeValues(Object, Object) to check if the two compared objects are string and "trim()" them before the equals call. That way the whitespace difference between origin and right won't be detected at all, in which case you will not see this conflict.
Regards,
Laurent Goubet
Obeo
|
|
|
|
Powered by
FUDForum. Page generated in 0.02568 seconds