From 2f243794d7f279cdc81628a94533b70404bbe888 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 11 Feb 2021 20:57:38 -0500 Subject: [PATCH] Properly convert 2D arrays in from_hu_conv --- gen_type_mapping.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- 2.39.5