Skip to content

Commit

Permalink
Fix empty list factory method generation
Browse files Browse the repository at this point in the history
- Do not generate and empty list factory
method in case we have type mapping with
conversion

Issue: #160
  • Loading branch information
muehmar committed Oct 8, 2024
1 parent 473838d commit 6f748c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ private static Generator<JavaArrayPojo, PojoSettings> emptyFactoryMethod() {
}

private static boolean arrayPojoHasStandardListType(JavaArrayPojo arrayPojo) {
return arrayPojo.getJavaArrayType().getQualifiedClassName().equals(QualifiedClassNames.LIST);
return arrayPojo.getJavaArrayType().getQualifiedClassName().equals(QualifiedClassNames.LIST)
&& arrayPojo.getJavaArrayType().hasNoApiTypeDeep();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public static PosologyDto empty() {
arrayPojoFullyTypeMappedWithConversion=[
com.custom.CustomList
com.custom.CustomString
java.util.Collections
java.util.List
java.util.function.Function

Expand All @@ -33,9 +32,6 @@ public static PosologyDto fromItems(CustomList<CustomString> items) {
);
}

public static PosologyDto empty() {
return fromItems(Collections.emptyList());
}
]


Expand Down

0 comments on commit 6f748c1

Please sign in to comment.