diff --git a/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/ContextConfiguration.java b/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/ContextConfiguration.java index 16c26c192..cc4593074 100644 --- a/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/ContextConfiguration.java +++ b/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/ContextConfiguration.java @@ -4,6 +4,7 @@ import java.math.BigDecimal; import java.nio.file.Path; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -21,7 +22,7 @@ public class ContextConfiguration { /** * All available {@link Trigger}s */ - private Map triggers; + private Map triggers = new HashMap<>(); /** * Path of the configuration. Might point to a folder or a jar or maybe even something different in future. @@ -80,12 +81,17 @@ public Trigger getTrigger(String id) { /** * Merges another context configuration into _this_ context configuration instance - * + * * @param contextConfiguration to be merged */ public ContextConfiguration merge(ContextConfiguration contextConfiguration) { - triggers.putAll(contextConfiguration.triggers); + List contextTriggers = contextConfiguration.getTriggers(); + Map triggerMap = new HashMap<>(); + for (Trigger trigger : contextTriggers) { + triggerMap.put(trigger.getId(), trigger); + } + triggers.putAll(triggerMap); return this; } }