|handle references [message #478210]
||Thu, 06 August 2009 08:52
| No real name
Registered: July 2009
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
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,
DiffModel diff = DiffService.doDiff(match, false);
DiffGroup diffRoot = (DiffGroup) diff.getOwnedElements().get(0);
if( diffRoot.getSubchanges() > 0 )
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 ?
Powered by FUDForum
. Page generated in 0.04124 seconds