From 5581a0d0e5ed680c4557e701f3de4bd69ae4e09d Mon Sep 17 00:00:00 2001 From: Nikita Koksharov Date: Thu, 8 Jun 2023 12:27:01 +0300 Subject: [PATCH] Fixed - Default getCache method checks for Object class equality (thanks @agupta-hw) #5089 --- redisson/src/main/java/org/redisson/jcache/JCacheManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redisson/src/main/java/org/redisson/jcache/JCacheManager.java b/redisson/src/main/java/org/redisson/jcache/JCacheManager.java index 68234b7ab..943ba65c9 100644 --- a/redisson/src/main/java/org/redisson/jcache/JCacheManager.java +++ b/redisson/src/main/java/org/redisson/jcache/JCacheManager.java @@ -177,10 +177,10 @@ public class JCacheManager implements CacheManager { checkNotClosed(); Cache cache = (Cache) getCache(cacheName, Object.class, Object.class); if (cache != null) { - if (cache.getConfiguration(CompleteConfiguration.class).getKeyType() != Object.class) { + if (!cache.getConfiguration(CompleteConfiguration.class).getKeyType().isAssignableFrom(Object.class)) { throw new IllegalArgumentException("Wrong type of key for " + cacheName); } - if (cache.getConfiguration(CompleteConfiguration.class).getValueType() != Object.class) { + if (!cache.getConfiguration(CompleteConfiguration.class).getValueType().isAssignableFrom(Object.class)) { throw new IllegalArgumentException("Wrong type of value for " + cacheName); } }