commons-issues mailing list archives

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

    [ https://issues.apache.org/jira/browse/COLLECTIONS-541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14606343#comment-14606343
] 

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: https://issues.apache.org/jira/browse/COLLECTIONS-541
>             Project: Commons Collections
>          Issue Type: New Feature
>            Reporter: Thomas Neidhart
>            Priority: Minor
>             Fix For: 4.x
>
>
> Placeholder ticket for pull request: https://github.com/apache/commons-collections/pull/5



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message