Back to Intellij Community

NonStrictComparisonCanBeEquality

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

2025.3-rc-2323 B
Original Source

Reports inequality conditions that, according to data flow analysis, can be satisfied only for a single operand value. Such conditions could be replaced with equality conditions to make the code clearer.

Example:

if (x >= 10) {
    ...
    if (x <= 10) { // can be replaced with 'x == 10'
    }
  }

New in 2022.2