summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author zaaarf <zaaarf@proton.me>2023-03-16 15:50:39 +0100
committer zaaarf <zaaarf@proton.me>2023-03-16 15:50:39 +0100
commit6a067132105964d6367885ba967f6ea33e4fd65a (patch)
tree4c4348b84d0044d409b36e7ea300e26be925ec13
parent2999aef5a5c8bb5385644751372158eea5d4a858 (diff)
fix: fixed uncaught MirroredTypeException
-rw-r--r--src/main/java/ftbsc/lll/processor/tools/ASTUtils.java14
-rw-r--r--src/main/java/ftbsc/lll/processor/tools/obfuscation/ObfuscationMapper.java1
2 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/ftbsc/lll/processor/tools/ASTUtils.java b/src/main/java/ftbsc/lll/processor/tools/ASTUtils.java
index 0248051..ef50e52 100644
--- a/src/main/java/ftbsc/lll/processor/tools/ASTUtils.java
+++ b/src/main/java/ftbsc/lll/processor/tools/ASTUtils.java
@@ -137,18 +137,20 @@ public class ASTUtils {
/**
* Finds the class name and maps it to the correct format.
- *
* @param patchAnn the {@link Patch} annotation containing target class info
- * @param finderAnn an annotation containing metadata to fall back on, may be null
+ * @param finderAnn an annotation containing metadata about the target, may be null
* @param parentFun the function to get the parent from the finderAnn
* @return the fully qualified class name
* @since 0.3.0
*/
private static <T extends Annotation> String findClassName(Patch patchAnn, T finderAnn, Function<T, Class<?>> parentFun) {
- String fullyQualifiedName =
- finderAnn == null || parentFun.apply(finderAnn) == Object.class
- ? getClassFullyQualifiedName(patchAnn, Patch::value)
- : getClassFullyQualifiedName(finderAnn, parentFun);
+ String fullyQualifiedName;
+ if(finderAnn != null) {
+ fullyQualifiedName = getClassFullyQualifiedName(finderAnn, parentFun);
+ if(!fullyQualifiedName.equals("java.lang.Object"))
+ return findClassName(fullyQualifiedName, null);
+ }
+ fullyQualifiedName = getClassFullyQualifiedName(patchAnn, Patch::value);
return findClassName(fullyQualifiedName, null);
}
diff --git a/src/main/java/ftbsc/lll/processor/tools/obfuscation/ObfuscationMapper.java b/src/main/java/ftbsc/lll/processor/tools/obfuscation/ObfuscationMapper.java
index 6da8c9b..ad4ced3 100644
--- a/src/main/java/ftbsc/lll/processor/tools/obfuscation/ObfuscationMapper.java
+++ b/src/main/java/ftbsc/lll/processor/tools/obfuscation/ObfuscationMapper.java
@@ -144,7 +144,6 @@ public class ObfuscationMapper {
*/
private final Map<String, String> members;
-
/**
* The constructor. It takes in the names (obfuscated and non-obfuscated)
* of a class.