Adam Hurwitz
1 min readApr 13, 2019

--

Thanks for the post! Elaborating on why it is a bad idea to use copy() on data classes with mutable attributes is because if the mutable attributes are updated after the object is copied then both the original and new object will have it’s attribute values altered producing potentially unintended consequences.

Copy only works well on entirely immutable objects.

--

--

Adam Hurwitz
Adam Hurwitz

Written by Adam Hurwitz

An account about nothing | Researcher and product consultant

No responses yet