Versions Compared

Key

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

...

The ExceptionReporter class is documented in rule ERR00-J. Do not suppress or ignore checked exceptions.

Compliant Solution (Java

...

SE 7)

Java 1.SE 7 allows a single catch block to catch multiple exceptions of different types, which prevents redundant code. This compliant solution catches the specific anticipated exceptions (ArithmeticException and IOException) and handles them with one catch clause. All other exceptions are permitted to propagate to the next catch clause of a try statement on the stack.

...