Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » handle references
handle references [message #478210] Thu, 06 August 2009 08:52 Go to next message
No real name is currently offline No real nameFriend
Messages: 61
Registered: July 2009
Member
Hi,

I have simple UML-model:
- package "foo"
- contains class "SimpleClass"
- contains property "age"
- is of primitive-type "int"

The primitive type is defined in another model, which contains only this
type.

Then I have two other models, which are copies (but with different IDs).

If I compare each of the two "original" models with their "copies" using
EMF-Compare in the GUI, there are no differences.

But if I compare them programmaticly, there is a difference. I would like
that there is no difference. I compare them like this:


for( int index = 0; index < createdModels.size(); index++ )
{
Model referenceModel = referenceModels.get(index);
Model createdModel = createdModels.get(index);

Map<String, Object> options = new HashMap<String, Object>();
options.put(MatchOptions.OPTION_IGNORE_XMI_ID, new Boolean(true));
options.put(MatchOptions.OPTION_IGNORE_ID, new Boolean(true));
MatchModel match = MatchService.doContentMatch(referenceModel,
createdModel, options);
DiffModel diff = DiffService.doDiff(match, false);
DiffGroup diffRoot = (DiffGroup) diff.getOwnedElements().get(0);

if( diffRoot.getSubchanges() > 0 )
{
Assert.assertTrue(this.getT2MAssertFailText(), false);
}

}

If I put a breakpoint on the assert-statement and follow the subchanges, I
get to the age-property of simple class (its type is the primitive-type
located in the second model):

[Reference type in age changed from
org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl@a2f910 (name: int,
visibility: <unset>) (isLeaf: false, isAbstract: false) to
org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl@b41cfa (name: int,
visibility: <unset>) (isLeaf: false, isAbstract: false), null, null, null]

Is there an option to ignore this kind of "difference" (because for me its
not a difference), like the GUI ?


thank you
Re: handle references [message #478259 is a reply to message #478210] Thu, 06 August 2009 09:05 Go to previous message
No real name is currently offline No real nameFriend
Messages: 61
Registered: July 2009
Member
Uh, never mind. I just realized something. Sorry.
Previous Topic:Re: Metamodeling
Next Topic:[Transaction] IllegalArgumentException when collecting notifications
Goto Forum:
  


Current Time: Thu Dec 12 08:45:21 GMT 2019

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

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

Back to the top