Inspectopedia Help

Negatively named boolean variable

Reports negatively named variables, for example: disabled, hidden, or isNotChanged.

Usually, inverting the boolean value and removing the negation from the name makes the code easier to understand.


boolean disabled = false;

Inspection Details

By default bundled with:

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin:

Java, 241.14841

Last modified: 12 March 2024