repair breakage
[org.ibex.classgen.git] / src / org / ibex / classgen / MethodGen.java
index 90edacd..492cd76 100644 (file)
@@ -53,7 +53,7 @@ public class MethodGen extends Type.Class.Method.Body implements CGConst {
         m.super();
         this.flags = flags;
         if ((flags & ~VALID_METHOD_FLAGS) != 0) throw new ClassFile.ClassReadExn("invalid flags");
-        this.method = c.method(name,typeDescriptor);
+        this.method = m;
         this.attrs = new ClassFile.AttrGen(in,cp);
         
         if ((flags & (NATIVE|ABSTRACT))==0)  {
@@ -579,7 +579,7 @@ public class MethodGen extends Type.Class.Method.Body implements CGConst {
     */
     void finish(ConstantPool cp) {
         cp.addUtf8(method.name);
-        cp.addUtf8(method.getDescriptor());
+        cp.addUtf8(method.getTypeDescriptor());
         
         for(Enumeration e = thrownExceptions.keys();e.hasMoreElements();)
             cp.add(e.nextElement());
@@ -901,7 +901,7 @@ public class MethodGen extends Type.Class.Method.Body implements CGConst {
         
         o.writeShort(flags);
         o.writeShort(cp.getUtf8Index(method.name));
-        o.writeShort(cp.getUtf8Index(method.getDescriptor()));
+        o.writeShort(cp.getUtf8Index(method.getTypeDescriptor()));
         attrs.dump(o,cp);
     }
     
@@ -1008,7 +1008,7 @@ public class MethodGen extends Type.Class.Method.Body implements CGConst {
             sb.append(OP_NAMES[op[i]&0xff]);
             String s = null;
             if (arg[i] instanceof Type) s = ((Type)arg[i]).debugToString();
-            else if (arg[i] instanceof Type.Class.Member) s = ((Type.Class.Member)arg[i]).toString();
+            else if (arg[i] instanceof Type.Class.Member) s = ((Type.Class.Member)arg[i]).debugToString();
             else if (arg[i] instanceof String) s = "\"" + s + "\"";
             else if (arg[i] != null) s = arg[i].toString();
             if (s != null) sb.append(" ").append(s);