Browse Source

Polish

pull/31123/merge
Stéphane Nicoll 1 year ago
parent
commit
dd97dee7fd
  1. 4
      spring-context-support/src/main/java/org/springframework/cache/caffeine/CaffeineCacheManager.java
  2. 4
      spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/CachePutOperation.java
  3. 3
      spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/CacheResultInterceptor.java
  4. 4
      spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/DefaultJCacheOperationSource.java

4
spring-context-support/src/main/java/org/springframework/cache/caffeine/CaffeineCacheManager.java vendored

@ -193,7 +193,7 @@ public class CaffeineCacheManager implements CacheManager {
* Set the common cache type that this cache manager builds to async. * Set the common cache type that this cache manager builds to async.
* This applies to {@link #setCacheNames} as well as on-demand caches. * This applies to {@link #setCacheNames} as well as on-demand caches.
* <p>Individual cache registrations (such as {@link #registerCustomCache(String, AsyncCache)} * <p>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. * are not dependent on this setting.
* <p>By default, this cache manager builds regular native Caffeine caches. * <p>By default, this cache manager builds regular native Caffeine caches.
* To switch to async caches which can also be used through the synchronous API * 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, * Build a common {@link CaffeineCache} instance for the specified cache name,
* using the common Caffeine configuration specified on this cache manager. * using the common Caffeine configuration specified on this cache manager.
* <p>Delegates to {@link #adaptCaffeineCache} as the adaptation method to * <p>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. * passing in a freshly built native Caffeine Cache instance.
* @param name the name of the cache * @param name the name of the cache
* @return the Spring CaffeineCache adapter (or a decorator thereof) * @return the Spring CaffeineCache adapter (or a decorator thereof)

4
spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/CachePutOperation.java vendored

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -102,7 +102,7 @@ class CachePutOperation extends AbstractJCacheKeyOperation<CachePut> {
result = parameter; result = parameter;
} }
else { else {
throw new IllegalArgumentException("More than one @CacheValue found on " + method + ""); throw new IllegalArgumentException("More than one @CacheValue found on " + method);
} }
} }
} }

3
spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/CacheResultInterceptor.java vendored

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -146,7 +146,6 @@ class CacheResultInterceptor extends AbstractKeyCacheInterceptor<CacheResultOper
return new CacheOperationInvoker.ThrowableWrapper(clone); return new CacheOperationInvoker.ThrowableWrapper(clone);
} }
@SuppressWarnings("unchecked")
@Nullable @Nullable
private static <T extends Throwable> T cloneException(T exception) { private static <T extends Throwable> T cloneException(T exception) {
try { try {

4
spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/DefaultJCacheOperationSource.java vendored

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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. * Only resolve the default exception cache resolver when an exception needs to be handled.
* <p>A non-JSR-107 setup requires either a {@link CacheManager} or a {@link CacheResolver}. * <p>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 * 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}. * fall back on the {@code CacheManager}.
* <p>This gives this weird situation of a perfectly valid configuration that breaks all * <p>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 * of a sudden because the JCache support is enabled. To avoid this we resolve the default

Loading…
Cancel
Save