In org.polarsys.capella.core.platform.sirius.ui.commands.CapellaPasteCommand.doExecute(), first the command is performed, which means EAdapters can intervene and possibly update the name of an element being added (to prevent name collisions for instance).
Then the Capella name collision check is performed via org.polarsys.capella.core.platform.sirius.ui.commands.NameCollisionHelper.isCollide(Collection<?>, String), but it searches for collisions by iterating through all the contents of the parent element, meaning that a collision is always found.
Instead, there should only be collisions to handle if the element that just got pasted really has the same name as its origin.
In
org.polarsys.capella.core.platform.sirius.ui.commands.CapellaPasteCommand.doExecute()
, first the command is performed, which means EAdapters can intervene and possibly update the name of an element being added (to prevent name collisions for instance). Then the Capella name collision check is performed viaorg.polarsys.capella.core.platform.sirius.ui.commands.NameCollisionHelper.isCollide(Collection<?>, String)
, but it searches for collisions by iterating through all the contents of the parent element, meaning that a collision is always found.Instead, there should only be collisions to handle if the element that just got pasted really has the same name as its origin.