diff options
Diffstat (limited to 'src/cuchaz/enigma/mapping/MethodMapping.java')
| -rw-r--r-- | src/cuchaz/enigma/mapping/MethodMapping.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/cuchaz/enigma/mapping/MethodMapping.java b/src/cuchaz/enigma/mapping/MethodMapping.java index 1704428..bf8a94f 100644 --- a/src/cuchaz/enigma/mapping/MethodMapping.java +++ b/src/cuchaz/enigma/mapping/MethodMapping.java | |||
| @@ -12,7 +12,9 @@ package cuchaz.enigma.mapping; | |||
| 12 | 12 | ||
| 13 | import java.io.Serializable; | 13 | import java.io.Serializable; |
| 14 | import java.util.Map; | 14 | import java.util.Map; |
| 15 | import java.util.TreeMap; | 15 | import java.util.Map.Entry; |
| 16 | |||
| 17 | import com.google.common.collect.Maps; | ||
| 16 | 18 | ||
| 17 | public class MethodMapping implements Serializable, Comparable<MethodMapping> { | 19 | public class MethodMapping implements Serializable, Comparable<MethodMapping> { |
| 18 | 20 | ||
| @@ -37,9 +39,19 @@ public class MethodMapping implements Serializable, Comparable<MethodMapping> { | |||
| 37 | m_obfName = obfName; | 39 | m_obfName = obfName; |
| 38 | m_deobfName = NameValidator.validateMethodName(deobfName); | 40 | m_deobfName = NameValidator.validateMethodName(deobfName); |
| 39 | m_obfSignature = obfSignature; | 41 | m_obfSignature = obfSignature; |
| 40 | m_arguments = new TreeMap<Integer,ArgumentMapping>(); | 42 | m_arguments = Maps.newTreeMap(); |
| 41 | } | 43 | } |
| 42 | 44 | ||
| 45 | public MethodMapping(MethodMapping other, ClassNameReplacer obfClassNameReplacer) { | ||
| 46 | m_obfName = other.m_obfName; | ||
| 47 | m_deobfName = other.m_deobfName; | ||
| 48 | m_obfSignature = new Signature(other.m_obfSignature, obfClassNameReplacer); | ||
| 49 | m_arguments = Maps.newTreeMap(); | ||
| 50 | for (Entry<Integer,ArgumentMapping> entry : other.m_arguments.entrySet()) { | ||
| 51 | m_arguments.put(entry.getKey(), new ArgumentMapping(entry.getValue())); | ||
| 52 | } | ||
| 53 | } | ||
| 54 | |||
| 43 | public String getObfName() { | 55 | public String getObfName() { |
| 44 | return m_obfName; | 56 | return m_obfName; |
| 45 | } | 57 | } |