From b4aaff683d78ab92b83f3a7257c33b8e27d1affa Mon Sep 17 00:00:00 2001 From: Thog Date: Tue, 7 Mar 2017 21:24:39 +0100 Subject: Drop unix case style and implement hashCode when equals is overrided Also update Guava to version 21 --- .../java/cuchaz/enigma/convert/MemberMatches.java | 70 +++++++++++----------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'src/main/java/cuchaz/enigma/convert/MemberMatches.java') diff --git a/src/main/java/cuchaz/enigma/convert/MemberMatches.java b/src/main/java/cuchaz/enigma/convert/MemberMatches.java index 25af2f8..51cee85 100644 --- a/src/main/java/cuchaz/enigma/convert/MemberMatches.java +++ b/src/main/java/cuchaz/enigma/convert/MemberMatches.java @@ -21,29 +21,29 @@ import java.util.Set; public class MemberMatches { - private BiMap m_matches; - private Multimap m_matchedSourceEntries; - private Multimap m_unmatchedSourceEntries; - private Multimap m_unmatchedDestEntries; - private Multimap m_unmatchableSourceEntries; + private BiMap matches; + private Multimap matchedSourceEntries; + private Multimap unmatchedSourceEntries; + private Multimap unmatchedDestEntries; + private Multimap unmatchableSourceEntries; public MemberMatches() { - m_matches = HashBiMap.create(); - m_matchedSourceEntries = HashMultimap.create(); - m_unmatchedSourceEntries = HashMultimap.create(); - m_unmatchedDestEntries = HashMultimap.create(); - m_unmatchableSourceEntries = HashMultimap.create(); + matches = HashBiMap.create(); + matchedSourceEntries = HashMultimap.create(); + unmatchedSourceEntries = HashMultimap.create(); + unmatchedDestEntries = HashMultimap.create(); + unmatchableSourceEntries = HashMultimap.create(); } public void addMatch(T srcEntry, T destEntry) { - boolean wasAdded = m_matches.put(srcEntry, destEntry) == null; + boolean wasAdded = matches.put(srcEntry, destEntry) == null; assert (wasAdded); - wasAdded = m_matchedSourceEntries.put(srcEntry.getClassEntry(), srcEntry); + wasAdded = matchedSourceEntries.put(srcEntry.getClassEntry(), srcEntry); assert (wasAdded); } public void addUnmatchedSourceEntry(T sourceEntry) { - boolean wasAdded = m_unmatchedSourceEntries.put(sourceEntry.getClassEntry(), sourceEntry); + boolean wasAdded = unmatchedSourceEntries.put(sourceEntry.getClassEntry(), sourceEntry); assert (wasAdded); } @@ -56,7 +56,7 @@ public class MemberMatches { public void addUnmatchedDestEntry(T destEntry) { if (destEntry.getName().equals("") || destEntry.getName().equals("")) return; - boolean wasAdded = m_unmatchedDestEntries.put(destEntry.getClassEntry(), destEntry); + boolean wasAdded = unmatchedDestEntries.put(destEntry.getClassEntry(), destEntry); assert (wasAdded); } @@ -67,63 +67,63 @@ public class MemberMatches { } public void addUnmatchableSourceEntry(T sourceEntry) { - boolean wasAdded = m_unmatchableSourceEntries.put(sourceEntry.getClassEntry(), sourceEntry); + boolean wasAdded = unmatchableSourceEntries.put(sourceEntry.getClassEntry(), sourceEntry); assert (wasAdded); } public Set getSourceClassesWithUnmatchedEntries() { - return m_unmatchedSourceEntries.keySet(); + return unmatchedSourceEntries.keySet(); } public Collection getSourceClassesWithoutUnmatchedEntries() { Set out = Sets.newHashSet(); - out.addAll(m_matchedSourceEntries.keySet()); - out.removeAll(m_unmatchedSourceEntries.keySet()); + out.addAll(matchedSourceEntries.keySet()); + out.removeAll(unmatchedSourceEntries.keySet()); return out; } public Collection getUnmatchedSourceEntries() { - return m_unmatchedSourceEntries.values(); + return unmatchedSourceEntries.values(); } public Collection getUnmatchedSourceEntries(ClassEntry sourceClass) { - return m_unmatchedSourceEntries.get(sourceClass); + return unmatchedSourceEntries.get(sourceClass); } public Collection getUnmatchedDestEntries() { - return m_unmatchedDestEntries.values(); + return unmatchedDestEntries.values(); } public Collection getUnmatchedDestEntries(ClassEntry destClass) { - return m_unmatchedDestEntries.get(destClass); + return unmatchedDestEntries.get(destClass); } public Collection getUnmatchableSourceEntries() { - return m_unmatchableSourceEntries.values(); + return unmatchableSourceEntries.values(); } public boolean hasSource(T sourceEntry) { - return m_matches.containsKey(sourceEntry) || m_unmatchedSourceEntries.containsValue(sourceEntry); + return matches.containsKey(sourceEntry) || unmatchedSourceEntries.containsValue(sourceEntry); } public boolean hasDest(T destEntry) { - return m_matches.containsValue(destEntry) || m_unmatchedDestEntries.containsValue(destEntry); + return matches.containsValue(destEntry) || unmatchedDestEntries.containsValue(destEntry); } public BiMap matches() { - return m_matches; + return matches; } public boolean isMatchedSourceEntry(T sourceEntry) { - return m_matches.containsKey(sourceEntry); + return matches.containsKey(sourceEntry); } public boolean isMatchedDestEntry(T destEntry) { - return m_matches.containsValue(destEntry); + return matches.containsValue(destEntry); } public boolean isUnmatchableSourceEntry(T sourceEntry) { - return m_unmatchableSourceEntries.containsEntry(sourceEntry.getClassEntry(), sourceEntry); + return unmatchableSourceEntries.containsEntry(sourceEntry.getClassEntry(), sourceEntry); } public void makeMatch(T sourceEntry, T destEntry) { makeMatch(sourceEntry, destEntry, null, null); @@ -136,15 +136,15 @@ public class MemberMatches { sourceEntry = (T) sourceEntry.cloneToNewClass(sourceDeobfuscator.getJarIndex().getTranslationIndex().resolveEntryClass(sourceEntry, true)); destEntry = (T) destEntry.cloneToNewClass(destDeobfuscator.getJarIndex().getTranslationIndex().resolveEntryClass(destEntry, true)); } - boolean wasRemoved = m_unmatchedSourceEntries.remove(sourceEntry.getClassEntry(), sourceEntry); + boolean wasRemoved = unmatchedSourceEntries.remove(sourceEntry.getClassEntry(), sourceEntry); assert (wasRemoved); - wasRemoved = m_unmatchedDestEntries.remove(destEntry.getClassEntry(), destEntry); + wasRemoved = unmatchedDestEntries.remove(destEntry.getClassEntry(), destEntry); assert (wasRemoved); addMatch(sourceEntry, destEntry); } public boolean isMatched(T sourceEntry, T destEntry) { - T match = m_matches.get(sourceEntry); + T match = matches.get(sourceEntry); return match != null && match.equals(destEntry); } @@ -159,9 +159,9 @@ public class MemberMatches { destDeobfuscator.getJarIndex().getTranslationIndex().resolveEntryClass(destEntry, true)); } - boolean wasRemoved = m_matches.remove(sourceEntry) != null; + boolean wasRemoved = matches.remove(sourceEntry) != null; assert (wasRemoved); - wasRemoved = m_matchedSourceEntries.remove(sourceEntry.getClassEntry(), sourceEntry); + wasRemoved = matchedSourceEntries.remove(sourceEntry.getClassEntry(), sourceEntry); assert (wasRemoved); addUnmatchedSourceEntry(sourceEntry); addUnmatchedDestEntry(destEntry); @@ -175,7 +175,7 @@ public class MemberMatches { sourceDeobfuscator.getJarIndex().getTranslationIndex().resolveEntryClass(sourceEntry, true)); } assert (!isMatchedSourceEntry(sourceEntry)); - boolean wasRemoved = m_unmatchedSourceEntries.remove(sourceEntry.getClassEntry(), sourceEntry); + boolean wasRemoved = unmatchedSourceEntries.remove(sourceEntry.getClassEntry(), sourceEntry); assert (wasRemoved); addUnmatchableSourceEntry(sourceEntry); } -- cgit v1.2.3