Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » [Bug?] Compare will not work with certan implementation of EStore
[Bug?] Compare will not work with certan implementation of EStore [message #1220450] Wed, 11 December 2013 19:39 Go to next message
Leonid Ripeynih is currently offline Leonid RipeynihFriend
Messages: 150
Registered: February 2012
Senior Member
This code (in ManyStructuralFeatureAccessorImpl) may not work if valueOfDiff is a FeatureMap.Entry.

private Diff getDiffWithValue(Object value) {
   Diff ret = null;
   for (Diff diff : getDifferences()) {
      Object valueOfDiff = getValueFromDiff(diff, getSide());
      if (valueOfDiff == value) {
        ret = diff;
        break;
      }
   }
   return ret;
}


Consider an CDO implementation of EStoreEObjectImpl.EStoreFeatureMap which returns a new set of wrappers each time it's delegateToArray is called.

Wrappers are perfectly equal, and their wrapped objects are same (theis Values and Feature are same). However, wrappers are not same, and comparison by reference
(valueOfDiff == value) fails. I suggest changit this to equals (and EObject's can not override equals by it's contract, so it will not affect them)

Should I open a bugzilla for it, or is it intended behavior?
Re: [Bug?] Compare will not work with certan implementation of EStore [message #1222003 is a reply to message #1220450] Thu, 19 December 2013 10:37 Go to previous message
Mikael Barbero is currently offline Mikael BarberoFriend
Messages: 55
Registered: July 2009
Member
We would need to investigate how we should handle EStore implementations (currently, we did not tested it yet).

Your suggestion about using equals() seems to be reasonable but I would prefer that you open a bugzilla about that. We will fix it after review.

I'm afraid we will find other locations in the code with such kind of assumption that may not work with EStore implementations.

Anyway, as said in http://www.eclipse.org/forums/index.php/t/628268/, EMF Compare does not support feature map yet.


Best regards,

Mikael Barbero
Obeo

[Updated on: Thu, 19 December 2013 10:55]

Report message to a moderator

Previous Topic:Does EMF Compare supports feature maps?
Next Topic:How to compare UML models from code?
Goto Forum:
  


Current Time: Fri Apr 26 11:51:02 GMT 2024

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

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

Back to the top