eliminated MethodRef.I
[org.ibex.classgen.git] / src / org / ibex / classgen / MethodGen.java
index e2d3b68..31d1229 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,13 +275,15 @@ 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: {
                 break;
+            }
         }
         int opdata = OP_DATA[op&0xff];
-        if((opdata&OP_CPENT_FLAG) != 0 && !(arg instanceof CPGen.Ent))
-            arg = cp.add(arg);
+        if((opdata&OP_CPENT_FLAG) != 0 && !(arg instanceof CPGen.Ent)) {
+            if (op==INVOKEINTERFACE) arg = cp.add(arg, true);
+            else arg = cp.add(arg);
+        }
         else if((opdata&OP_VALID_FLAG) == 0)
             throw new IllegalArgumentException("unknown bytecode");
         this.op[pos] = op;