summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/ftbsc/lll/processor/LilleroProcessor.java1
-rw-r--r--src/main/java/ftbsc/lll/processor/tools/JavaPoetUtils.java8
2 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/ftbsc/lll/processor/LilleroProcessor.java b/src/main/java/ftbsc/lll/processor/LilleroProcessor.java
index b68eddd..aa96fbd 100644
--- a/src/main/java/ftbsc/lll/processor/LilleroProcessor.java
+++ b/src/main/java/ftbsc/lll/processor/LilleroProcessor.java
@@ -8,7 +8,6 @@ import ftbsc.lll.processor.annotations.Find;
import ftbsc.lll.processor.annotations.Injector;
import ftbsc.lll.processor.annotations.Patch;
import ftbsc.lll.processor.annotations.Target;
-import ftbsc.lll.processor.tools.ArrayContainer;
import ftbsc.lll.processor.tools.obfuscation.ObfuscationMapper;
import ftbsc.lll.proxies.FieldProxy;
import ftbsc.lll.proxies.MethodProxy;
diff --git a/src/main/java/ftbsc/lll/processor/tools/JavaPoetUtils.java b/src/main/java/ftbsc/lll/processor/tools/JavaPoetUtils.java
index 51f058b..725e258 100644
--- a/src/main/java/ftbsc/lll/processor/tools/JavaPoetUtils.java
+++ b/src/main/java/ftbsc/lll/processor/tools/JavaPoetUtils.java
@@ -7,6 +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.TypeMirror;
import javax.lang.model.util.Elements;
import java.lang.annotation.Annotation;
@@ -128,9 +129,14 @@ public class JavaPoetUtils {
b.addStatement(insn + "($T.class)", t);
else {
ArrayContainer arr = new ArrayContainer(t);
+ TypeName type = TypeName.get(arr.innermostComponent);
+ while(type instanceof ArrayTypeName)
+ type = ((ArrayTypeName) type).componentType;
+ if(type instanceof ParameterizedTypeName)
+ type = ((ParameterizedTypeName) type).rawType;
b.addStatement(
insn + "($S, $L)",
- arr.innermostComponent,
+ type,
arr.arrayLevel
);
}