[
https://issues.apache.org/jira/browse/LANG-1122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14532247#comment-14532247
]
ASF GitHub Bot commented on LANG-1122:
--------------------------------------
GitHub user beradrian opened a pull request:
https://github.com/apache/commons-lang/pull/86
Fix issue 1122
Fixes issue https://issues.apache.org/jira/browse/LANG-1122 as discussed.
I also added a link to an article on my blog about shift algorithm, as it
was discussed previously. Hope it's fine, if not, I can remove it.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/beradrian/commons-lang master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/commons-lang/pull/86.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 #86
----
commit 5b7608d1549989d92dd159392c19d9ba8ce0e62e
Author: beradrian <[email protected]>
Date: 2015-05-07T06:50:41Z
consistent treatment for negative indices for swap method
commit e79a590e0cdabd93883aca964db2a862ff3f8490
Author: beradrian <[email protected]>
Date: 2015-05-07T08:31:28Z
new test case
explanations about algorithm
----
> Inconsistent behavior of swap for malformed inputs
> --------------------------------------------------
>
> Key: LANG-1122
> URL: https://issues.apache.org/jira/browse/LANG-1122
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.*
> Reporter: Benedikt Ritter
> Fix For: Patch Needed, 3.5
>
>
> Following the discussion at https://github.com/apache/commons-lang/pull/47 we
> need to decide how malformed inputs should be handled by the swap method. We
> have to handle several forms of malformed inputs and we should decide how to
> do that based on the current behavior of ArrayUtils. Malformed inputs are:
> # array == null
> # array.length == 0
> # offset1 < 0
> # offset2 < 0
> # len < 0
> # offset1 > offset2
> # offset1 > array.length
> # offset2 > array.length
> # offset1 + len > array.length
> # offset2 + len > array.length
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)