ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Ozerov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IGNITE-512) IgniteCache.randomEntry() is implemented incorrectly.
Date Thu, 15 Oct 2015 12:28:05 GMT

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

Vladimir Ozerov commented on IGNITE-512:
----------------------------------------

Roman,

I do not know whether the second statement still holds. But the first one is still in place.
But first of all we need to understand whether we need this method at all. I do not think
it is useful enough for real-life usages.

> IgniteCache.randomEntry() is implemented incorrectly.
> -----------------------------------------------------
>
>                 Key: IGNITE-512
>                 URL: https://issues.apache.org/jira/browse/IGNITE-512
>             Project: Ignite
>          Issue Type: Bug
>          Components: cache
>    Affects Versions: sprint-1
>            Reporter: Vladimir Ozerov
>
> 1) It may return null if randomly picked entry is obsolete, which violates method semantics
described in JavaDocs: it should return null ony in case cache is empty.
> 2) It may return not-null for empty cache. E.g., put several falues to it, then call
removeAll(), then call randomEntry() - you may got value even after removal. Looks like "isObsolete"
check is not enough.



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

Mime
View raw message