You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[LANG-1811] ArrayUtils.shuffle() throws NullPointerException for null
array input.
- Null test assertions are from PR #1553.
- null inputs are now no-ops
- This follows the class Javadoc and other method implementations in
this class
- Javadoc @param updates
Copy file name to clipboardExpand all lines: src/changes/changes.xml
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -91,6 +91,7 @@ The <action> type attribute can be add,update,fix,remove.
91
91
<actionissue="LANG-1805"type="fix"dev="ggregory"due-to="Gary Gregory, jher235">Speedup StringUtils.join(AllPrimitiveTypes[], char, int, int), see StringUtilsJoinBenchmark, based on #1532. Also better StringBuilder allocation</action>
92
92
<actionissue="LANG-1749"type="fix"dev="ggregory"due-to="jinwoo choi, Gary Gregory, YuMing Ma, Ivan Šarić">TypeUtils.isAssignable returns a wrong result for ParameterizedType when raw class is "Class" #1548.</action>
93
93
<actionissue="LANG-1700"type="fix"dev="ggregory"due-to="seokhyeon moon, Gary Gregory, Ivan Šarić">Improve handling of parameterized types and variable unrolling.</action>
94
+
<actionissue="LANG-1811"type="fix"dev="ggregory"due-to="Raju Gupta, Gary Gregory">ArrayUtils.shuffle() throws NullPointerException for null array input.</action>
* Shuffles randomly the elements of the specified array using the <a href="https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle">Fisher-Yates shuffle
7429
7429
* algorithm</a>.
7430
7430
*
7431
-
* @param array the array to shuffle.
7432
-
* @param random the source of randomness used to permute the elements.
7431
+
* @param array the array to shuffle, no-op if {@code null}.
7432
+
* @param random the source of randomness used to permute the elements, no-op if {@code null}.
* Shuffles randomly the elements of the specified array using the <a href="https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle">Fisher-Yates shuffle
7463
7465
* algorithm</a>.
7464
7466
*
7465
-
* @param array the array to shuffle.
7466
-
* @param random the source of randomness used to permute the elements.
7467
+
* @param array the array to shuffle, no-op if {@code null}.
7468
+
* @param random the source of randomness used to permute the elements, no-op if {@code null}.
* Shuffles randomly the elements of the specified array using the <a href="https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle">Fisher-Yates shuffle
7497
7501
* algorithm</a>.
7498
7502
*
7499
-
* @param array the array to shuffle.
7500
-
* @param random the source of randomness used to permute the elements.
7503
+
* @param array the array to shuffle, no-op if {@code null}.
7504
+
* @param random the source of randomness used to permute the elements, no-op if {@code null}.
* Shuffles randomly the elements of the specified array using the <a href="https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle">Fisher-Yates shuffle
7531
7537
* algorithm</a>.
7532
7538
*
7533
-
* @param array the array to shuffle.
7534
-
* @param random the source of randomness used to permute the elements.
7539
+
* @param array the array to shuffle, no-op if {@code null}.
7540
+
* @param random the source of randomness used to permute the elements, no-op if {@code null}.
* Shuffles randomly the elements of the specified array using the <a href="https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle">Fisher-Yates shuffle
7565
7573
* algorithm</a>.
7566
7574
*
7567
-
* @param array the array to shuffle.
7568
-
* @param random the source of randomness used to permute the elements.
7575
+
* @param array the array to shuffle, no-op if {@code null}.
7576
+
* @param random the source of randomness used to permute the elements, no-op if {@code null}.
* Shuffles randomly the elements of the specified array using the <a href="https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle">Fisher-Yates shuffle
7599
7609
* algorithm</a>.
7600
7610
*
7601
-
* @param array the array to shuffle.
7602
-
* @param random the source of randomness used to permute the elements.
7611
+
* @param array the array to shuffle, no-op if {@code null}.
7612
+
* @param random the source of randomness used to permute the elements, no-op if {@code null}.
* Shuffles randomly the elements of the specified array using the <a href="https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle">Fisher-Yates shuffle
7633
7645
* algorithm</a>.
7634
7646
*
7635
-
* @param array the array to shuffle.
7636
-
* @param random the source of randomness used to permute the elements.
7647
+
* @param array the array to shuffle, no-op if {@code null}.
7648
+
* @param random the source of randomness used to permute the elements, no-op if {@code null}.
* Shuffles randomly the elements of the specified array using the <a href="https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle">Fisher-Yates shuffle
7667
7681
* algorithm</a>.
7668
7682
*
7669
-
* @param array the array to shuffle.
7670
-
* @param random the source of randomness used to permute the elements.
7683
+
* @param array the array to shuffle, no-op if {@code null}.
7684
+
* @param random the source of randomness used to permute the elements, no-op if {@code null}.
* Shuffles randomly the elements of the specified array using the <a href="https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle">Fisher-Yates shuffle
7701
7717
* algorithm</a>.
7702
7718
*
7703
-
* @param array the array to shuffle.
7704
-
* @param random the source of randomness used to permute the elements.
7719
+
* @param array the array to shuffle, no-op if {@code null}.
7720
+
* @param random the source of randomness used to permute the elements, no-op if {@code null}.
0 commit comments