From: Matt Corallo Date: Fri, 12 Feb 2021 01:57:38 +0000 (-0500) Subject: Properly convert 2D arrays in from_hu_conv X-Git-Tag: v0.0.98~13^2~8 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=2f243794d7f279cdc81628a94533b70404bbe888;p=ldk-java Properly convert 2D arrays in from_hu_conv --- diff --git a/gen_type_mapping.py b/gen_type_mapping.py index 3868daeb..dfb2b57e 100644 --- a/gen_type_mapping.py +++ b/gen_type_mapping.py @@ -165,7 +165,7 @@ class TypeMappingGenerator: elif subty.java_ty == "long": from_hu_conv = ("Arrays.stream(" + arr_name + ").map(" + conv_name + " -> " + subty.from_hu_conv[0] + ").toArray()", "/* TODO 2 " + subty.java_hu_ty + " */") else: - from_hu_conv = ("(" + ty_info.java_ty + ")Arrays.stream(" + arr_name + ").map(" + conv_name + " -> " + subty.from_hu_conv[0] + ").toArray()", "/* TODO 2 " + subty.java_hu_ty + " */") + from_hu_conv = ("Arrays.stream(" + arr_name + ").map(" + conv_name + " -> " + subty.from_hu_conv[0] + ").toArray(" + ty_info.java_ty + "::new)", "/* TODO 2 " + subty.java_hu_ty + " */") return ConvInfo(ty_info = ty_info, arg_name = ty_info.var_name, arg_conv = arg_conv, arg_conv_name = arg_conv_name, arg_conv_cleanup = arg_conv_cleanup,