Skip to content
This repository was archived by the owner on Feb 8, 2023. It is now read-only.
This repository was archived by the owner on Feb 8, 2023. It is now read-only.

Implement the builder pattern to make the Cookies.Attributes immutable. #9

@FagnerMartinsBrack

Description

@FagnerMartinsBrack

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 the set method and before the return, despite the set method being implicitly locked by the synchronized keyword or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions