Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Unsettable Features(Change of unsettable feature not detected)
Unsettable Features [message #1781361] Tue, 06 February 2018 12:31 Go to next message
Janik S is currently offline Janik SFriend
Messages: 4
Registered: November 2017
Junior Member
Hey guys,

I just stumbled over an issue, when comparing objects with an unsettable enum feature. If I compare an object with the feature being unset and another object with the feature being set to the default value, no difference is detected.

I have not set an explicit default value in my ecore model, but EMF chooses the first enum literal as a default https://www.eclipse.org/forums/index.php?t=msg&th=168434/

I guess, I can avoid this by explicitly setting the default to null in my model, but shouldn't the diff engine detect such a change?

In our case a default will not be serialized, so I see a difference in the text file but not in the model comparison.

Thanks
Janik

Re: Unsettable Features [message #1781690 is a reply to message #1781361] Mon, 12 February 2018 08:42 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1858
Registered: July 2009
Senior Member
Hi Janik,

This is something that's expected : we consider "no value" (unset) and "default value" to be the same when comparing, since that's also how EMF should consider them as a whole. There will be a difference in the serialized file, but the behavior would be the same. EMF Compare focuses on "model" differences, not "textual" ones, so imho the result you get is what EMF Compare is expected to give you.

Laurent Goubet
Obeo
Re: Unsettable Features [message #1784398 is a reply to message #1781690] Tue, 27 March 2018 15:31 Go to previous message
Janik S is currently offline Janik SFriend
Messages: 4
Registered: November 2017
Junior Member
Hey Laurent,

I'm not sure about the EMF philosophy here, but I think this is still dangerous behavior in a merge depending on the model semantics. Your assumption is correct, if the model is considered to never change default values, but I think the "unsettable" feature in EMF was added to exactly allow the distinction between "chose the default" and "chose an explicit value (which can be today equal to the default)". If the default value changes at some point in time, then the model indeed behaves differently for the cases "unset" and "set", so silently treating them the same can lead to unexpected behavior and it is more than just a textual difference.

If the default-value is not allowed to change in a model, then EMF would not need this "unsettable" modeling feature right?

Thanks
Janik
Previous Topic:EMF Compare 3.2.1 and Oxygen
Next Topic:Detailed informations on a difference
Goto Forum:
  


Current Time: Mon Oct 22 12:41:55 GMT 2018

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

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

Back to the top