When I try my plugin, the modifications are done, I save the modified diagram (and so the model) and when I reopen it, I have an error:
!MESSAGE org.eclipse.uml2.uml.internal.impl.ClassImpl cannot be cast to org.eclipse.uml2.uml.Operation
!STACK 0
java.lang.ClassCastException: org.eclipse.uml2.uml.internal.impl.ClassImpl cannot be cast to org.eclipse.uml2.uml.Operation
|
It seems that this error is close to this one: https://bugs.eclipse.org/bugs/show_bug.cgi?id=319240
But I do not find the way to solve it.
Here is a part of my code:
//Get the org.eclipse.uml2.uml.operation
Operation op = getOperationToModify();
EditingDomain dom = AdapterFactoryEditingDomain.getEditingDomainFor(op);
Command commDeleteOP = RemoveCommand.create(dom, op);
Command commDeleteParams = DeleteCommand.create(dom, op.getOwnedParameters());
tmp = (Class) op.getOwner();
domain.getCommandStack().execute(commDeleteParams);
domain.getCommandStack().execute(commDeleteOP);
op = ((Class)tmp).createOwnedOperation(actionName, tmpParamName, tmpParamType);
This is how I manage my modification, is this good or is there a problem ?
I tried to find some Papyrus MDT Cookbook but on the svn, it's an old version.
I also find this: http://wiki.eclipse.org/Papyrus_Developer_Guide/Editing_Domains_and_Commands but it's for Papyrus (old version)
Is there a new version of the second document ?
Thanks for your help.
Arnaud