[
https://issues.apache.org/jira/browse/LANG-1178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15014472#comment-15014472
]
ASF GitHub Bot commented on LANG-1178:
--------------------------------------
GitHub user hyandell opened a pull request:
https://github.com/apache/commons-lang/pull/116
Moving the clone inside removeAll(Object,int...);Object per LANG-1178
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/hyandell/commons-lang master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/commons-lang/pull/116.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #116
----
commit 4df139db7ad0049044458be843d107b935642e84
Author: Henri Yandell <[email protected]>
Date: 2015-11-19T21:58:47Z
Moving the clone inside removeAll(Object,int...);Object per LANG-1178
----
> ArrayUtils.removeAll(Object array, int... indices) should do the clone, not
> its callers
> ---------------------------------------------------------------------------------------
>
> Key: LANG-1178
> URL: https://issues.apache.org/jira/browse/LANG-1178
> Project: Commons Lang
> Issue Type: Bug
> Reporter: Sebb
>
> The method ArrayUtils.removeAll(Object array, int... indices) currently sorts
> the input indices array. Therefore the array needs to be cloned; this is
> currently done by the callers.
> However the sort is an implementation detail of the method, so should be done
> by the method itself, not by the callers, which is fragile (easy to overlook
> when creating a new method) and unnecessary.
> This would also allow the method to be more easily changed to a different
> implementation that does not need to sort the array (e.g. using BitSet)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)