Inspectopedia Help

Excessive range check

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

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023