Browse Source

Avoid CacheAspectSupport#findInCaches fall through to reactive handler

Prior to this commit if the return type is a CompletableFuture but a
cache get returns null, the execution falls through to the
reactiveCachingHandler.

This commit ensures that evaluation instead continues onto the next
cache (if any).

Closes gh-33371
pull/33720/head
Simon Baslé 1 year ago
parent
commit
f4a73b79b8
  1. 3
      spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java

3
spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java vendored

@ -510,6 +510,9 @@ public abstract class CacheAspectSupport extends AbstractCacheInvoker @@ -510,6 +510,9 @@ public abstract class CacheAspectSupport extends AbstractCacheInvoker
(value != null ? CompletableFuture.completedFuture(unwrapCacheValue(value)) : null),
invoker, method, contexts));
}
else {
continue;
}
}
if (this.reactiveCachingHandler != null) {
Object returnValue = this.reactiveCachingHandler.findInCaches(

Loading…
Cancel
Save