Closed Shibi-bala closed 2 months ago
Type
Description
In terms of sequencing, I think we should split this up into a few parts:
1) new generic list factory methods ConjureCollections which do not allow null values + update codegen to use them. note that list<any>
should perhaps be allowed to contain null, as List.of(Optional.empty())
serializes to [null]
which deserializes as an array containing null.
2) new specialized list factory methods for primitives in ConjureCollections.java, however these methods return the same types as in [1], but without generic inputs. Codegen can be updated to use these where possible
3) We can replace the types returned by the primitive-specialized methods with more efficient collection implementations without impacting behavior because we already have validation against nulls.
this sequencing is helpful because it enforces consistent non-nullness for all conjure collections, rather than based on specific types being used.
new generic list factory methods ConjureCollections which do not allow null values + update codegen to use them
@carterkozak Just to clarify this, should these new non-null ConjureCollections methods only be used if options.nonNullCollections is true. Otherwise, this is going to cause a break right?
That's correct
Before this PR
Conjure holds primitive arrays as boxed lists. Instead, we can switch to primitive array lists that are backed by primitive typed arrays (double[]) rather than lists (ArrayList).
After this PR
==COMMIT_MSG== ==COMMIT_MSG==
Possible downsides?