Although I agree that the definition of using the Iterator is potentially
dangerous, it often works as iterators generally are consistent.

This method is one of the originals from this class, and is documented as to
what it does, so I'm -1 to changing it.

Stephen

----- Original Message -----
From: "Phil Steitz" <[EMAIL PROTECTED]>
> 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
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to