Only unwrap cache implementation for clients who are expecting the Map interface.
This commit is contained in:
parent
06fe21d08e
commit
d179539a31
1 changed files with 4 additions and 1 deletions
|
@ -390,7 +390,10 @@ public class MapCache<K, V> implements Cache<K, V> {
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public <T> T unwrap(Class<T> clazz) {
|
public <T> T unwrap(Class<T> clazz) {
|
||||||
return (T) map;
|
if (Map.class.isAssignableFrom(clazz)) {
|
||||||
|
return (T) map;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
|
|
Loading…
Reference in a new issue