Skip to content

Commit fe2a647

Browse files
committed
Java Codgen: use List<String> when applicable
1 parent 6bae8ed commit fe2a647

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

schema_salad/java_codegen.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,16 @@ def type_loader(
446446
"https://w3id.org/cwl/salad#array",
447447
):
448448
i = self.type_loader(type_declaration["items"])
449+
instance_type = (
450+
"java.util.List<String>"
451+
if i.instance_type == "String"
452+
else "java.util.List<Object>"
453+
)
449454
return self.declare_type(
450455
TypeDef(
451456
# special doesn't work out with subclassing, gotta be more clever
452457
# instance_type="List<{}>".format(i.instance_type),
453-
instance_type="java.util.List<Object>",
458+
instance_type=instance_type,
454459
name=f"array_of_{i.name}",
455460
init=f"new ArrayLoader({i.name})",
456461
loader_type="Loader<java.util.List<{}>>".format(

0 commit comments

Comments
 (0)