- if field_ty.java_hu_ty == var.var_name:
- field_path = field_ty.java_fn_ty_arg.strip("L;").replace("/", ".")
- out_java += "\t\t\tpublic " + field_path + " " + field_ty.arg_name + ";\n"
- java_hu_subclasses = java_hu_subclasses + "\t\tpublic final " + field_path + " " + field_ty.arg_name + ";\n"
- init_meth_params = init_meth_params + field_path + " " + field_ty.arg_name
- else:
- out_java += "\t\t\tpublic " + field_ty.java_ty + " " + field_ty.arg_name + ";\n"
- if field_docs is not None:
- java_hu_subclasses += "\t\t/**\n\t\t * " + field_docs.replace("\n", "\n\t\t * ") + "\n\t\t*/\n"
- java_hu_subclasses += "\t\t"
- if field_ty.nullable:
- java_hu_subclasses += "@Nullable "
- java_hu_subclasses += "public final " + field_ty.java_hu_ty + " " + field_ty.arg_name + ";\n"
- init_meth_params = init_meth_params + field_ty.java_ty + " " + field_ty.arg_name
+ java_ty = field_ty.java_ty
+ if field_ty.java_fn_ty_arg.startswith("L") and field_ty.java_fn_ty_arg.endswith(";"):
+ # If this is a simple enum, we have to reference it in the low-level bindings differently:
+ java_ty = field_ty.java_fn_ty_arg.strip("L;").replace("/", ".")
+ out_java += "\t\t\tpublic " + java_ty + " " + field_ty.arg_name + ";\n"
+ if field_docs is not None:
+ java_hu_subclasses += "\t\t/**\n\t\t * " + field_docs.replace("\n", "\n\t\t * ") + "\n\t\t*/\n"
+ java_hu_subclasses += "\t\t"
+ if field_ty.nullable:
+ java_hu_subclasses += "@Nullable "
+ java_hu_subclasses += "public final " + self.fully_qualified_hu_ty_path(field_ty) + " " + field_ty.arg_name + ";\n"
+ init_meth_params = init_meth_params + java_ty + " " + field_ty.arg_name
+