Wang Hailong created LANG-1744:
----------------------------------
Summary: when ArrayUtils.removeAll meeting negtive index
Key: LANG-1744
URL: https://issues.apache.org/jira/browse/LANG-1744
Project: Commons Lang
Issue Type: Bug
Components: lang.*
Reporter: Wang Hailong
it just throw java.lang.IndexOutOfBoundsException: Index: -1, Length: 4, I
think there are needed to be a more proper way to handle this situation, for
example raise a illegalargument exception, (or using python style which means
index -1 indicate the last one
the test code is:
{color:#bbb529}@Test
{color}{color:#cc7832}public void
{color}{color:#ffc66d}testRemoveAll_NegativeIndices{color}() {
{color:#cc7832}int{color}[] array = {{color:#6897bb}1{color}{color:#cc7832},
{color}{color:#6897bb}3{color}{color:#cc7832},
{color}{color:#6897bb}5{color}{color:#cc7832},
{color}{color:#6897bb}7{color}}{color:#cc7832};
{color}{color:#cc7832}
{color}{color:#cc7832} int{color}[] result =
ArrayUtils.removeAll(array{color:#cc7832},
{color}-{color:#6897bb}1{color}{color:#cc7832},
{color}-{color:#6897bb}2{color}){color:#cc7832};
{color}{color:#cc7832}
{color}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)