From dd97dee7fda7c0a29a5c943961816a77124a0676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Mon, 13 Nov 2023 19:33:09 +0100 Subject: [PATCH] Polish --- .../springframework/cache/caffeine/CaffeineCacheManager.java | 4 ++-- .../cache/jcache/interceptor/CachePutOperation.java | 4 ++-- .../cache/jcache/interceptor/CacheResultInterceptor.java | 3 +-- .../jcache/interceptor/DefaultJCacheOperationSource.java | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/spring-context-support/src/main/java/org/springframework/cache/caffeine/CaffeineCacheManager.java b/spring-context-support/src/main/java/org/springframework/cache/caffeine/CaffeineCacheManager.java index 44220ba860..794e3d1610 100644 --- a/spring-context-support/src/main/java/org/springframework/cache/caffeine/CaffeineCacheManager.java +++ b/spring-context-support/src/main/java/org/springframework/cache/caffeine/CaffeineCacheManager.java @@ -193,7 +193,7 @@ public class CaffeineCacheManager implements CacheManager { * Set the common cache type that this cache manager builds to async. * This applies to {@link #setCacheNames} as well as on-demand caches. *

Individual cache registrations (such as {@link #registerCustomCache(String, AsyncCache)} - * and {@link #registerCustomCache(String, com.github.benmanes.caffeine.cache.Cache)} + * and {@link #registerCustomCache(String, com.github.benmanes.caffeine.cache.Cache)}) * are not dependent on this setting. *

By default, this cache manager builds regular native Caffeine caches. * To switch to async caches which can also be used through the synchronous API @@ -322,7 +322,7 @@ public class CaffeineCacheManager implements CacheManager { * Build a common {@link CaffeineCache} instance for the specified cache name, * using the common Caffeine configuration specified on this cache manager. *

Delegates to {@link #adaptCaffeineCache} as the adaptation method to - * Spring's cache abstraction (allowing for centralized decoration etc), + * Spring's cache abstraction (allowing for centralized decoration etc.), * passing in a freshly built native Caffeine Cache instance. * @param name the name of the cache * @return the Spring CaffeineCache adapter (or a decorator thereof) diff --git a/spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/CachePutOperation.java b/spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/CachePutOperation.java index efbfb65652..a406418863 100644 --- a/spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/CachePutOperation.java +++ b/spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/CachePutOperation.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -102,7 +102,7 @@ class CachePutOperation extends AbstractJCacheKeyOperation { result = parameter; } else { - throw new IllegalArgumentException("More than one @CacheValue found on " + method + ""); + throw new IllegalArgumentException("More than one @CacheValue found on " + method); } } } diff --git a/spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/CacheResultInterceptor.java b/spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/CacheResultInterceptor.java index cd3d91b379..755a7374d2 100644 --- a/spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/CacheResultInterceptor.java +++ b/spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/CacheResultInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -146,7 +146,6 @@ class CacheResultInterceptor extends AbstractKeyCacheInterceptor T cloneException(T exception) { try { diff --git a/spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/DefaultJCacheOperationSource.java b/spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/DefaultJCacheOperationSource.java index 4bde292d8f..f6f84d3604 100644 --- a/spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/DefaultJCacheOperationSource.java +++ b/spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/DefaultJCacheOperationSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -232,7 +232,7 @@ public class DefaultJCacheOperationSource extends AnnotationJCacheOperationSourc * Only resolve the default exception cache resolver when an exception needs to be handled. *

A non-JSR-107 setup requires either a {@link CacheManager} or a {@link CacheResolver}. * If only the latter is specified, it is not possible to extract a default exception - * {@code CacheResolver} from a custom {@code CacheResolver} implementation so we have to + * {@code CacheResolver} from a custom {@code CacheResolver} implementation, so we have to * fall back on the {@code CacheManager}. *

This gives this weird situation of a perfectly valid configuration that breaks all * of a sudden because the JCache support is enabled. To avoid this we resolve the default