Inspectopedia
 
2024.3

'equals()' called on 'BigDecimal'

Warning
New
Last modified: 03 December 2024

Reports equals() calls that compare two java.math.BigDecimal numbers. This is normally a mistake, as two java.math.BigDecimal numbers are only equal if they are equal in both value and scale.

Example:

After the quick-fix is applied: