This repository has been archived by the owner on Feb 8, 2023. It is now read-only.
Implement the builder pattern to make the Cookies.Attributes
immutable.
#9
Milestone
In js-cookie the attributes are specified using an Object Literal instance. In Java we can make a step forward and ensure that the passed attributes are not going to be changed by external code, creating a builder that builds an immutable instance of the
Attributes
object.As it currently stands, the invariants of the
Attributes
object can be changed in a multi-thread environment even after it is passed to theset
method and before the return, despite theset
method being implicitly locked by thesynchronized
keyword or not.The text was updated successfully, but these errors were encountered: