When CaffeineCache is created with a LoadingCache, the LoadingCache is used with the method public ValueWrapper get(Object key) but not with method public <T> T get(Object key, @Nullable Class<T> type). Using LoadingCache is incompatible with @Cacheable pattern but consistently call the LoadingCache in both methods is better than now. Removing the usage is a backward-incompatible change.

Closes gh-25173

Comment From: pivotal-issuemaster

@stefano-salmaso Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

Comment From: pivotal-issuemaster

@stefano-salmaso Thank you for signing the Contributor License Agreement!

Comment From: stefano-salmaso

@snicoll ... any chance to take this PR into consideration? (also close it is a possibility.. 😀)

Comment From: snicoll

It very much was @stefano-salmaso but I've been busy on other things lately. I apologize for the delay and I've flagged the original issue for the 5.3 bucket. I am not sure if we're going to fix it the way you've suggested so I'll keep both the issue and the PR open for now.

Comment From: snicoll

Thanks for the PR but I've decided to use a different approach, see https://github.com/spring-projects/spring-framework/commit/f3cedf268b3ef0c3ef14766db4e02d17346f8b24 for more details.