PMD xpath to warn about using equals () in BigDecimal

Can anyone suggest an xpath PMD rule to warn that a method call equals() java.math.BigDecimalwill check both the value and the scale, which normally (if only for some applications like the application) cannot be an error. Since 1.0not equal 1.00, should be used compareTo.

+5
source share
2 answers

It looks rather complicated with PMD, but FindBugs already has a rule for this .

+1
source

This will be difficult with XPath, because the violation occurs when the method is called, but you need information about the type of the object. Java-based PMD rule might go.

0
source

All Articles