[
https://issues.apache.org/jira/browse/LANG-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18051032#comment-18051032
]
Gary D. Gregory commented on LANG-1811:
---------------------------------------
Thank you [~rajugupta]
Note: I merged PR [https://github.com/apache/commons-lang/pull/1553]
> ArrayUtils.shuffle() throws NullPointerException for null array input
> ---------------------------------------------------------------------
>
> Key: LANG-1811
> URL: https://issues.apache.org/jira/browse/LANG-1811
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.*
> Affects Versions: 3.20.0
> Reporter: Raju Gupta
> Assignee: Gary D. Gregory
> Priority: Minor
> Fix For: 3.21.0
>
>
> h2. Description
> The *shuffle()* method in *ArrayUtils* throws a *NullPointerException* when a
> *null* array is passed as input.
> This behavior is currently undocumented and inconsistent with other utility
> methods in *ArrayUtils*, which typically tolerate *null* inputs.
> *Suggested behavior:*
> * Explicitly document that *shuffle()* does not accept *null* arrays, *or*
> * Add a null check and safely return without throwing an exception when the
> input array is *null*.
> h2. Failing Test Case
> {code:java}
> @Test
> void testShuffleNull() {
> assertDoesNotThrow(() -> ArrayUtils.shuffle((byte[]) null));
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)