diff options
| author | 2014-08-10 01:03:40 -0400 | |
|---|---|---|
| committer | 2014-08-10 01:03:40 -0400 | |
| commit | d24d2b9ad9b5c895020b56f700a72906346482e5 (patch) | |
| tree | da360c07209e6e327325db53dbb4df05e77cb7e9 /src/cuchaz/enigma/mapping/ClassMapping.java | |
| parent | added sorting for deobfuscated classes (diff) | |
| download | enigma-fork-d24d2b9ad9b5c895020b56f700a72906346482e5.tar.gz enigma-fork-d24d2b9ad9b5c895020b56f700a72906346482e5.tar.xz enigma-fork-d24d2b9ad9b5c895020b56f700a72906346482e5.zip | |
completely re-wrote token recognizer to bootstrap from Procyon's AST
changed imports to guava instead of whatever collections library happened to be on my classpath
Diffstat (limited to 'src/cuchaz/enigma/mapping/ClassMapping.java')
| -rw-r--r-- | src/cuchaz/enigma/mapping/ClassMapping.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/cuchaz/enigma/mapping/ClassMapping.java b/src/cuchaz/enigma/mapping/ClassMapping.java index a1cc775..c6826f3 100644 --- a/src/cuchaz/enigma/mapping/ClassMapping.java +++ b/src/cuchaz/enigma/mapping/ClassMapping.java | |||
| @@ -13,7 +13,7 @@ package cuchaz.enigma.mapping; | |||
| 13 | import java.io.Serializable; | 13 | import java.io.Serializable; |
| 14 | import java.util.Map; | 14 | import java.util.Map; |
| 15 | 15 | ||
| 16 | import com.beust.jcommander.internal.Maps; | 16 | import com.google.common.collect.Maps; |
| 17 | 17 | ||
| 18 | public class ClassMapping implements Serializable, Comparable<ClassMapping> | 18 | public class ClassMapping implements Serializable, Comparable<ClassMapping> |
| 19 | { | 19 | { |
| @@ -135,16 +135,16 @@ public class ClassMapping implements Serializable, Comparable<ClassMapping> | |||
| 135 | 135 | ||
| 136 | public void setMethodNameAndSignature( String obfName, String obfSignature, String deobfName, String deobfSignature ) | 136 | public void setMethodNameAndSignature( String obfName, String obfSignature, String deobfName, String deobfSignature ) |
| 137 | { | 137 | { |
| 138 | MethodMapping methodIndex = m_methodsByObf.get( getMethodKey( obfName, obfSignature ) ); | 138 | MethodMapping methodMapping = m_methodsByObf.get( getMethodKey( obfName, obfSignature ) ); |
| 139 | if( methodIndex == null ) | 139 | if( methodMapping == null ) |
| 140 | { | 140 | { |
| 141 | methodIndex = createMethodIndex( obfName, obfSignature ); | 141 | methodMapping = createMethodIndex( obfName, obfSignature ); |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | m_methodsByDeobf.remove( getMethodKey( methodIndex.getDeobfName(), methodIndex.getDeobfSignature() ) ); | 144 | m_methodsByDeobf.remove( getMethodKey( methodMapping.getDeobfName(), methodMapping.getDeobfSignature() ) ); |
| 145 | methodIndex.setDeobfName( deobfName ); | 145 | methodMapping.setDeobfName( deobfName ); |
| 146 | methodIndex.setDeobfSignature( deobfSignature ); | 146 | methodMapping.setDeobfSignature( deobfSignature ); |
| 147 | m_methodsByDeobf.put( getMethodKey( deobfName, deobfSignature ), methodIndex ); | 147 | m_methodsByDeobf.put( getMethodKey( deobfName, deobfSignature ), methodMapping ); |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | public void updateDeobfMethodSignatures( Translator translator ) | 150 | public void updateDeobfMethodSignatures( Translator translator ) |
| @@ -167,11 +167,11 @@ public class ClassMapping implements Serializable, Comparable<ClassMapping> | |||
| 167 | 167 | ||
| 168 | private MethodMapping createMethodIndex( String obfName, String obfSignature ) | 168 | private MethodMapping createMethodIndex( String obfName, String obfSignature ) |
| 169 | { | 169 | { |
| 170 | MethodMapping methodIndex = new MethodMapping( obfName, obfName, obfSignature, obfSignature ); | 170 | MethodMapping methodMapping = new MethodMapping( obfName, obfName, obfSignature, obfSignature ); |
| 171 | String key = getMethodKey( obfName, obfSignature ); | 171 | String key = getMethodKey( obfName, obfSignature ); |
| 172 | m_methodsByObf.put( key, methodIndex ); | 172 | m_methodsByObf.put( key, methodMapping ); |
| 173 | m_methodsByDeobf.put( key, methodIndex ); | 173 | m_methodsByDeobf.put( key, methodMapping ); |
| 174 | return methodIndex; | 174 | return methodMapping; |
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | @Override | 177 | @Override |