aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
author zaaarf <zaaarf@proton.me>2023-03-18 21:29:13 +0100
committer zaaarf <zaaarf@proton.me>2023-03-18 21:29:13 +0100
commit1c072781f3b49c5bd388f15e787e4aad3ff49059 (patch)
tree90d214f5bb3503a7cce1035081fbd42ba36d2cff /src/main
parentfd06fe810d1140504afaacc0c1bbf8507de717ee (diff)
fix: bug with parameterized/array names in finder function0.4.1
Diffstat (limited to 'src/main')
-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
);
}