These checks address coding problems.
Checks that object instances created explicitly with
new are actually used for something. Just being assigned to a variable or passed as a parameter is enough. A full data flow analysis is not performed.
This helps discover cases like the following:
It was probably the intent of the programmer to throw the created exception:
The instance might have been created to make use of a constructor side effect, but such a case would be a bug in its own right.
This check was inspired by the FindBugs detector RV_EXCEPTION_NOT_THROWN. However, this check is not restricted to exceptions.
Configure the check like this: