commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 27661] - [lang] [patch] ArrayUtils.addAll doesn't always return new array
Date Mon, 15 Mar 2004 19:43:29 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27661>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27661

[lang] [patch] ArrayUtils.addAll doesn't always return new array





------- Additional Comments From Maarten.Coene@qmedit.com  2004-03-15 19:43 -------
I think the behaviour of the addAll mehod should be the same in all situations.
I use this method in a scenario where I modify the returned array. I thought it
would be safe to modify the array, because I was working on a new array. So
modifying the result wasn't going to change the input arrays in any way ...
wrong ... I spent some time to find the cause of what was going wrong in my
algorithm.

Perhahps it was a bit naive from me and I should have read the javadocs more
carefully, maybe I should have created a clone of the result and modify that
clone (and doing some unnecessary array creations), or maybe I can check myself
if one of the input arrays is null .... but I thought it would be easier if the
addAll method always returned a new array, regardless of whether one of the
arguments is null.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message