summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author zaaarf <zaaarf@proton.me>2023-03-31 12:56:40 +0200
committer zaaarf <zaaarf@proton.me>2023-03-31 12:56:40 +0200
commit032d43d63cc2346972480f3407167d3d339667bd (patch)
tree5c91669af6fd2faafee3f65e83eccce3b46733be
parent44cec29b1cb1432769a44c29d60961033165114e (diff)
fix: ambiguity in mapping member names
-rw-r--r--src/main/java/ftbsc/lll/processor/tools/obfuscation/ObfuscationMapper.java7
1 files changed, 4 insertions, 3 deletions
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 4fec0b5..7146e00 100644
--- a/src/main/java/ftbsc/lll/processor/tools/obfuscation/ObfuscationMapper.java
+++ b/src/main/java/ftbsc/lll/processor/tools/obfuscation/ObfuscationMapper.java
@@ -189,7 +189,7 @@ public class ObfuscationMapper {
*/
public String get(String memberName, String methodDescriptor) {
//find all keys that start with the name
- List<String> candidates = members.keySet().stream().filter(m -> m.startsWith(memberName)).collect(Collectors.toList());
+ List<String> candidates = members.keySet().stream().filter(m -> m.equals(memberName.split(" ")[0])).collect(Collectors.toList());
if(methodDescriptor != null) {
String signature = String.format("%s %s", memberName, methodDescriptor);
candidates = candidates.stream().filter(m -> m.equals(signature)).collect(Collectors.toList());
@@ -206,10 +206,11 @@ public class ObfuscationMapper {
return members.get(candidates.get(0));
default:
throw new AmbiguousDefinitionException(String.format(
- "Mapper could not uniquely identify member %s.%s%s",
+ "Mapper could not uniquely identify member %s.%s%s, found %d!",
this.unobf,
memberName,
- methodDescriptor == null ? "" : "()"
+ methodDescriptor == null ? "" : "()",
+ candidates.size()
));
}
}