From f1aab8d3f75e8ac829de5d5c5966aaf50a9239e1 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 28 Aug 2022 09:43:11 +0200 Subject: [PATCH] Fix NPE Signed-off-by: yoyosource --- .../src/de/steamwar/bausystem/linkage/LinkageProcessor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BauSystem_Linkage/src/de/steamwar/bausystem/linkage/LinkageProcessor.java b/BauSystem_Linkage/src/de/steamwar/bausystem/linkage/LinkageProcessor.java index 5c2e83a2..d23bc2dc 100644 --- a/BauSystem_Linkage/src/de/steamwar/bausystem/linkage/LinkageProcessor.java +++ b/BauSystem_Linkage/src/de/steamwar/bausystem/linkage/LinkageProcessor.java @@ -76,7 +76,6 @@ public class LinkageProcessor extends AbstractProcessor { if (linkeds.length > 1) { neededFields.put(typeElement.getQualifiedName().toString(), typeElement); - continue; } List variableElements = typeElement.getEnclosedElements().stream().filter(e -> e.getKind() == ElementKind.FIELD).map(VariableElement.class::cast).filter(e -> { @@ -103,7 +102,8 @@ public class LinkageProcessor extends AbstractProcessor { TypeElement fieldType = (TypeElement) ((DeclaredType) variableElement.asType()).asElement(); neededFields.put(fieldType.getQualifiedName().toString(), fieldType); - staticLines.add(getElement(typeElement, neededFields) + "." + variableElement.getSimpleName().toString() + " = " + getElement((TypeElement) ((DeclaredType) variableElement.asType()).asElement(), neededFields).toString()); + System.out.println(getElement(typeElement, neededFields) + "." + variableElement.getSimpleName().toString() + " = " + getElement((TypeElement) ((DeclaredType) variableElement.asType()).asElement(), neededFields)); + staticLines.add(getElement(typeElement, neededFields) + "." + variableElement.getSimpleName().toString() + " = " + getElement((TypeElement) ((DeclaredType) variableElement.asType()).asElement(), neededFields)); } } neededFields.forEach((s, typeElement) -> {