Versions Compared

Key

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

Methods are forbidden from throwing to throw RuntimeException or Exception. Handling these exceptions requires catching RuntimeException, which is forbidden in guideline EXC14-J. Catch specific exceptions rather than the more general RuntimeException or Exception. Moreover, throwing a RuntimeException can lead to subtle errors, for instance, a caller cannot examine the exception to determine why it was thrown, and consequently cannot attempt recovery.

...