There is probably unwanted behaviour coded in class org.springframework.cache.ehcache.EhCacheCache in method org.springframework.cache.ehcache.EhCacheCache#get(java.lang.Object, java.lang.Class<T>). When there is no value cached (ie. value == null) there is no way this check could pass:
if (type != null && !type.isInstance(value)) {
throw new IllegalStateException("Cached value is not of required type [" + type.getName() + "]: " + value);
}
And this leads to unexpected Illegal state exceptions in expected situations when caches are empty.
Jan Novotný opened SPR-11567 and commented
There is probably unwanted behaviour coded in class org.springframework.cache.ehcache.EhCacheCache in method org.springframework.cache.ehcache.EhCacheCache#get(java.lang.Object, java.lang.Class<T>). When there is no value cached (ie. value == null) there is no way this check could pass:
if (type != null && !type.isInstance(value)) {
throw new IllegalStateException("Cached value is not of required type [" + type.getName() + "]: " + value);
}
And this leads to unexpected Illegal state exceptions in expected situations when caches are empty.
Affects: 4.0.2
Issue Links:
The text was updated successfully, but these errors were encountered: