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 18:17 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 286
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 13:52 Go to previous message
Olivier Constant is currently offline Olivier ConstantFriend
Messages: 47
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: Sat Dec 20 03:51:58 GMT 2014

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

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