protected final String jniMethodName(MethodDoc method, String cname,
                                         boolean longName) {
        String res = "Java_" + cname + "_" + method.name();

        if (longName) {
            Type mType =  method.returnType();
            Parameter[] params = method.parameters();
            Type argTypes[] = new Type[params.length];
            for(int p = 0; p <  params.length; p++){
                argTypes[p] =  params[p].type();
            }

            res = res + "__";
            for (int i = 0; i < argTypes.length; i++){
                Type t = argTypes[i];
                String tname = t.typeName();
                TypeSignature newTypeSig = new TypeSignature(root);
                String sig = newTypeSig.getTypeSignature(tname);
                res = res + nameToIdentifier(sig);
            }
        }
        return res;
    }