cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikita Timofeev (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAY-2380) ReferenceMap should not store or return null values
Date Mon, 13 Nov 2017 14:21:01 GMT

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

Nikita Timofeev commented on CAY-2380:
--------------------------------------

https://github.com/apache/cayenne/commit/d0f462f54e387e54fb06a541fc71a2571366e146

> ReferenceMap should not store or return null values
> ---------------------------------------------------
>
>                 Key: CAY-2380
>                 URL: https://issues.apache.org/jira/browse/CAY-2380
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 4.1.M1
>            Reporter: Nikita Timofeev
>            Assignee: Nikita Timofeev
>             Fix For: 4.1.M2
>
>
> This one from dev@list:
> {quote}
> The problem is in ReferenceMap.values(). If the GC runs between
> checkReferenceQueue() and the last v.get(), then null can be added to the
> collection (when using the default WeakValueMap). keySet() and entrySet()
> have similar issues.
> {quote}
> Previously used class from commons-collections forbid null values so our implementation
should do the same, this allows to clear nulls not only explicitly in reference queue check
but also inside any operation.
> {{keySet()}} method will be intact as we can't make any assumption about when returned
keys will be used thus it's impractical to additionally clear stale references in that method.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message