commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <p...@steitz.com>
Subject [collections] CollectionUtils.index() behavior
Date Sun, 21 Sep 2003 00:12:20 GMT
Currently, if obj is a Map or a Collection (but not a List) and index is 
an Integer,  CollectionUtils.index(obj,index) will return the index-th 
object returned by an iterator over the map/collection. Since there is 
no guaranteed order in these cases, it does not make sense to me for 
index() to be defined in these cases.

Should this be changed to either follow the "default" path (returning 
obj) or to throw an IllegalArgumentException?

Phil



Mime
View raw message