Skip to content
This repository has been archived by the owner on Aug 8, 2020. It is now read-only.

add new test for clone implementation #2

Open
SierraGolf opened this issue Aug 21, 2012 · 0 comments
Open

add new test for clone implementation #2

SierraGolf opened this issue Aug 21, 2012 · 0 comments
Milestone

Comments

@SierraGolf
Copy link
Member

aspects

  • presence
    • is the method actually declared
  • completeness
    • every property which is not excluded must be copied, meaning the original and the copy must have the same value (not reference) after copying
    • one can not assure 100% that the property is really copied or if by accident the default value of the object matches the values used for testing
  • deep copy
    • every non-immutable and non-primitive property must be a deep copy, meaning the reference of the original and the copy must be different
    • can that actually be achieved with the current implementation of cg-proxy for interfaces, abstract and concrete classes?
    • may this be optional?
  • null-safety
    • the implementation of the clone method must be able to handle null values for every property which is not excluded

notes

  • does it make sense to compare the toString, equals and hashCode results of the cloned object to its original?
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant