Back to Intellij Community

NegativelyNamedBooleanVariable

java/java-impl/resources/inspectionDescriptions/NegativelyNamedBooleanVariable.html

2025.3-rc-2251 B
Original Source

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.

Example:

boolean disabled = false;