commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Osipov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-1178) ArrayUtils.removeAll(Object array, int... indices) should do the clone, not its callers
Date Wed, 18 May 2016 20:54:13 GMT

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

Michael Osipov commented on LANG-1178:
--------------------------------------

You should assign to yourself and set a fix version.

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

Mime
View raw message