public void addReturn(CtClass type) {
        if (type == null)
            addOpcode(RETURN);
        else if (type.isPrimitive()) {
            CtPrimitiveType ptype = (CtPrimitiveType)type;
            addOpcode(ptype.getReturnOp());
        }
        else
            addOpcode(ARETURN);
    }