diff options
| author | 2016-09-06 12:11:50 +0200 | |
|---|---|---|
| committer | 2016-09-06 12:11:50 +0200 | |
| commit | e0e3141619cecd54c087d964654e6c35511c48f9 (patch) | |
| tree | 9d7750f6abe26b4ca08cc9ffb516222569ebfd0b /src/main/java/cuchaz/enigma/convert/MappingsConverter.java | |
| parent | Avoid Engima converter detecting <init> and <clinit> as matchable token (diff) | |
| download | enigma-fork-e0e3141619cecd54c087d964654e6c35511c48f9.tar.gz enigma-fork-e0e3141619cecd54c087d964654e6c35511c48f9.tar.xz enigma-fork-e0e3141619cecd54c087d964654e6c35511c48f9.zip | |
A little bit of clean up
Diffstat (limited to 'src/main/java/cuchaz/enigma/convert/MappingsConverter.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/convert/MappingsConverter.java | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/main/java/cuchaz/enigma/convert/MappingsConverter.java b/src/main/java/cuchaz/enigma/convert/MappingsConverter.java index abb1bea..a80d9ce 100644 --- a/src/main/java/cuchaz/enigma/convert/MappingsConverter.java +++ b/src/main/java/cuchaz/enigma/convert/MappingsConverter.java | |||
| @@ -11,10 +11,6 @@ | |||
| 11 | package cuchaz.enigma.convert; | 11 | package cuchaz.enigma.convert; |
| 12 | 12 | ||
| 13 | import com.google.common.collect.*; | 13 | import com.google.common.collect.*; |
| 14 | |||
| 15 | import java.util.*; | ||
| 16 | import java.util.jar.JarFile; | ||
| 17 | |||
| 18 | import cuchaz.enigma.Constants; | 14 | import cuchaz.enigma.Constants; |
| 19 | import cuchaz.enigma.Deobfuscator; | 15 | import cuchaz.enigma.Deobfuscator; |
| 20 | import cuchaz.enigma.analysis.JarIndex; | 16 | import cuchaz.enigma.analysis.JarIndex; |
| @@ -22,6 +18,9 @@ import cuchaz.enigma.convert.ClassNamer.SidedClassNamer; | |||
| 22 | import cuchaz.enigma.mapping.*; | 18 | import cuchaz.enigma.mapping.*; |
| 23 | import cuchaz.enigma.throwables.MappingConflict; | 19 | import cuchaz.enigma.throwables.MappingConflict; |
| 24 | 20 | ||
| 21 | import java.util.*; | ||
| 22 | import java.util.jar.JarFile; | ||
| 23 | |||
| 25 | public class MappingsConverter { | 24 | public class MappingsConverter { |
| 26 | 25 | ||
| 27 | public static ClassMatches computeClassMatches(JarFile sourceJar, JarFile destJar, Mappings mappings) { | 26 | public static ClassMatches computeClassMatches(JarFile sourceJar, JarFile destJar, Mappings mappings) { |
| @@ -365,14 +364,12 @@ public class MappingsConverter { | |||
| 365 | public Set<BehaviorEntry> filterEntries(Collection<BehaviorEntry> obfDestFields, BehaviorEntry obfSourceField, ClassMatches classMatches) { | 364 | public Set<BehaviorEntry> filterEntries(Collection<BehaviorEntry> obfDestFields, BehaviorEntry obfSourceField, ClassMatches classMatches) { |
| 366 | Set<BehaviorEntry> out = Sets.newHashSet(); | 365 | Set<BehaviorEntry> out = Sets.newHashSet(); |
| 367 | for (BehaviorEntry obfDestField : obfDestFields) { | 366 | for (BehaviorEntry obfDestField : obfDestFields) { |
| 368 | Signature translatedDestSignature = translate(obfDestField.getSignature(), classMatches.getUniqueMatches().inverse()); | 367 | Signature translatedDestSignature = translate(obfDestField.getSignature(), |
| 369 | if (translatedDestSignature == null && obfSourceField.getSignature() == null) { | 368 | classMatches.getUniqueMatches().inverse()); |
| 369 | if ((translatedDestSignature == null && obfSourceField.getSignature() == null) | ||
| 370 | || translatedDestSignature != null && obfSourceField.getSignature() != null | ||
| 371 | && translatedDestSignature.equals(obfSourceField.getSignature())) | ||
| 370 | out.add(obfDestField); | 372 | out.add(obfDestField); |
| 371 | } else if (translatedDestSignature == null || obfSourceField.getSignature() == null) { | ||
| 372 | // skip it | ||
| 373 | } else if (translatedDestSignature.equals(obfSourceField.getSignature())) { | ||
| 374 | out.add(obfDestField); | ||
| 375 | } | ||
| 376 | } | 373 | } |
| 377 | return out; | 374 | return out; |
| 378 | } | 375 | } |