Refactor out the getRegCount method into a seperate InvokeInstruction interface
diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/InlineMethodResolver.java b/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/InlineMethodResolver.java
index eb4e9dc..cd0f75c 100644
--- a/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/InlineMethodResolver.java
+++ b/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/InlineMethodResolver.java
@@ -28,8 +28,6 @@
 
 package org.jf.dexlib.Code.Analysis;
 
-import org.jf.dexlib.Code.Format.Instruction35mi;
-import org.jf.dexlib.Code.Format.Instruction3rmi;
 import org.jf.dexlib.Code.OdexedInvokeInline;
 import org.jf.dexlib.Code.OdexedInvokeVirtual;
 
@@ -88,7 +86,7 @@
             }
             return inlineMethods[methodIndex];
         }
-    };
+    }
 
     private static class InlineMethodResolver_version36 extends InlineMethodResolver
     {
@@ -176,11 +174,7 @@
         }
 
         private int getParameterCount(OdexedInvokeInline instruction) {
-            if (instruction instanceof Instruction35mi) {
-                return ((Instruction35mi)instruction).getRegCount();
-            } else {
-                return ((Instruction3rmi)instruction).getRegCount();
-            }
+            return instruction.getRegCount();
         }
-    };
+    }
 }
diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/FiveRegisterInstruction.java b/dexlib/src/main/java/org/jf/dexlib/Code/FiveRegisterInstruction.java
index 1e47689..b9ff066 100644
--- a/dexlib/src/main/java/org/jf/dexlib/Code/FiveRegisterInstruction.java
+++ b/dexlib/src/main/java/org/jf/dexlib/Code/FiveRegisterInstruction.java
@@ -28,8 +28,7 @@
 
 package org.jf.dexlib.Code;
 
-public interface FiveRegisterInstruction {
-    byte getRegCount();
+public interface FiveRegisterInstruction extends InvokeInstruction {
     byte getRegisterA();
     byte getRegisterD();
     byte getRegisterE();
diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35c.java b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35c.java
index 1be1061..bf2a1e5 100644
--- a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35c.java
+++ b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35c.java
@@ -105,7 +105,7 @@
         return Format.Format35c;
     }
 
-    public byte getRegCount() {
+    public short getRegCount() {
         return regCount;
     }
 
diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35mi.java b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35mi.java
index 787bd07..a68b76a 100644
--- a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35mi.java
+++ b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35mi.java
@@ -99,7 +99,7 @@
         return Format.Format35ms;
     }
 
-    public byte getRegCount() {
+    public short getRegCount() {
         return regCount;
     }
 
diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35ms.java b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35ms.java
index 582bc38..2154ef9 100644
--- a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35ms.java
+++ b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35ms.java
@@ -99,7 +99,7 @@
         return Format.Format35ms;
     }
 
-    public byte getRegCount() {
+    public short getRegCount() {
         return regCount;
     }
 
diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35s.java b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35s.java
index 494eccc..8a487f5 100644
--- a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35s.java
+++ b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35s.java
@@ -105,7 +105,7 @@
         return Format.Format35s;
     }
 
-    public byte getRegCount() {
+    public short getRegCount() {
         return regCount;
     }
 
diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/InvokeInstruction.java b/dexlib/src/main/java/org/jf/dexlib/Code/InvokeInstruction.java
new file mode 100644
index 0000000..cb0128c
--- /dev/null
+++ b/dexlib/src/main/java/org/jf/dexlib/Code/InvokeInstruction.java
@@ -0,0 +1,33 @@
+/*
+ * [The "BSD licence"]
+ * Copyright (c) 2011 Ben Gruver
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.jf.dexlib.Code;
+
+public interface InvokeInstruction {
+    short getRegCount();
+}
diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/OdexedInvokeInline.java b/dexlib/src/main/java/org/jf/dexlib/Code/OdexedInvokeInline.java
index 1f077fa..639d740 100644
--- a/dexlib/src/main/java/org/jf/dexlib/Code/OdexedInvokeInline.java
+++ b/dexlib/src/main/java/org/jf/dexlib/Code/OdexedInvokeInline.java
@@ -31,6 +31,6 @@
 
 package org.jf.dexlib.Code;
 
-public interface OdexedInvokeInline {
+public interface OdexedInvokeInline extends InvokeInstruction {
     int getInlineIndex();
 }
diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/RegisterRangeInstruction.java b/dexlib/src/main/java/org/jf/dexlib/Code/RegisterRangeInstruction.java
index c946cc8..21e3719 100644
--- a/dexlib/src/main/java/org/jf/dexlib/Code/RegisterRangeInstruction.java
+++ b/dexlib/src/main/java/org/jf/dexlib/Code/RegisterRangeInstruction.java
@@ -28,7 +28,6 @@
 
 package org.jf.dexlib.Code;
 
-public interface RegisterRangeInstruction {
-    short getRegCount();
+public interface RegisterRangeInstruction extends InvokeInstruction {
     int getStartRegister();
 }