Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EntryProcessor mixed with MapInterceptor doesn't receive correct value #7414

Closed
travikk opened this issue Jan 28, 2016 · 4 comments · Fixed by #7416
Closed

EntryProcessor mixed with MapInterceptor doesn't receive correct value #7414

travikk opened this issue Jan 28, 2016 · 4 comments · Fixed by #7416
Assignees
Milestone

Comments

@travikk
Copy link

travikk commented Jan 28, 2016

Hello,

If you consider the following code:

`
public class CacheTest {
public static void main(String[] args) {
HazelcastInstance hazelcast = Hazelcast.newHazelcastInstance();

    IMap map = hazelcast.getMap("test");
    map.addInterceptor(new MyInterceptor());
    map.addEntryListener(new MyListener(), true);
    map.put(1, "wsad");
    map.put(1, "qwerty");
}

static class MyListener implements EntryAddedListener, EntryUpdatedListener {
    @Override
    public void entryAdded(EntryEvent event) {
        System.out.println("Got event add");
    }

    @Override
    public void entryUpdated(EntryEvent event) {
        System.out.println("Got event update");
    }
}

static class MyInterceptor implements MapInterceptor {
    @Override
    public Object interceptGet(Object value) {
        return null;
    }

    @Override
    public void afterGet(Object value) {
    }

    @Override
    public Object interceptPut(Object oldValue, Object newValue) {
        return newValue.toString().toUpperCase();
    }

    @Override
    public void afterPut(Object value) {

    }

    @Override
    public Object interceptRemove(Object removedValue) {
        return null;
    }

    @Override
    public void afterRemove(Object value) {

    }
}

}

`

You will notice, that the interceptor right before put is changing strings to upper-case version of those values. The listener however receives an "old" value (lowercase version).
Is that to be expected or is it a bug in Hazelcast, or maybe a misconfiguration?

@gurbuzali gurbuzali added this to the 3.6.1 milestone Jan 28, 2016
@gurbuzali gurbuzali self-assigned this Jan 28, 2016
@gurbuzali
Copy link
Contributor

Thank you for the bug report and the reproducer

@travikk
Copy link
Author

travikk commented Jan 28, 2016

@gurbuzali brilliant, thanks!

It says here, that it was added to 3.6.1 milestone, but in the referenced #7416 it says that it's been added to 3.7.
Which version should we expect this bug to be fixed in and what timeline are we looking at here?

Thank you very much for taking such a quick action on this!

@gurbuzali
Copy link
Contributor

we have a backport too #7417
I can't say much about the release timing but we've just released 3.6 so you may expect a patch release (3.6.1) in a month or so

@travikk
Copy link
Author

travikk commented Jan 28, 2016

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants