Inspectopedia Help

Mismatched case in 'String' operation

Reports String method calls that always return the same value (-1 or false) because a lowercase character is searched in an uppercase-only string or vice versa.

Reported methods include equals, startsWith, endsWith, contains, indexOf, and lastIndexOf.


if (columnName.toLowerCase().equals("ID")) {...}

New in 2019.3

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3


Java, 233.SNAPSHOT

Last modified: 13 July 2023