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

CacheLoader is ignored as of Guava 11 [SPR-12842] #17440

Closed
spring-issuemaster opened this issue Mar 21, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

commented Mar 21, 2015

Stéphane Nicoll opened SPR-12842 and commented

Since Guava 11, there is a separate interface to manipulate a CacheLoader: LoadingCache.

Our implementation uses Cache regardless of the fact we have specified a CacheLoader or not. In the former case a LoadingCache is created and as a get method that will invoke the loader if necessary.

Our current GuavaCache calls getIfPresent that will never use the loader.


Affects: 4.1.5

Referenced from: commits 9172a6d, f52702e

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 22, 2015

Juergen Hoeller commented

Since we have a dedicated setCacheLoader method in our GuavaCacheManager, this clearly doesn't work as intended...

Let's conditionally call LoadingCache.get in GuavaCache, with a simple instanceof check in our get implementation possibly? We could easily backport that to 4.1.6 as well, since we require Guava 12+ anyway.

Juergen

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 22, 2015

Stéphane Nicoll commented

Now checking for LoadingCache in GuavaCache#get. LoadingCache#get actually throws a checked exception and Guava offers a UncheckedExecutionException so we're wrapping such exception in there as we can't throw a checked exception ourselves.

Juergen Hoeller I wasn't sure about that last bit so could you please review and backport to 4.1 please? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.