Skip to content

CaffeineCache does not support LoadingCache consistently #25173

Closed
@stefano-salmaso

Description

@stefano-salmaso

Hi all
CaffeineCache implementation override method public ValueWrapper get(Object key) and there is a specific check when a LoadingCache is provided.
In this case, the CacheLoader of the LoadingCache is used to retrieve the data (if not already present int the cache).

I don't see the same behavior for the method public <T> T get(Object key, @Nullable Class<T> type).
In this case, the CacheLoader of the LoadingCache is never used. Using only this method... the cache will be always empty.

Is there any reason for this different behavior?

Thanks
Stefano

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions