Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: removed one sentence that did not follow from the previous text

Methods must not throw RuntimeException or Exception. Handling these exceptions requires catching RuntimeException, which is disallowed by rule ERR14-J. Do not catch RuntimeException. Moreover, throwing a RuntimeException can lead to subtle errors, for instanceexample, a caller cannot examine the exception to determine why it was thrown, and consequently cannot attempt recovery.

...

Code Block
bgColor#ccccff
private void doSomething() throws IOException {
  //...
}

...

Exceptions

EXC13-EX0: Classes that sanitize exceptions to comply with a security policy are permitted to translate specific exceptions into more general exceptions. This translation could potentially result in throwing RuntimeException or Exception in some cases, depending on the details of the security policy.

...