diff options
author | zaaarf <zaaarf@proton.me> | 2023-03-15 11:23:40 +0100 |
---|---|---|
committer | zaaarf <zaaarf@proton.me> | 2023-03-15 11:23:40 +0100 |
commit | 19b739943fabeed97d6d6a2bc4e70e7d832fea49 (patch) | |
tree | 669d3c7b6a105f74f6c49e1ffa8521928a854db8 /src/main/java/ftbsc/lll/processor/LilleroProcessor.java | |
parent | 0cd50cc179bc9d901b87fb6fb9c4ba45e510a372 (diff) |
fix: fixed MirroredTypeException
Diffstat (limited to 'src/main/java/ftbsc/lll/processor/LilleroProcessor.java')
-rw-r--r-- | src/main/java/ftbsc/lll/processor/LilleroProcessor.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/ftbsc/lll/processor/LilleroProcessor.java b/src/main/java/ftbsc/lll/processor/LilleroProcessor.java index aaaa2f0..a2a42f2 100644 --- a/src/main/java/ftbsc/lll/processor/LilleroProcessor.java +++ b/src/main/java/ftbsc/lll/processor/LilleroProcessor.java @@ -29,6 +29,7 @@ import java.util.*; import java.util.stream.Collectors; import static ftbsc.lll.processor.tools.ASTUtils.*; +import static ftbsc.lll.processor.tools.ASTUtils.getClassFullyQualifiedName; /** * The actual annotation processor behind the magic. @@ -175,8 +176,8 @@ public class LilleroProcessor extends AbstractProcessor { private static String findClassName(Patch patchAnn, FindMethod methodAnn, ObfuscationMapper mapper) { String fullyQualifiedName = methodAnn == null || methodAnn.parent() == Object.class - ? getClassFullyQualifiedName(patchAnn.value()) - : getClassFullyQualifiedName(methodAnn.parent()); + ? getClassFullyQualifiedName(patchAnn, p -> patchAnn.value()) + : getClassFullyQualifiedName(methodAnn, m -> methodAnn.parent()); return findClassName(fullyQualifiedName, mapper); } @@ -322,11 +323,11 @@ public class LilleroProcessor extends AbstractProcessor { private VariableElement findField(ExecutableElement stub, ObfuscationMapper mapper) { Patch patchAnn = stub.getEnclosingElement().getAnnotation(Patch.class); FindField fieldAnn = stub.getAnnotation(FindField.class); - String parentName = findClassName(getClassFullyQualifiedName( - fieldAnn.parent().equals(Object.class) - ? patchAnn.value() - : fieldAnn.parent() - ), mapper); + String parentName; + if(fieldAnn.parent().equals(Object.class)) + parentName = getClassFullyQualifiedName(patchAnn, p -> patchAnn.value()); + else parentName = getClassFullyQualifiedName(fieldAnn, f -> fieldAnn.parent()); + parentName = findClassName(parentName, mapper); String name = fieldAnn.name().equals("") ? stub.getSimpleName().toString() : fieldAnn.name(); |