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

copy() methods should have assertions that they are called from their own class #12

Open
metteo opened this issue Sep 1, 2014 · 0 comments

Comments

@metteo
Copy link
Owner

metteo commented Sep 1, 2014

First line of every copy():
assert getClass() == < LiteralOfImplementingClass >.class

Mainly to limit cases where copy is used and only partial copy would be provided. This is not needed in case of clone() because it makes shallow copy automatically.

Something else than assert is also feasible.

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