From 9062640179cf851de50e62381c45f17a372edf16 Mon Sep 17 00:00:00 2001 From: Ben Gruver Date: Wed, 17 Apr 2013 00:25:05 -0700 Subject: [PATCH] Fix issue with interning proto_id_items while writing dex file --- dexlib2/src/main/java/org/jf/dexlib2/writer/ProtoPool.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dexlib2/src/main/java/org/jf/dexlib2/writer/ProtoPool.java b/dexlib2/src/main/java/org/jf/dexlib2/writer/ProtoPool.java index 51adf903..b0b93ae8 100644 --- a/dexlib2/src/main/java/org/jf/dexlib2/writer/ProtoPool.java +++ b/dexlib2/src/main/java/org/jf/dexlib2/writer/ProtoPool.java @@ -35,6 +35,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Ordering; import org.jf.dexlib2.iface.reference.MethodReference; +import org.jf.util.CharSequenceUtils; import org.jf.util.CollectionUtils; import org.jf.util.ExceptionWithContext; @@ -116,7 +117,7 @@ public class ProtoPool { } @Nonnull public String getReturnType() { return method.getReturnType(); } - @Nonnull public Collection getParameters() { + @Nonnull public List getParameters() { return method.getParameterTypes(); } @@ -151,7 +152,7 @@ public class ProtoPool { @Override public int hashCode() { int hashCode = getReturnType().hashCode(); - return hashCode*31 + getParameters().hashCode(); + return hashCode*31 + CharSequenceUtils.listHashCode(getParameters()); } @Override @@ -159,7 +160,7 @@ public class ProtoPool { if (o instanceof Key) { Key other = (Key)o; return getReturnType().equals(other.getReturnType()) && - getParameters().equals(other.getParameters()); + CharSequenceUtils.listEquals(getParameters(), other.getParameters()); } return false; }