diff --git a/src/java/org/apache/commons/lang/builder/EqualsBuilder.java b/src/java/org/apache/commons/lang/builder/EqualsBuilder.java index 6901c8e5c..a1648aa11 100644 --- a/src/java/org/apache/commons/lang/builder/EqualsBuilder.java +++ b/src/java/org/apache/commons/lang/builder/EqualsBuilder.java @@ -377,8 +377,8 @@ public class EqualsBuilder { } Class lhsClass = lhs.getClass(); if (!lhsClass.isArray()) { - if (lhs instanceof java.math.BigDecimal) { - isEquals = (((java.math.BigDecimal)lhs).compareTo(rhs) == 0); + if (lhs instanceof java.math.BigDecimal && rhs instanceof java.math.BigDecimal) { + isEquals = (((java.math.BigDecimal)lhs).compareTo((java.math.BigDecimal)rhs) == 0); } else { // The simple case, not an array, just test the element isEquals = lhs.equals(rhs);