Inspectopedia Help

Error handling

'Error' not rethrown   New in this release

Reports try statements that catch java.lang.Error or any of its subclasses and do not rethrow the error.

'ThreadDeath' not rethrown   New in this release

Reports try statements that catch java.lang.ThreadDeath and do not rethrow the exception.

'continue' or 'break' inside 'finally' block  

Reports break or continue statements inside of finally blocks.

'finally' block which can not complete normally   New in this release

Reports return, throw, break, continue, and yield statements that are used inside finally blocks.

'instanceof' on 'catch' parameter   New in this release

Reports cases in which an instanceof expression is used for testing the type of a parameter in a catch block.

'null' thrown   New in this release

Reports null literals that are used as the argument of a throw statement.

'return' inside 'finally' block  

Reports return statements inside of finally blocks.

'throw' caught by containing 'try' statement   New in this release

Reports throw statements whose exceptions are always caught by containing try statements.

'throw' inside 'catch' block which ignores the caught exception   New in this release

Reports exceptions that are thrown from inside catch blocks but do not "wrap" the caught exception.

'throw' inside 'finally' block  

Reports throw statements inside finally blocks.

Catch block may ignore exception   New in this release

Reports catch blocks that are empty or may ignore an exception.

Caught exception is immediately rethrown   New in this release

Reports catch blocks that immediately rethrow the caught exception without performing any action on it.

Checked exception class   New in this release

Reports checked exception classes (that is, subclasses of java.lang.Exception that are not subclasses of java.lang.RuntimeException).

Class directly extends 'Throwable'   New in this release

Reports classes that directly extend java.lang.Throwable.

Empty 'finally' block  

Reports empty finally blocks.

Empty 'try' block  

Reports empty try blocks, including try-with-resources statements.

Exception constructor called without arguments   New in this release

Reports creation of a exception instance without any arguments specified.

Nested 'try' statement   New in this release

Reports nested try statements.

Non-final field of 'Exception' class   New in this release

Reports fields in subclasses of java.lang.Exception that are not declared final.

Overly broad 'catch' block   New in this release

Reports catch blocks with parameters that are more generic than the exception thrown by the corresponding try block.

Overly broad 'throws' clause   New in this release

Reports throws clauses with exceptions that are more generic than the exceptions that the method actually throws.

Prohibited 'Exception' caught   New in this release

Reports catch clauses that catch an inappropriate exception.

Prohibited exception declared   New in this release

Reports methods that declare an inappropriate exception in their throws clause.

Prohibited exception thrown   New in this release

Reports throw statements that throw an inappropriate exception.

Throwable supplier never returns a value   New in this release

Reports Supplier lambdas in Optional.orElseThrow() calls that throw an exception, instead of returning it.

Unchecked 'Exception' class   New in this release

Reports subclasses of java.lang.RuntimeException.

Unchecked exception declared in 'throws' clause   New in this release

Reports declaration of an unchecked exception (java.lang.RuntimeException or one of its subclasses) in the throws clause of a method.

Unnecessary call to 'Throwable.initCause()'   New in this release

Reports calls to Throwable.initCause() where an exception constructor also takes a Throwable cause argument.

Last modified: 11 September 2024