From 597fda2362e8261d6c617da7baef2dbd75d6d0d8 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Sat, 18 Mar 2023 22:43:42 +0100 Subject: fix: void is apparently not a primitive --- src/main/java/ftbsc/lll/processor/LilleroProcessor.java | 1 - src/main/java/ftbsc/lll/processor/tools/JavaPoetUtils.java | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src/main/java/ftbsc') diff --git a/src/main/java/ftbsc/lll/processor/LilleroProcessor.java b/src/main/java/ftbsc/lll/processor/LilleroProcessor.java index aa96fbd..02d7e27 100644 --- a/src/main/java/ftbsc/lll/processor/LilleroProcessor.java +++ b/src/main/java/ftbsc/lll/processor/LilleroProcessor.java @@ -218,7 +218,6 @@ public class LilleroProcessor extends AbstractProcessor { if(injectionCandidates.size() == 1) injectionTarget = injectionCandidates.get(0); - else { List params = classArrayFromAnnotation(injectorAnn, Injector::params, processingEnv.getElementUtils()); diff --git a/src/main/java/ftbsc/lll/processor/tools/JavaPoetUtils.java b/src/main/java/ftbsc/lll/processor/tools/JavaPoetUtils.java index d59bc11..0591929 100644 --- a/src/main/java/ftbsc/lll/processor/tools/JavaPoetUtils.java +++ b/src/main/java/ftbsc/lll/processor/tools/JavaPoetUtils.java @@ -7,7 +7,7 @@ import ftbsc.lll.proxies.FieldProxy; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.Modifier; -import javax.lang.model.type.ArrayType; +import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; import javax.lang.model.util.Elements; import java.lang.annotation.Annotation; @@ -125,7 +125,7 @@ public class JavaPoetUtils { */ public static void addTypeToProxyGenerator(MethodSpec.Builder b, String proxyBuilderName, String proxyBuilderMethod, TypeMirror t) { String insn = String.format("%s.%s", proxyBuilderName, proxyBuilderMethod); - if(t.getKind().isPrimitive()) + if(t.getKind().isPrimitive() || t.getKind() == TypeKind.VOID) b.addStatement(insn + "($T.class)", t); else { ArrayContainer arr = new ArrayContainer(t); @@ -134,7 +134,7 @@ public class JavaPoetUtils { type = ((ParameterizedTypeName) type).rawType; b.addStatement( insn + "($S, $L)", - type, + type.toString(), arr.arrayLevel ); } -- cgit v1.2.3-56-ga3b1