Back to Intellij Community

ExcessiveRangeCheck

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

2025.3-rc-2403 B
Original Source

Reports condition chains in which a value range is checked and these condition chains can be simplified to a single check.

The quick-fix replaces a condition chain with a simplified expression:

Example:

x > 2 && x < 4

After the quick-fix is applied:

x == 3

Example:

arr.length == 0 || arr.length > 1

After the quick-fix is applied:

arr.length != 1

New in 2019.1