[ 
https://issues.apache.org/jira/browse/LANG-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18050450#comment-18050450
 ] 

Raju Gupta commented on LANG-1811:
----------------------------------

Hi [~ggregory]  . Thanks for the fix. 

I would like some guidance on how to raise PR's for issues and fixes.

1) Looking at the comments on the various issues, I deduced that in order to 
fix an issue, first a PR with a failing test should be raised to confirm the 
issue.
2) Once the maintainers i.e. you acknowledge the bug, then we push the fix on 
the same PR.

I am not sure if I am following the right pattern here. My idea was to first 
demonstrate the issue and then push the fix for that. This makes it easier for 
me to track my contributions. Could you please provide some tips here as how to 
I can better do this and save our times and the back and forth as well?

Additionally, it would be better if we provide the chance to review the fix 
before the changes are merged into the master branch. Ab additional set of eyes 
don't hurt and helps to make the fix error-free.

There is a small issue that I found in your fix. I have commited the fix in 
this PR.

Could you review the changes and let me know if all looks good ? Thanks!

> 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
>             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)

Reply via email to