commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duncan Jones (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (LANG-660) Add methods to insert arrays into arrays at an index
Date Mon, 12 Dec 2016 14:08:58 GMT

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

Duncan Jones edited comment on LANG-660 at 12/12/16 2:08 PM:
-------------------------------------------------------------

Thanks to everyone for their input into this. In the end, I wrote fresh implementations of
these methods as I felt happier using {{arrayCopy}} rather than some of the object-based methods
in the supplied patches.

I've also deprecated the {{add(array, index, element)}} methods, which are now superseded
by the new methods.

In order to keep the behaviour of these new methods consistent with one another, while avoiding
creating an unsafe use of varargs, I've opted to change the handling of {{null}} array inputs.
I've referred to this in the deprecation comments.

Thoughts on this welcome.

{quote}
Repository: commons-lang
Updated Branches:
 refs/heads/master 0136218fa -> 795fe5d86


Added new vararg methods to insert values into an array at an index.

This implements LANG-660. This commit also deprecates the add() methods
that inserted a single value into an array at an index.

Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/795fe5d8
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/795fe5d8
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/795fe5d8
{quote}


was (Author: dmjones500):
Thanks to everyone for their input into this. In the end, I wrote fresh implementations of
these methods as I felt happier using {{arrayCopy}} rather than some of the object-based methods
in the supplied patches.

I've also deprecated the {{add(array, index, element)}} methods, which are now superseded
by the new methods.

In order to keep the behaviour of these new methods consistent with one another, while avoiding
creating an unsafe use of varargs, I've opted to change the handling of {{null}} array inputs.
I've referred to this in the deprecation comments.

Thoughts on this welcome.

Repository: commons-lang
Updated Branches:
 refs/heads/master 0136218fa -> 795fe5d86


Added new vararg methods to insert values into an array at an index.

This implements LANG-660. This commit also deprecates the add() methods
that inserted a single value into an array at an index.

Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/795fe5d8
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/795fe5d8
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/795fe5d8

> Add methods to insert arrays into arrays at an index
> ----------------------------------------------------
>
>                 Key: LANG-660
>                 URL: https://issues.apache.org/jira/browse/LANG-660
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>    Affects Versions: 2.5
>            Reporter: Aaron Digulla
>            Assignee: Duncan Jones
>            Priority: Minor
>             Fix For: 3.6
>
>         Attachments: ArrayUtils.txt, ArrayUtilsAddTest.txt, ArrayUtilsAddTest_addAll.patch,
ArrayUtils_addAll.patch
>
>
> Please add methods with this signature: ArrayUtils.addAll(int[] target, int index, int[]
source) (i.e. insert an array into an array at a certain position).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message