commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ola Berg <>
Subject [collection] Collections for primitives
Date Sat, 22 Jun 2002 20:36:52 GMT
The collections for primitves has dangerous behaviour in the methods where you recieve an Object
as an argument, where it just tries to cast the argument to an Integer (or Float etc). This
will result in a ClassCastException, which could be appropriate somtimes, but not in all cases.

Shouldn\'t myIntList.contains( \"Foo\") result in false?

Shouldn\'t myIntList.[lastI | i]ndexOf( \"Foo\") result in -1?

Shouldn\'t myIntList.add( \"Foo\") result in false, indicating that the object couldn\'t be

And so on (remove() etc)?

Should I fix this and send a patch to someone, or is it the desired behaviour? If it is desired,
I could make javadoc comments about it instead.


0733 - 99 99 17

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message