Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: mostly minor

Few, if any, methods are capable of handling all possible runtime exceptions. Consequently, methods are forbidden to catch RuntimeException. When a method catches RuntimeException, it may receive exceptions unanticipated by the designer, such as NullPointerException. Many catch clauses simply log or ignore the enclosed exceptional condition, and attempt to resume normal execution; this practice often violates guideline EXC00 ERR00-J. Do not suppress or ignore checked exceptions. Runtime exceptions often indicate bugs in the program that should be fixed by the developer, and often cause control flow vulnerabilities. Methods are also forbidden to catch Exception or Throwable, because this implies catching RuntimeException; RuntimeException extends Exception which in turn extends Throwable.

...