Skip to content

Commit 0378808

Browse files
rajucompraju.gupta
andauthored
ArrayUtils.shuffle() throws NullPointerException for null array input (#1553)
* Add failing test for LANG-1811 * Enhance testShuffleNull to cover all array types for null input * Fix testShuffleByteRandom to use EMPTY_BYTE_ARRAY instead of EMPTY_BOOLEAN_ARRAY * Fix testShuffleByteRandom to use EMPTY_BYTE_ARRAY instead of EMPTY_BOOLEAN_ARRAY --------- Co-authored-by: raju.gupta <raju.gupta@workday.com>
1 parent 2a51760 commit 0378808

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5249,8 +5249,8 @@ void testShuffleByte() {
52495249
void testShuffleByteRandom() {
52505250
ArrayUtils.shuffle((byte[]) null, null);
52515251
ArrayUtils.shuffle((byte[]) null, seededRandom());
5252-
ArrayUtils.shuffle(ArrayUtils.EMPTY_BOOLEAN_ARRAY, null);
5253-
ArrayUtils.shuffle(ArrayUtils.EMPTY_BOOLEAN_ARRAY, seededRandom());
5252+
ArrayUtils.shuffle(ArrayUtils.EMPTY_BYTE_ARRAY, null);
5253+
ArrayUtils.shuffle(ArrayUtils.EMPTY_BYTE_ARRAY, seededRandom());
52545254
// Don't use a "small" array, reduce spurious failures.
52555255
final byte[] array1 = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2,
52565256
3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0,

0 commit comments

Comments
 (0)