diff options
author | zaaarf <zaaarf@proton.me> | 2023-03-31 13:14:10 +0200 |
---|---|---|
committer | zaaarf <zaaarf@proton.me> | 2023-03-31 13:14:10 +0200 |
commit | 716a19c5a55b7a2760aff5bede8c9dcad5285d53 (patch) | |
tree | 8fb118ff6dddad27fd4915155fa7522481188f7a /src/main/java/ftbsc/lll | |
parent | 032d43d63cc2346972480f3407167d3d339667bd (diff) |
fix: last commit made it even worse
Diffstat (limited to 'src/main/java/ftbsc/lll')
-rw-r--r-- | src/main/java/ftbsc/lll/processor/tools/obfuscation/ObfuscationMapper.java | 11 |
1 files changed, 9 insertions, 2 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 7146e00..5938de3 100644 --- a/src/main/java/ftbsc/lll/processor/tools/obfuscation/ObfuscationMapper.java +++ b/src/main/java/ftbsc/lll/processor/tools/obfuscation/ObfuscationMapper.java @@ -188,12 +188,19 @@ public class ObfuscationMapper { * @throws AmbiguousDefinitionException if not enough data was given to uniquely identify a mapping */ public String get(String memberName, String methodDescriptor) { + //find all keys that start with the name - List<String> candidates = members.keySet().stream().filter(m -> m.equals(memberName.split(" ")[0])).collect(Collectors.toList()); + List<String> candidates = members.keySet().stream().filter( + m -> m.split(" ")[0].equals(memberName) + ).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()); + candidates = candidates.stream().filter( + m -> m.equals(signature) + ).collect(Collectors.toList()); } + switch(candidates.size()) { case 0: throw new MappingNotFoundException(String.format( |