From 2f93759d1b1e7b83bb96e378a82e108a366911ce Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 3 Sep 2014 13:00:20 +0200 Subject: [PATCH] Cache.get(key, type) explicitly defines an IllegalStateException in case of a type mismatch Issue: SPR-12145 --- .../src/main/java/org/springframework/cache/Cache.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-context/src/main/java/org/springframework/cache/Cache.java b/spring-context/src/main/java/org/springframework/cache/Cache.java index 8a8ee5537cb..894ffaa8a6e 100644 --- a/spring-context/src/main/java/org/springframework/cache/Cache.java +++ b/spring-context/src/main/java/org/springframework/cache/Cache.java @@ -66,6 +66,8 @@ public interface Cache { * @return the value to which this cache maps the specified key * (which may be {@code null} itself), or also {@code null} if * the cache contains no mapping for this key + * @throws IllegalStateException if a cache entry has been found + * but failed to match the specified type * @see #get(Object) * @since 4.0 */