Skip to content

Commit 4286986

Browse files
committed
[LANG-1813] ArrayUtils#hashCode() Javadoc incorrectly states “null
returns zero” (actual result is 629)
1 parent 1fa1193 commit 4286986

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ The <action> type attribute can be add,update,fix,remove.
121121
<action type="fix" dev="ggregory" due-to="Gary Gregory">CharSet now maintains iteration order.</action>
122122
<action issue="LANG-771" type="fix" dev="ggregory" due-to="Ryan Holmes, Makarand Hinge, Gary Gregory">DateUtils.ceiling does not behave correctly for dates on the boundaries.</action>
123123
<action issue="LANG-1819" type="fix" dev="ggregory" due-to="Partha Protim Paul, Gary Gregory">[LANG-] Javadoc ArrayUtils.removeAll() null input behavior #1614.</action>
124+
<action issue="LANG-1813" type="fix" dev="ggregory" due-to="Ivan Ponomarev, Gary Gregory">ArrayUtils#hashCode() Javadoc incorrectly states “null returns zero” (actual result is 629).</action>
124125
<!-- ADD -->
125126
<action type="add" dev="ggregory" due-to="Gary Gregory">Add JavaVersion.JAVA_27.</action>
126127
<action type="add" dev="ggregory" due-to="Gary Gregory">Add SystemUtils.IS_JAVA_27.</action>

src/main/java/org/apache/commons/lang3/ArrayUtils.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,13 +2183,14 @@ public static int getLength(final Object array) {
21832183
}
21842184

21852185
/**
2186-
* Gets a hash code for an array handling multidimensional arrays correctly.
2186+
* Gets a hash code for an array handling multidimensional arrays.
21872187
* <p>
2188-
* Multi-dimensional primitive arrays are also handled correctly by this method.
2188+
* Multi-dimensional primitive arrays are also handled by this method.
21892189
* </p>
21902190
*
2191-
* @param array the array to get a hash code for, {@code null} returns zero.
2191+
* @param array the array to get a hash code for, may be {@code null}.
21922192
* @return a hash code for the array.
2193+
* @see HashCodeBuilder
21932194
*/
21942195
public static int hashCode(final Object array) {
21952196
return new HashCodeBuilder().append(array).toHashCode();

0 commit comments

Comments
 (0)