def METHOD_NAME(typ):
    # jobject as a return type is not given here; instead use a type
    type_map = {
        "void": "void",
        "jstring": "String",
        "JString": "String",
        "JObject": "Object",
        "JClass": "Class",
        "jbyteArray": "byte[]",
        "jlongArray": "long[]",
        "ObjectHandle": "long",
        "jint": "int",
        "jlong": "long",
        "jboolean": "boolean",
    }
    if typ in type_map:
        return type_map[typ]
    # Assume anything prefixed with "Java" refers to an object
    if typ.startswith('JavaReturn'):
        return typ[10:]
    if typ.startswith('Java'):
        return typ[4:]
    raise Exception("Don't know what to do with a", typ)