Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF Diff/Merge » Completely ignore attribute differences
Completely ignore attribute differences [message #1747490] Tue, 15 November 2016 13:01 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 392
Registered: December 2015
Senior Member
Hi, so.., next question Smile

I would like to compare two trees and completely ignore comparison of attributes. I'm only interested in "structural" (referential) differences. What I do is override IDiffPolicy.considerEqual(). Is there a better way?

Felix
Re: Completely ignore attribute differences [message #1747491 is a reply to message #1747490] Tue, 15 November 2016 13:03 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 392
Registered: December 2015
Senior Member
Oh, coverFeature() would be better, I hadn't seen that.
Re: Completely ignore attribute differences [message #1747492 is a reply to message #1747490] Tue, 15 November 2016 13:05 Go to previous messageGo to next message
Olivier Constant is currently offline Olivier ConstantFriend
Messages: 106
Registered: January 2012
Senior Member
Yes, there is a better way. In IDiffPolicy :

/**
* Return whether the given attribute or reference must be covered by
* the difference detection algorithm.
* Precondition: if feature_p instanceof EReference then
* !((EReference)feature_p).isContainment() && !((EReference)feature_p).isContainer()
* In other terms, this method is never called for containment or container
* references. This is because those are implicitly determined by the elements
* that are present in the compared model scopes.
* @param feature_p a non-null reference or attribute
*/
boolean coverFeature(EStructuralFeature feature_p);
Re: Completely ignore attribute differences [message #1747493 is a reply to message #1747492] Tue, 15 November 2016 13:06 Go to previous message
Olivier Constant is currently offline Olivier ConstantFriend
Messages: 106
Registered: January 2012
Senior Member
Yes, good catch. Smile
Previous Topic:IMatch question
Next Topic:Cannot access the Javadoc
Goto Forum:
  


Current Time: Thu Mar 28 19:07:11 GMT 2024

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

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

Back to the top