Randgalt / record-builder

Record builder generator for Java records
Apache License 2.0
756 stars 55 forks source link

Fix addSingleItemCollectionBuilders when useImmutableCollections is false #130

Closed Randgalt closed 2 years ago

Randgalt commented 2 years ago

Fixes #129

cc @mads-b, @freelon, @tmichel

freelon commented 2 years ago
freelon commented 2 years ago

On a separate note, now if I use the collection setter (addSingleItemCollectionBuilders=true) with e.g. an ArrayList I'll get an exception later if I try myRecords.someList().add(...) because it became immutable without me asking for immutable lists..

Randgalt commented 2 years ago

I see - these two features may be hopelessly broken: addSingleItemCollectionBuilders is the real troublesome one. I'll think more about this and possibly do something similar to this