Skip to content

Commit f4a73b7

Browse files
committed
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
1 parent 289c35c commit f4a73b7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,9 @@ private Object findInCaches(CacheOperationContext context, Object key,
510510
(value != null ? CompletableFuture.completedFuture(unwrapCacheValue(value)) : null),
511511
invoker, method, contexts));
512512
}
513+
else {
514+
continue;
515+
}
513516
}
514517
if (this.reactiveCachingHandler != null) {
515518
Object returnValue = this.reactiveCachingHandler.findInCaches(

0 commit comments

Comments
 (0)