Only unwrap cache implementation for clients who are expecting the Map interface.

This commit is contained in:
Greg Burd 2018-04-23 12:37:49 -04:00
parent 06fe21d08e
commit d179539a31

View file

@ -390,7 +390,10 @@ public class MapCache<K, V> implements Cache<K, V> {
@Override
@SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> clazz) {
return (T) map;
if (Map.class.isAssignableFrom(clazz)) {
return (T) map;
}
return null;
}
/** {@inheritDoc} */