[
https://issues.apache.org/jira/browse/COLLECTIONS-786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Bruno P. Kinoshita updated COLLECTIONS-786:
-------------------------------------------
Assignee: Bruno P. Kinoshita
> PassiveExpiringMap documentation - methods that involve accessing the entire
> map
> --------------------------------------------------------------------------------
>
> Key: COLLECTIONS-786
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-786
> Project: Commons Collections
> Issue Type: Improvement
> Components: Map
> Affects Versions: 4.4
> Reporter: Marko Pohajač
> Assignee: Bruno P. Kinoshita
> Priority: Minor
> Attachments: fix_doc.diff,
> show_effect_of_containsKey_containsValue_on_expiration.diff
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> The documentation for PassiveExpiringMap says:
> {quote}When invoking methods that involve accessing the entire map contents
> (i.e
> [{{containsKey(Object)}}|https://commons.apache.org/proper/commons-collections/apidocs/org/apache/commons/collections4/map/PassiveExpiringMap.html#containsKey-java.lang.Object-],
>
> [{{entrySet()}}|https://commons.apache.org/proper/commons-collections/apidocs/org/apache/commons/collections4/map/PassiveExpiringMap.html#entrySet--],
> etc.) this decorator removes all expired entries prior to actually
> completing the invocation.
> {quote}
>
> Checked the code for containsKey and it doesn't seem to access the entire
> map, only the element of the key. If not sure about this, please check the
> attached [^show_effect_of_containsKey_containsValue_on_expiration.diff] as a
> proof.
> Suggestion is to replace the example with containsValue(Object) or size() or
> something that does remove all expired entries prior to actually completing
> the invocation:
> {quote}When invoking methods that involve accessing the entire map contents
> (i.e
> [{{containsValue(Object)}}|https://commons.apache.org/proper/commons-collections/apidocs/org/apache/commons/collections4/map/PassiveExpiringMap.html#containsValue-java.lang.Object-],
>
> [{{entrySet()}}|https://commons.apache.org/proper/commons-collections/apidocs/org/apache/commons/collections4/map/PassiveExpiringMap.html#entrySet--],
> etc.) this decorator removes all expired entries prior to actually
> completing the invocation.
> {quote}
> Potential fix patch: [^fix_doc.diff]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)