Fix NoOpCache handling of get(key,callable)

This commit fixes the method that takes a Callable to actually always
invoke it rather than returning null.

Issue: SPR-14445
This commit is contained in:
Stephane Nicoll
2016-07-11 10:34:27 +02:00
parent 629b95bd5c
commit 15c3cdd48d
2 changed files with 49 additions and 15 deletions

View File

@@ -102,7 +102,12 @@ public class NoOpCacheManager implements CacheManager {
@Override
public <T> T get(Object key, Callable<T> valueLoader) {
return null;
try {
return valueLoader.call();
}
catch (Exception ex) {
throw new ValueRetrievalException(key, valueLoader, ex);
}
}
@Override