Inspectopedia
 
2024.3

Unnecessary 'null' check before 'equals()' call

Warning
New
Last modified: 03 December 2024

Reports comparisons to null that are followed by a call to equals() with a constant argument.

Example:

After the quick-fix is applied:

Use the inspection settings to report equals() calls with a non-constant argument when the argument to equals() is proven not to be null.