commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (JIRA)" <>
Subject [jira] [Commented] (COLLECTIONS-541) Add CollectionUtils.getRandom() method
Date Mon, 29 Jun 2015 20:35:04 GMT


Thomas Neidhart commented on COLLECTIONS-541:

I do not like the fact that there is a Random instance in CollectionUtils that can not be
initialized with a seed. Thus the getRandom(Collection) method will not be deterministic.

Also passing an empty Collection should be handled gracefully. Ideally the method should return
an Optional instance, but this is only available starting with Java 8 (and adding our own
version does not make sense imho).

Postponing to a later release, as it is not really critical and only a nice-to-have feature.

> Add CollectionUtils.getRandom() method
> --------------------------------------
>                 Key: COLLECTIONS-541
>                 URL:
>             Project: Commons Collections
>          Issue Type: New Feature
>            Reporter: Thomas Neidhart
>            Priority: Minor
>             Fix For: 4.x
> Placeholder ticket for pull request:

This message was sent by Atlassian JIRA

View raw message