From 48908aa4bff44de4a5a7894c8f1ffc1b25a5d8d9 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 7 Aug 2021 22:24:22 +0000 Subject: [PATCH] Use explicit paths for function arguments in Java When we have an enum with a variant named the same as a struct we need to specify a full concrete path when referring to it. The simplest approach is to just use full concrete paths for all function arguments, which we do here. --- java_strings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/java_strings.py b/java_strings.py index ed9381c4..3482dfb9 100644 --- a/java_strings.py +++ b/java_strings.py @@ -1173,7 +1173,10 @@ import javax.annotation.Nullable; else: if arg.nullable: out_java_struct += "@Nullable " - out_java_struct += (arg.java_hu_ty + " " + arg.arg_name) + ty_string = arg.java_hu_ty + if arg.java_fn_ty_arg[0] == "L" and arg.java_fn_ty_arg[len(arg.java_fn_ty_arg) - 1] == ";": + ty_string = arg.java_fn_ty_arg.strip("L;").replace("/", ".") + out_java_struct += ty_string + " " + arg.arg_name out_java += (");\n") out_c += (") {\n") if out_java_struct is not None: -- 2.30.2