Merge branch '6.1.x'

This commit is contained in:
Sébastien Deleuze
2024-03-26 15:41:46 +01:00
88 changed files with 172 additions and 72 deletions

View File

@@ -121,6 +121,7 @@ public class JCacheCacheManager extends AbstractTransactionSupportingCacheManage
}
@Override
@Nullable
protected Cache getMissingCache(String name) {
CacheManager cacheManager = getCacheManager();
Assert.state(cacheManager != null, "No CacheManager set");

View File

@@ -58,6 +58,7 @@ public abstract class AnnotationJCacheOperationSource extends AbstractFallbackJC
}
@Override
@Nullable
protected JCacheOperation<?> findCacheOperation(Method method, @Nullable Class<?> targetType) {
CacheResult cacheResult = method.getAnnotation(CacheResult.class);
CachePut cachePut = method.getAnnotation(CachePut.class);

View File

@@ -23,6 +23,7 @@ import org.springframework.cache.Cache;
import org.springframework.cache.interceptor.CacheErrorHandler;
import org.springframework.cache.interceptor.CacheOperationInvocationContext;
import org.springframework.cache.interceptor.CacheOperationInvoker;
import org.springframework.lang.Nullable;
/**
* Intercept methods annotated with {@link CachePut}.
@@ -39,6 +40,7 @@ class CachePutInterceptor extends AbstractKeyCacheInterceptor<CachePutOperation,
@Override
@Nullable
protected Object invoke(
CacheOperationInvocationContext<CachePutOperation> context, CacheOperationInvoker invoker) {

View File

@@ -22,6 +22,7 @@ import org.springframework.cache.Cache;
import org.springframework.cache.interceptor.CacheErrorHandler;
import org.springframework.cache.interceptor.CacheOperationInvocationContext;
import org.springframework.cache.interceptor.CacheOperationInvoker;
import org.springframework.lang.Nullable;
/**
* Intercept methods annotated with {@link CacheRemoveAll}.
@@ -38,6 +39,7 @@ class CacheRemoveAllInterceptor extends AbstractCacheInterceptor<CacheRemoveAllO
@Override
@Nullable
protected Object invoke(
CacheOperationInvocationContext<CacheRemoveAllOperation> context, CacheOperationInvoker invoker) {

View File

@@ -22,6 +22,7 @@ import org.springframework.cache.Cache;
import org.springframework.cache.interceptor.CacheErrorHandler;
import org.springframework.cache.interceptor.CacheOperationInvocationContext;
import org.springframework.cache.interceptor.CacheOperationInvoker;
import org.springframework.lang.Nullable;
/**
* Intercept methods annotated with {@link CacheRemove}.
@@ -38,6 +39,7 @@ class CacheRemoveEntryInterceptor extends AbstractKeyCacheInterceptor<CacheRemov
@Override
@Nullable
protected Object invoke(
CacheOperationInvocationContext<CacheRemoveOperation> context, CacheOperationInvoker invoker) {

View File

@@ -180,6 +180,7 @@ public class JCacheAspectSupport extends AbstractCacheInvoker implements Initial
}
@Override
@Nullable
public Object invoke() throws ThrowableWrapper {
return invokeOperation(this.delegate);
}

View File

@@ -24,6 +24,7 @@ import org.springframework.cache.interceptor.AbstractCacheResolver;
import org.springframework.cache.interceptor.BasicOperation;
import org.springframework.cache.interceptor.CacheOperationInvocationContext;
import org.springframework.cache.interceptor.CacheResolver;
import org.springframework.lang.Nullable;
/**
* A simple {@link CacheResolver} that resolves the exception cache
@@ -41,6 +42,7 @@ public class SimpleExceptionCacheResolver extends AbstractCacheResolver {
}
@Override
@Nullable
protected Collection<String> getCacheNames(CacheOperationInvocationContext<?> context) {
BasicOperation operation = context.getOperation();
if (!(operation instanceof CacheResultOperation cacheResultOperation)) {

View File

@@ -83,6 +83,7 @@ public class TransactionAwareCacheDecorator implements Cache {
}
@Override
@Nullable
public <T> T get(Object key, @Nullable Class<T> type) {
return this.targetCache.get(key, type);
}

View File

@@ -199,6 +199,7 @@ public class MethodInvokingJobDetailFactoryBean extends ArgumentConvertingMethod
* Overridden to support the {@link #setTargetBeanName "targetBeanName"} feature.
*/
@Override
@Nullable
public Class<?> getTargetClass() {
Class<?> targetClass = super.getTargetClass();
if (targetClass == null && this.targetBeanName != null) {
@@ -212,6 +213,7 @@ public class MethodInvokingJobDetailFactoryBean extends ArgumentConvertingMethod
* Overridden to support the {@link #setTargetBeanName "targetBeanName"} feature.
*/
@Override
@Nullable
public Object getTargetObject() {
Object targetObject = super.getTargetObject();
if (targetObject == null && this.targetBeanName != null) {

View File

@@ -22,6 +22,7 @@ import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.aot.hint.TypeHint.Builder;
import org.springframework.aot.hint.TypeReference;
import org.springframework.aot.hint.annotation.ReflectiveRuntimeHintsRegistrar;
import org.springframework.lang.Nullable;
import org.springframework.util.ClassUtils;
/**
@@ -40,7 +41,7 @@ class SchedulerFactoryBeanRuntimeHints implements RuntimeHintsRegistrar {
@Override
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
if (!ClassUtils.isPresent(SCHEDULER_FACTORY_CLASS_NAME, classLoader)) {
return;
}