Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Immutable Piece Move providers #3

Open
rajat-g opened this issue Jun 17, 2022 · 0 comments
Open

Immutable Piece Move providers #3

rajat-g opened this issue Jun 17, 2022 · 0 comments

Comments

@rajat-g
Copy link

rajat-g commented Jun 17, 2022

Instead of explicitly mentioning/creating ImmutableList every time in Test Helpers while creating Piece. This should be the logic of Piece that is it should copy the passed PieceMove Provider and should not leak reference from the getter method also.
That is:

A parameterized constructor should initialize all the fields performing a deep copy so that data members can’t be modified with an object reference.

Deep Copy of objects should be performed in the getter methods to return a copy rather than returning the actual object reference)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant