diff --git a/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java b/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java index 42a418e13..1234b1686 100644 --- a/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java +++ b/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java @@ -856,11 +856,6 @@ public HashCodeBuilder append(Object object) { iTotal = iTotal * iConstant; } else { - if (object.getClass().isArray() == false) { - // the simple case, not an array, just the element - iTotal = iTotal * iConstant + object.hashCode(); - - } else { // 'Switch' on type of array, to dispatch to the correct handler // This handles multi dimensional arrays if (object instanceof long[]) { @@ -879,11 +874,12 @@ public HashCodeBuilder append(Object object) { append((float[]) object); } else if (object instanceof boolean[]) { append((boolean[]) object); - } else { + } else if (object instanceof Object[]) { // Not an array of primitives append((Object[]) object); + } else { + iTotal = iTotal * iConstant + object.hashCode(); } - } } return this; }