From bf8f8d2cf3b6cfd6684dd1ad34c7f4f4e2df0bb7 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 26 Aug 2022 21:17:06 +0200 Subject: [PATCH] Fix somes stuff Signed-off-by: yoyosource --- .../src/de/steamwar/bausystem/linkage/LinkageUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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()) {