Inspectopedia
 
2024.3

Negated call can be simplified

Info
New
Last modified: 03 December 2024

Reports negation isEmpty() and isNotEmpty() for collections and String, or isBlank() and isNotBlank() for String.

Using corresponding functions makes your code simpler.

The quick-fix replaces the negation call with the corresponding call from the Standard Library.

Example:

After the quick-fix is applied: