[
https://issues.apache.org/jira/browse/LANG-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gary D. Gregory updated LANG-1811:
----------------------------------
Summary: [Javadoc] ArrayUtils.shuffle() throws NullPointerException for
null array input (was: ArrayUtils.shuffle() throws NullPointerException for
null array input)
> [Javadoc] 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
> Priority: Minor
>
> 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)