Inspectopedia Help

Error handling

'Error' not rethrown  

Reports try statements that catch java.

'ThreadDeath' not rethrown  

Reports try statements that catch java.

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

Reports break or continue statements inside of finally blocks.

'finally' block which can not complete normally  

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

'instanceof' on 'catch' parameter  

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

'null' thrown  

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  

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

'throw' inside 'catch' block which ignores the caught exception  

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  

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

Caught exception is immediately rethrown  

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

Checked exception class  

Reports checked exception classes (that is, subclasses of java.

Class directly extends 'Throwable'  

Reports classes that directly extend java.

Empty 'finally' block  

Reports empty finally blocks.

Empty 'try' block  

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

Exception constructor called without arguments  

Reports creation of a exception instance without any arguments specified.

Nested 'try' statement  

Reports nested try statements.

Non-final field of 'Exception' class  

Reports fields in subclasses of java.

Overly broad 'catch' block  

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

Overly broad 'throws' clause  

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

Prohibited 'Exception' caught  

Reports catch clauses that catch an inappropriate exception.

Prohibited exception declared  

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

Prohibited exception thrown  

Reports throw statements that throw an inappropriate exception.

Throwable supplier never returns a value  

Reports Supplier lambdas in Optional.

Unchecked 'Exception' class  

Reports subclasses of java.

Unchecked exception declared in 'throws' clause  

Reports declaration of an unchecked exception (java.

Unnecessary call to 'Throwable.initCause()'  

Reports calls to Throwable.

Last modified: 29 April 2024