From: Matt Corallo Date: Thu, 27 Oct 2022 05:26:55 +0000 (+0000) Subject: [Java] Fix calling trait methods which return simple enums from C X-Git-Tag: v0.0.112.0^2~12 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=d18825a6f55fc94cf7a55f30a7d87ad8304f6e8d;p=ldk-java [Java] Fix calling trait methods which return simple enums from C --- diff --git a/java_strings.py b/java_strings.py index 487df5d6..b2a9d853 100644 --- a/java_strings.py +++ b/java_strings.py @@ -1013,8 +1013,8 @@ import javax.annotation.Nullable; if fn_line.ret_ty_info.c_ty.endswith("Array"): out_c = out_c + "\t" + fn_line.ret_ty_info.c_ty + " ret = (*env)->CallObjectMethod(env, obj, j_calls->" + fn_line.fn_name + "_meth" elif fn_line.ret_ty_info.c_ty == "void": - out_c += "\t(*env)->Call" + fn_line.ret_ty_info.java_ty.title() + "Method(env, obj, j_calls->" + fn_line.fn_name + "_meth" - elif fn_line.ret_ty_info.java_hu_ty == "String": + out_c += "\t(*env)->CallVoidMethod(env, obj, j_calls->" + fn_line.fn_name + "_meth" + elif fn_line.ret_ty_info.java_hu_ty == "String" or "org/ldk/enums" in fn_line.ret_ty_info.java_fn_ty_arg: # Manually write out String methods as they're just an Object out_c += "\t" + fn_line.ret_ty_info.c_ty + " ret = (*env)->CallObjectMethod(env, obj, j_calls->" + fn_line.fn_name + "_meth" elif not fn_line.ret_ty_info.passed_as_ptr: