Non-strict inequality '>=' or '<=' can be replaced with '=='
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
Inspection Details | |
---|---|
Available in: | IntelliJ IDEA 2023.3, Qodana for JVM 2023.3 |
Plugin: | Java, 233.SNAPSHOT |
Last modified: 13 July 2023