Skip to content

Commit

Permalink
[2237] Use a SiriusCopier
Browse files Browse the repository at this point in the history
The Clone command copies the annotations placed on the descriptors
before cloning the representations and their descriptors.

The viewpoint::DAnnotation is a concept from the Sirius core meta-model,
it inherits from viewpoint::IdentifiedElement and has the uid attribute
which is used as id and uriFragment. This id must be unique but the
EcoreUtil.Copier does not handle this (even if the attribute is declared
as id in the meta-model).

Note: this should be handled by Sirius.

Bug: 2237
Change-Id: I991712ca81941e2f31a939ca3baab7bf87d2f2d7
Signed-off-by: Maxime Porhel <maxime.porhel@obeo.fr>
  • Loading branch information
mPorhel committed Oct 23, 2018
1 parent 207b004 commit f38af50
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -17,10 +17,10 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.emf.common.command.AbstractCommand;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil.Copier;
import org.eclipse.sirius.business.api.dialect.DialectManager;
import org.eclipse.sirius.business.api.session.Session;
import org.eclipse.sirius.business.api.session.SessionManager;
import org.eclipse.sirius.common.tools.api.util.SiriusCopier;
import org.eclipse.sirius.viewpoint.DRepresentation;
import org.eclipse.sirius.viewpoint.DRepresentationDescriptor;
import org.eclipse.sirius.viewpoint.DSemanticDecorator;
Expand Down Expand Up @@ -164,7 +164,7 @@ public void execute() {
// Copy all representations.
for (DRepresentationDescriptor descriptor : _descriptors) {
// Copy all the Dannotation of DRepresentationDescriptor
Copier copier = new Copier();
SiriusCopier copier = new SiriusCopier();
Collection<DAnnotation> results = copier.copyAll(descriptor.getEAnnotations());
copier.copyReferences();

Expand Down

0 comments on commit f38af50

Please sign in to comment.