Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » 3 way comparison with DifferenceFilter
3 way comparison with DifferenceFilter [message #1820973] Mon, 03 February 2020 17:44 Go to next message
Anthony Giang is currently offline Anthony GiangFriend
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 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
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
Re: 3 way comparison with DifferenceFilter [message #1821504 is a reply to message #1821273] Thu, 13 February 2020 17:56 Go to previous message
Anthony Giang is currently offline Anthony GiangFriend
Messages: 2
Registered: February 2020
Junior Member
Hey Laurent,

so the way I am setting this up is that after the "matching", left and right will both be considered as differences from the origin. Then I can apply a Filter and with the example I'm using, left should still be considered a difference, but right would be considered as a match with the origin. So on the GUI the left side would still be a diff. I am wondering on how to implement this so it shows up appropriately in the GUI. And maybe that's what you already explained in that last message but I just wasn't sure if we're on the same page.

Thanks,
Anthony
Previous Topic:Creating a macroscopic difffrom a collection of unit diffs
Next Topic:EditionDistance always returns 0 distance
Goto Forum:
  


Current Time: Thu Apr 18 14:43:56 GMT 2024

Powered by FUDForum. Page generated in 0.02568 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top