[infinispan-issues] [JBoss JIRA] (ISPN-4837) @CacheEntryActivated events received for keys not matching KeyFilter

Paul Ferraro (JIRA) issues at jboss.org
Tue Oct 14 12:03:35 EDT 2014


     [ https://issues.jboss.org/browse/ISPN-4837?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Ferraro updated ISPN-4837:
-------------------------------
    Description: 
I have a local-mode Cache<Object, ?>, for which I register a cache listener using the following KeyFilter:
{noformat}
class MyFIlter implements KeyFilter<Object> {
    @Override
    public boolean accept(Object key) {
        return key instanceof String;
    }
}
{noformat}

However, my listener method still receives events for keys that does not match the filter with which my listener was registered.
e.g.
{noformat}
    @CacheEntryActivated
    public void activated(CacheEntryActivatedEvent<String, ?> event) {
        String id = event.getKey();  // Throws a ClassCastException
        // ...
    }
{noformat}

I have not validated which other event types might exhibit the same issue.
Since this is a behavior regression, I'm filing this as critical.

  was:
I have a local-mode Cache<Object, ?>, for which I register a cache listener using the following KeyFilter:
{noformat}
class MyFIlter implements KeyFilter<Object> {
    @Override
    public boolean accept(Object key) {
        return key instanceof String;
    }
}
{noformat}

However, my listener method still receives events for keys that does not match the filter with which my listener was registered.
e.g.
{noformat}
    @CacheEntryActivated
    public void activated(CacheEntryActivatedEvent<String, ?> event) {
        if (!event.isPre() && !this.persistent) {
            String id = event.getKey();  // Throws a ClassCastException
            // ...
        }
    }
{noformat}

I have not validated which other event types might exhibit the same issue.
Since this is a behavior regression, I'm filing this as critical.



> @CacheEntryActivated events received for keys not matching KeyFilter
> --------------------------------------------------------------------
>
>                 Key: ISPN-4837
>                 URL: https://issues.jboss.org/browse/ISPN-4837
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Listeners
>    Affects Versions: 7.0.0.CR1
>            Reporter: Paul Ferraro
>            Assignee: William Burns
>            Priority: Critical
>
> I have a local-mode Cache<Object, ?>, for which I register a cache listener using the following KeyFilter:
> {noformat}
> class MyFIlter implements KeyFilter<Object> {
>     @Override
>     public boolean accept(Object key) {
>         return key instanceof String;
>     }
> }
> {noformat}
> However, my listener method still receives events for keys that does not match the filter with which my listener was registered.
> e.g.
> {noformat}
>     @CacheEntryActivated
>     public void activated(CacheEntryActivatedEvent<String, ?> event) {
>         String id = event.getKey();  // Throws a ClassCastException
>         // ...
>     }
> {noformat}
> I have not validated which other event types might exhibit the same issue.
> Since this is a behavior regression, I'm filing this as critical.



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the infinispan-issues mailing list