You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2012/09/29 01:35:07 UTC

[jira] [Resolved] (LANG-838) ArrayUtils removeElements methods clone temporary index arrays unnecessarily

     [ https://issues.apache.org/jira/browse/LANG-838?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved LANG-838.
-----------------------

       Resolution: Fixed
    Fix Version/s: 3.2

URL: http://svn.apache.org/viewvc?rev=1391695&view=rev
Log:
LANG-838 ArrayUtils removeElements methods clone temporary index arrays unnecessarily

Modified:
    commons/proper/lang/trunk/src/changes/changes.xml
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java

                
> ArrayUtils removeElements methods clone temporary index arrays unnecessarily
> ----------------------------------------------------------------------------
>
>                 Key: LANG-838
>                 URL: https://issues.apache.org/jira/browse/LANG-838
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 3.1
>            Reporter: Sebb
>            Assignee: Sebb
>            Priority: Minor
>             Fix For: 3.2
>
>
> The private method removeAll(Object array, int... indices) sorts the indices array, so arrays passed in by application code need to be cloned first.
> However, where the index array is generated locally, that is unnecessary.
> The removeElements() methods currently call the public removeAll(<type>[] array, int... indices) methods, which clone the indices before calling the private removeAll() method.
> The removeElements() methods should call the private method directly, avoiding the unnecessary clone call.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira