diff --git a/BauSystem_Main/src/de/steamwar/bausystem/linkage/LinkageUtils.java b/BauSystem_Main/src/de/steamwar/bausystem/linkage/LinkageUtils.java index c0d1d986..298f94c7 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/linkage/LinkageUtils.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/linkage/LinkageUtils.java @@ -41,7 +41,7 @@ import java.util.stream.Collectors; public class LinkageUtils { private Map, Object> objectMap = new HashMap<>(); - private List fieldsToLink = new LinkedList<>(); + private List fieldsToLink = new ArrayList<>(); { objectMap.put(Config.class, Config.getInstance()); @@ -113,7 +113,8 @@ public class LinkageUtils { } linkageTypeList.forEach(linkageType -> linkageType.linkageConsumer.accept(object)); } else { - Object object = objectMap.computeIfAbsent(clazz, LinkageUtils::constructInstance); + Object object = constructInstance(clazz); + objectMap.put(clazz, object); linkageTypeList.forEach(linkageType -> linkageType.linkageConsumer.accept(object)); for (Field field : clazz.getDeclaredFields()) {