Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Compare]comparison of a copied model shows differences in data types
[EMF Compare]comparison of a copied model shows differences in data types [message #532386] Sun, 09 May 2010 13:04 Go to next message
Jan Reimann is currently offline Jan ReimannFriend
Messages: 140
Registered: July 2009
Senior Member
Hello NG,
I make a copy of my original model with the following code:

Copier copier = new Copier(false, false);
List<EObject> originalElements = new LinkedList<EObject>();
originalElements.add(originalModel);
copier.copyAll(originalElements);
copier.copyReferences();
EObject copiedModel = copier.get(originalModel);

Then I invoke some modifications on the copy and display a comparison
dialog between original and copy. I observed a very strange thing which
I want to solve. Imagine that original and copy is an ecore model. The
strange thing now is that elements which belong together and are still
the same (except of being duplicates) are surrounded by a blue line
expressing they are similar but differ in some way. When I then opend
the properties tab in the compare dialog I saw the reason: the copied
model doesn't reference the original data types, such as EDouble,
EString ...., anymore. And that's why the comparison assumes that they
have differences. But why are those references to the data types broken?
I understand that those data types can't be copied but the references
should hold in the copy as well. Any suggestions?

best regards,
Jan
Re: [EMF Compare]comparison of a copied model shows differences in data types [message #532399 is a reply to message #532386] Sun, 09 May 2010 17:05 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Jan,

It sounds like you don't really want the second argument to the Copier
to be false.


Jan Reimann wrote:
> Hello NG,
> I make a copy of my original model with the following code:
>
> Copier copier = new Copier(false, false);
> List<EObject> originalElements = new LinkedList<EObject>();
> originalElements.add(originalModel);
> copier.copyAll(originalElements);
> copier.copyReferences();
> EObject copiedModel = copier.get(originalModel);
>
> Then I invoke some modifications on the copy and display a comparison
> dialog between original and copy. I observed a very strange thing which
> I want to solve. Imagine that original and copy is an ecore model. The
> strange thing now is that elements which belong together and are still
> the same (except of being duplicates) are surrounded by a blue line
> expressing they are similar but differ in some way. When I then opend
> the properties tab in the compare dialog I saw the reason: the copied
> model doesn't reference the original data types, such as EDouble,
> EString ...., anymore. And that's why the comparison assumes that they
> have differences. But why are those references to the data types broken?
> I understand that those data types can't be copied but the references
> should hold in the copy as well. Any suggestions?
>
> best regards,
> Jan
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [EMF Compare]comparison of a copied model shows differences in data types [message #532420 is a reply to message #532399] Sun, 09 May 2010 19:56 Go to previous message
Jan Reimann is currently offline Jan ReimannFriend
Messages: 140
Registered: July 2009
Senior Member
Hi Ed,
> It sounds like you don't really want the second argument to the Copier
> to be false.
Thanks Ed. This solved the problem. I thought this argument has to do
with the own internal references and that they should be copied, too.
Well, but this will be achieved by copier.copyReferences() of course.
Re: [EMF Compare]comparison of a copied model shows differences in data types [message #622863 is a reply to message #532386] Sun, 09 May 2010 17:05 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Jan,

It sounds like you don't really want the second argument to the Copier
to be false.


Jan Reimann wrote:
> Hello NG,
> I make a copy of my original model with the following code:
>
> Copier copier = new Copier(false, false);
> List<EObject> originalElements = new LinkedList<EObject>();
> originalElements.add(originalModel);
> copier.copyAll(originalElements);
> copier.copyReferences();
> EObject copiedModel = copier.get(originalModel);
>
> Then I invoke some modifications on the copy and display a comparison
> dialog between original and copy. I observed a very strange thing which
> I want to solve. Imagine that original and copy is an ecore model. The
> strange thing now is that elements which belong together and are still
> the same (except of being duplicates) are surrounded by a blue line
> expressing they are similar but differ in some way. When I then opend
> the properties tab in the compare dialog I saw the reason: the copied
> model doesn't reference the original data types, such as EDouble,
> EString ...., anymore. And that's why the comparison assumes that they
> have differences. But why are those references to the data types broken?
> I understand that those data types can't be copied but the references
> should hold in the copy as well. Any suggestions?
>
> best regards,
> Jan
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [EMF Compare]comparison of a copied model shows differences in data types [message #622866 is a reply to message #532399] Sun, 09 May 2010 19:56 Go to previous message
Jan Reimann is currently offline Jan ReimannFriend
Messages: 140
Registered: July 2009
Senior Member
Hi Ed,
> It sounds like you don't really want the second argument to the Copier
> to be false.
Thanks Ed. This solved the problem. I thought this argument has to do
with the own internal references and that they should be copied, too.
Well, but this will be achieved by copier.copyReferences() of course.
Previous Topic:how to convert .uml.profile to .ecore
Next Topic:EMF Compare
Goto Forum:
  


Current Time: Thu Apr 18 00:36:57 GMT 2024

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

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

Back to the top