Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Removed text saying this was a stub, and aded related Vuls section

This is a stub. It needs an example of an error caused by using the base class's object where the subclass's object was expected. It should not produce a RuntimeException (ClassCastException) to qualify.

When a nonfinal class defines a clone() method that does not call super.clone(), cloning a subtype will produce an object of the wrong type.

...

Automated detection is straightforward.

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this guideline on the CERT website.

Bibliography

...