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

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3


Java, 233.SNAPSHOT

Last modified: 13 July 2023