Back to Intellij Community

RedundantCompareCall

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

2025.3-rc-2211 B
Original Source

Reports comparisons in which the compare method is superfluous.

Example:

boolean result = Integer.compare(a, b) == 0;

After the quick-fix is applied:

boolean result = a == b;

New in 2018.2