You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2025/06/07 01:10:00 UTC

[jira] [Comment Edited] (COLLECTIONS-876) use LazyMap without deprecated classes

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

Gary D. Gregory edited comment on COLLECTIONS-876 at 6/7/25 1:09 AM:
---------------------------------------------------------------------

Replacing our custom intefaces with stock Java equivalents will be done in 5.0 at some point in the future.

 


was (Author: garydgregory):
This will be done in 5.0 at some point in the future.

 

> use LazyMap without deprecated classes
> --------------------------------------
>
>                 Key: COLLECTIONS-876
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-876
>             Project: Commons Collections
>          Issue Type: Improvement
>    Affects Versions: 4.5.0
>            Reporter: Jim Sellers
>            Priority: Minor
>             Fix For: 5.0.0
>
>
> The example from LazyMap uses the collections4 deprecated Factory, which is a subclass of java.util.function.Supplier
> {code}
> Factory<Date> factory = new Factory<Date>() {
>     @Override
>     public Date create() {
>         return new Date();
>     }
> };
> Map<String, Date> lazy = LazyMap.lazyMap(new HashMap<String, Date>(), factory);
> Date date = lazy.get("NOW");
> {code}
> Places where org.apache.commons.collections4.Factory is used should be switched to Supplier.
> I only have the LazyMap, but I'm sure many of the Lazy* methods would be similar.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)