Merge 1bb9f5195d7629c84030637854903ee2c8831041 on remote branch

Change-Id: I548767e5c6d2a9dfeae30e1c4ea9e57d82be802e
diff --git a/dexgen/src/com/android/dexgen/dex/file/StringIdItem.java b/dexgen/src/com/android/dexgen/dex/file/StringIdItem.java
index 30f31d4..f7d1408 100644
--- a/dexgen/src/com/android/dexgen/dex/file/StringIdItem.java
+++ b/dexgen/src/com/android/dexgen/dex/file/StringIdItem.java
@@ -24,7 +24,7 @@
  * Representation of a string inside a Dalvik file.
  */
 public final class StringIdItem
-        extends IndexedItem implements Comparable {
+        extends IndexedItem implements Comparable<StringIdItem> {
     /** size of instances when written out to a file, in bytes */
     public static final int WRITE_SIZE = 4;
 
@@ -66,9 +66,8 @@
     }
 
     /** {@inheritDoc} */
-    public int compareTo(Object other) {
-        StringIdItem otherString = (StringIdItem) other;
-        return value.compareTo(otherString.value);
+    public int compareTo(StringIdItem other) {
+        return value.compareTo(other.value);
     }
 
     /** {@inheritDoc} */
diff --git a/dx/src/com/android/dx/dex/file/CallSiteIdItem.java b/dx/src/com/android/dx/dex/file/CallSiteIdItem.java
index cf0bb24..ffe445e 100644
--- a/dx/src/com/android/dx/dex/file/CallSiteIdItem.java
+++ b/dx/src/com/android/dx/dex/file/CallSiteIdItem.java
@@ -23,7 +23,7 @@
 /**
  * Representation of a call site reference in a DEX file.
  */
-public final class CallSiteIdItem extends IndexedItem implements Comparable {
+public final class CallSiteIdItem extends IndexedItem implements Comparable<CallSiteIdItem> {
 
     /** The item size when placed in a DEX file. */
     private static final int ITEM_SIZE = 4;
@@ -83,8 +83,7 @@
 
     /** {@inheritDoc} */
     @Override
-    public int compareTo(Object o) {
-        CallSiteIdItem other = (CallSiteIdItem) o;
+    public int compareTo(CallSiteIdItem other) {
         return invokeDynamicRef.compareTo(other.invokeDynamicRef);
     }
 }
diff --git a/dx/src/com/android/dx/dex/file/StringIdItem.java b/dx/src/com/android/dx/dex/file/StringIdItem.java
index e4fb559..29d399a 100644
--- a/dx/src/com/android/dx/dex/file/StringIdItem.java
+++ b/dx/src/com/android/dx/dex/file/StringIdItem.java
@@ -25,7 +25,7 @@
  * Representation of a string inside a Dalvik file.
  */
 public final class StringIdItem
-        extends IndexedItem implements Comparable {
+        extends IndexedItem implements Comparable<StringIdItem> {
     /** {@code non-null;} the string value */
     private final CstString value;
 
@@ -65,9 +65,8 @@
 
     /** {@inheritDoc} */
     @Override
-    public int compareTo(Object other) {
-        StringIdItem otherString = (StringIdItem) other;
-        return value.compareTo(otherString.value);
+    public int compareTo(StringIdItem other) {
+        return value.compareTo(other.value);
     }
 
     /** {@inheritDoc} */