Updating the BigDecimal.compareTo(Object) to BigDecimal.compareTo(BigDecimal) to match JDK change - fixes LANG-468/LANG-464

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@711969 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2008-11-06 20:36:17 +00:00
parent a6a2d04877
commit b1e8a26177
1 changed files with 2 additions and 2 deletions

View File

@ -377,8 +377,8 @@ public class EqualsBuilder {
} }
Class lhsClass = lhs.getClass(); Class lhsClass = lhs.getClass();
if (!lhsClass.isArray()) { if (!lhsClass.isArray()) {
if (lhs instanceof java.math.BigDecimal) { if (lhs instanceof java.math.BigDecimal && rhs instanceof java.math.BigDecimal) {
isEquals = (((java.math.BigDecimal)lhs).compareTo(rhs) == 0); isEquals = (((java.math.BigDecimal)lhs).compareTo((java.math.BigDecimal)rhs) == 0);
} else { } else {
// The simple case, not an array, just test the element // The simple case, not an array, just test the element
isEquals = lhs.equals(rhs); isEquals = lhs.equals(rhs);