mirror of
https://github.com/zaaarf/lillero-processor.git
synced 2024-11-22 10:34:51 +01:00
fix: bug with parameterized/array names in finder function
This commit is contained in:
parent
fd06fe810d
commit
1c072781f3
2 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue