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

CachingStateRepository not working with JSF integration. #56

Closed
clinton-fillier-vgh opened this Issue Oct 9, 2013 · 4 comments

Comments

Projects
None yet
3 participants
@clinton-fillier-vgh
Contributor

clinton-fillier-vgh commented Oct 9, 2013

When implementing a CachingStateRepository I noticed the JSF integration didn't seem to be caching properly. When using the "features" managed bean, a Feature is represented by a NamedFeature. Since NamedFeature doesn't override hashcode() or equals(), it isn't suitable for a key in the cache map.

chkal added a commit that referenced this issue Oct 10, 2013

Merge pull request #57 from clinton-fillier-vgh/master
#56 - hashCode and equals for NamedFeature
@chkal

This comment has been minimized.

Member

chkal commented Oct 13, 2013

Although this issue should be fixed with the commit referenced above, I'll keep this issue open. I'll have a deeper look at the problem and perhaps add some tests covering the fix.

@aquaraga

This comment has been minimized.

aquaraga commented Oct 21, 2013

The same issue exists for the JSP integration as well. I haven't checked if the above commit fixes the issue for JSP - just giving a heads up.

chkal added a commit that referenced this issue Oct 21, 2013

@chkal

This comment has been minimized.

Member

chkal commented Oct 21, 2013

Hey all,

I just had a deeper look at this issue. I refactored the repository to use the unique name of a feature instead of the feature itself as the cache key. I think this is the only way to work around this issue because the repository may be called with either the feature enum value itself or with a NamedFeature representing the same feature. Although NamedFeature implements hashcode/equals correctly now, it is not possible to do the same with the enum to correctly detect an corresponding NamedFeature.

I think it should work fine now. Thank you both for bringing this up and for helping to fix this issue. :)

@chkal chkal closed this Oct 21, 2013

@clinton-fillier-vgh

This comment has been minimized.

Contributor

clinton-fillier-vgh commented Oct 29, 2013

Makes perfect sense! Thanks for looking into this.

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