mirror of
https://github.com/zaaarf/lillero-processor.git
synced 2024-11-14 05:29:20 +01:00
fix: void is apparently not a primitive
This commit is contained in:
parent
b394f7c5f0
commit
597fda2362
2 changed files with 3 additions and 4 deletions
|
@ -218,7 +218,6 @@ public class LilleroProcessor extends AbstractProcessor {
|
||||||
|
|
||||||
if(injectionCandidates.size() == 1)
|
if(injectionCandidates.size() == 1)
|
||||||
injectionTarget = injectionCandidates.get(0);
|
injectionTarget = injectionCandidates.get(0);
|
||||||
|
|
||||||
else {
|
else {
|
||||||
List<TypeMirror> params = classArrayFromAnnotation(injectorAnn, Injector::params, processingEnv.getElementUtils());
|
List<TypeMirror> params = classArrayFromAnnotation(injectorAnn, Injector::params, processingEnv.getElementUtils());
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import ftbsc.lll.proxies.FieldProxy;
|
||||||
|
|
||||||
import javax.lang.model.element.ExecutableElement;
|
import javax.lang.model.element.ExecutableElement;
|
||||||
import javax.lang.model.element.Modifier;
|
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.type.TypeMirror;
|
||||||
import javax.lang.model.util.Elements;
|
import javax.lang.model.util.Elements;
|
||||||
import java.lang.annotation.Annotation;
|
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) {
|
public static void addTypeToProxyGenerator(MethodSpec.Builder b, String proxyBuilderName, String proxyBuilderMethod, TypeMirror t) {
|
||||||
String insn = String.format("%s.%s", proxyBuilderName, proxyBuilderMethod);
|
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);
|
b.addStatement(insn + "($T.class)", t);
|
||||||
else {
|
else {
|
||||||
ArrayContainer arr = new ArrayContainer(t);
|
ArrayContainer arr = new ArrayContainer(t);
|
||||||
|
@ -134,7 +134,7 @@ public class JavaPoetUtils {
|
||||||
type = ((ParameterizedTypeName) type).rawType;
|
type = ((ParameterizedTypeName) type).rawType;
|
||||||
b.addStatement(
|
b.addStatement(
|
||||||
insn + "($S, $L)",
|
insn + "($S, $L)",
|
||||||
type,
|
type.toString(),
|
||||||
arr.arrayLevel
|
arr.arrayLevel
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue