protected static int makeBody0(CtClass clazz, ClassFile classfile,
                                   CtMethod wrappedBody,
                                   boolean isStatic, CtClass[] parameters,
                                   CtClass returnType, ConstParameter cparam,
                                   Bytecode code)
        throws CannotCompileException
    {
        if (!(clazz instanceof CtClassType))
            throw new CannotCompileException("bad declaring class"
                                             + clazz.getName());

        if (!isStatic)
            code.addAload(0);

        int stacksize = compileParameterList(code, parameters,
                                             (isStatic ? 0 : 1));
        int stacksize2;
        String desc;
        if (cparam == null) {
            stacksize2 = 0;
            desc = ConstParameter.defaultDescriptor();
        }
        else {
            stacksize2 = cparam.compile(code);
            desc = cparam.descriptor();
        }

        checkSignature(wrappedBody, desc);

        String bodyname;
        try {
            bodyname = addBodyMethod((CtClassType)clazz, classfile,
                                     wrappedBody);
            /* if an exception is thrown below, the method added above
             * should be removed. (future work :<)
             */
        }
        catch (BadBytecode e) {
            throw new CannotCompileException(e);
        }

        if (isStatic)
            code.addInvokestatic(Bytecode.THIS, bodyname, desc);
        else
            code.addInvokespecial(Bytecode.THIS, bodyname, desc);

        compileReturn(code, returnType);        // consumes 2 stack entries

        if (stacksize < stacksize2 + 2)
            stacksize = stacksize2 + 2;

        return stacksize;
    }