cleanup of MethodRef, FieldRef, MemberRef
[org.ibex.classgen.git] / src / org / ibex / classgen / MethodGen.java
index e2d3b68..32fd705 100644 (file)
@@ -83,7 +83,7 @@ public class MethodGen implements CGConst {
     }
     
     /** Returns the descriptor string for this method */
-    public String getDescriptor() { return MethodRef.getDescriptor(ret, args); }
+    public String getDescriptor() { return new MethodRef(null, name, ret, args).getDescriptor(); }
     
     private class ExnTableEnt {
         public int start;
@@ -275,9 +275,11 @@ public class MethodGen implements CGConst {
                 
                 if(arg instanceof Long || arg instanceof Double) op = LDC2_W;
                 break;
-            case INVOKEINTERFACE:
-                if(arg instanceof MethodRef) arg = new MethodRef.I((MethodRef)arg);
+            case INVOKEINTERFACE: {
+                MethodRef mr = (MethodRef)arg;
+                if(arg instanceof MethodRef) arg = new MethodRef.I(mr.klass, mr.name, mr.returnType, mr.argTypes);
                 break;
+            }
         }
         int opdata = OP_DATA[op&0xff];
         if((opdata&OP_CPENT_FLAG) != 0 && !(arg instanceof CPGen.Ent))