...
This compliant solution provides a clone()
method in the final
class and does not require the elimination of the setter method. The clone()
method returns a copy of the original object. This new object can be freely used without affecting the original object. Using the clone()
method allows the class to remain mutable. (OBJ10-J. Provide mutable classes with copy functionality to allow passing instances to untrusted code safely)
...