handle references [message #478210] |
Thu, 06 August 2009 08:52 |
No real name 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.10319 seconds