Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF Diff/Merge » Ignore differences on attribute 'x' on elements of type 'y'
Ignore differences on attribute 'x' on elements of type 'y' [message #1021814] Wed, 20 March 2013 14:17 Go to next message
Felix Dorner is currently offline Felix Dorner
Messages: 196
Registered: March 2012
Senior Member
For a custom comparison, I want to ignore any difference for an EAttribue 'x', but only on elements of type 'Y',

Say I have a type hierarchy like this:

class a {
  name : String
}

class c extends a { }

class b extends a { }


I want to write an IDiffPolicy that ignores differences in 'name' but only if the owning element "is a" c.
Re: Ignore differences on attribute 'x' on elements of type 'y' [message #1022775 is a reply to message #1021814] Fri, 22 March 2013 09:52 Go to previous message
Olivier Constant is currently offline Olivier Constant
Messages: 33
Registered: January 2012
Member
Hi Felix,

This customization exceeds the capabilities of diff policies, although it may be a legitimate need. Feel free to fill a request in Bugzilla.

When IDiffPolicy is not enough, you need to extend DiffOperation instead. In your case, I would suggest you redefine the 'createAllAttributeDifferences' method.

Olivier
Previous Topic:Structural comparison of two model trees
Next Topic:Print differences to stdout
Goto Forum:
  


Current Time: Thu Jul 24 06:50:24 EDT 2014

Powered by FUDForum. Page generated in 0.01743 seconds