Skip to content

Make Name properly immutable #160

@nresare

Description

@nresare

The public API of Name is immutable, meaning that there are no methods that can be used to change the state of a Name instance once constructed. However, as an implementation detail of how the public constructors populate the fields of the class, they end up calling private api that modifies state repeatedly.

Having only final fields in immutable objects is good house keeping, but unfortunately test coverage is not very high for Name so it is a bit scary to do refactoring work. Getting to, or close to 100% unit test coverage and then update the implementation to allow for using the final modifier with all fields would be a neat contribution in my opinion.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions