[infinispan-issues] [JBoss JIRA] (ISPN-5697) KeyValueFilter.accept() used in AdvancedCache.filterEntries(..) gets 'null' as value param when traversing cache store entries

Carsten Lohmann (JIRA) issues at jboss.org
Tue Aug 25 02:19:26 EDT 2015


    [ https://issues.jboss.org/browse/ISPN-5697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13101272#comment-13101272 ] 

Carsten Lohmann commented on ISPN-5697:
---------------------------------------

Workaround:
Using a filter that implements {{KeyValueFilterConverter}} (and using no converter or using the same KeyValueFilterConverter object as converter).

> KeyValueFilter.accept() used in AdvancedCache.filterEntries(..) gets 'null' as value param when traversing cache store entries
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ISPN-5697
>                 URL: https://issues.jboss.org/browse/ISPN-5697
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 7.2.4.Final
>            Reporter: Carsten Lohmann
>
> When using {{AdvancedCache.filterEntries(filter)}} on a cache with a cache loader (where not all entries are in memory), 
> the {{accept(key, value, metadata)}} method of the given KeyValueFilter is invoked with {{null}} as value parameter for the cache loader entries.
> But the javadoc of {{filterEntries}} states:
> {quote}
> Callbacks to the filter will never provide a key or value that will be null.
> {quote}
> In the code:
> In the "{{if (shouldUseLoader(flags)}} \[..\]" block of {{LocalEntryRetriever#retrieveEntries}} the given filter is wrapped as a {{KeyValueFilterAsKeyFilter}} causing {{null}} to be used as value.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the infinispan-issues mailing list