Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Calling overridable methods on the clone under construction can expose class internals to malicious code or violate class invariants by exposing the clone to trusted code in a partially initialized state, affording the opportunity to corrupt the state of the clone, the object being cloned, or both.

...

Automated detection is straightforward.

Bibliography

[Bloch 2008]

Item 11. Override clone judiciously

[Gong 2003]

 

...

      Rule 06: Methods (MET)