Skip to main content



      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 14:39 Go to next message
Eclipse UserFriend
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 05:37 Go to previous message
Eclipse UserFriend
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.

[Updated on: Thu, 19 December 2013 05:55] by Moderator

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


Current Time: Wed Jul 23 21:45:17 EDT 2025

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

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

Back to the top