diff options
Diffstat (limited to 'src/cuchaz/enigma/mapping/MethodMapping.java')
| -rw-r--r-- | src/cuchaz/enigma/mapping/MethodMapping.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/cuchaz/enigma/mapping/MethodMapping.java b/src/cuchaz/enigma/mapping/MethodMapping.java index fe4e29b..b0f7ba8 100644 --- a/src/cuchaz/enigma/mapping/MethodMapping.java +++ b/src/cuchaz/enigma/mapping/MethodMapping.java | |||
| @@ -142,21 +142,27 @@ public class MethodMapping implements Serializable, Comparable<MethodMapping> | |||
| 142 | return ( m_obfName + m_obfSignature ).compareTo( ( other.m_obfName + other.m_obfSignature ) ); | 142 | return ( m_obfName + m_obfSignature ).compareTo( ( other.m_obfName + other.m_obfSignature ) ); |
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | public void renameObfClasses( final Map<String,String> nameMap ) | 145 | public boolean renameObfClass( final String oldObfClassName, final String newObfClassName ) |
| 146 | { | 146 | { |
| 147 | // rename obf classes in the signature | 147 | // rename obf classes in the signature |
| 148 | m_obfSignature = SignatureUpdater.update( m_obfSignature, new ClassNameUpdater( ) | 148 | String newSignature = SignatureUpdater.update( m_obfSignature, new ClassNameUpdater( ) |
| 149 | { | 149 | { |
| 150 | @Override | 150 | @Override |
| 151 | public String update( String className ) | 151 | public String update( String className ) |
| 152 | { | 152 | { |
| 153 | String newName = nameMap.get( className ); | 153 | if( className.equals( oldObfClassName ) ) |
| 154 | if( newName != null ) | ||
| 155 | { | 154 | { |
| 156 | return newName; | 155 | return newObfClassName; |
| 157 | } | 156 | } |
| 158 | return className; | 157 | return className; |
| 159 | } | 158 | } |
| 160 | } ); | 159 | } ); |
| 160 | |||
| 161 | if( newSignature != m_obfSignature ) | ||
| 162 | { | ||
| 163 | m_obfSignature = newSignature; | ||
| 164 | return true; | ||
| 165 | } | ||
| 166 | return false; | ||
| 161 | } | 167 | } |
| 162 | } | 168 | } |