Using "Duplicate Selection" results in duplicates of component ids, breaking Project Explorer panel and causing other issues downstream

This commit is contained in:
Bane Stojkovic
2026-02-11 16:47:08 +01:00
parent 8b69903893
commit d976959e95
2 changed files with 2 additions and 1 deletions
@@ -276,7 +276,7 @@ public class InstantiationManager {
private List<IDIYComponent<?>> instantiateComponent(ComponentType componentType, Point2D point,
Project currentProject) throws InstantiationException, IllegalAccessException, NoSuchMethodException,
SecurityException, IllegalArgumentException, InvocationTargetException {
LOG.info("Instatiating component of type: " + componentType.getInstanceClass().getName());
LOG.info("Instantiating component of type: " + componentType.getInstanceClass().getName());
// Instantiate the component.
IDIYComponent<?> component;
@@ -1664,6 +1664,7 @@ public class Presenter implements IPlugInPort {
ComponentProcessor.getInstance().extractComponentTypeFrom(
(Class<? extends IDIYComponent<?>>) cloned.getClass());
cloned.setName(instantiationManager.createUniqueName(componentType, currentProject.getComponents()));
cloned.setId(UUID.randomUUID());
newSelection.add(cloned);
for (int i = 0; i < component.getControlPointCount(); i++) {
Point2D p = component.getControlPoint(i);