Refine null-safety in more modules
This commit refines the null-safety in all remaining modules except spring-test. See gh-32475
This commit is contained in:
parent
1b563f8ba4
commit
290a41d398
|
@ -65,6 +65,7 @@ public class LazyInitTargetSource extends AbstractBeanFactoryBasedTargetSource {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public synchronized Object getTarget() throws BeansException {
|
public synchronized Object getTarget() throws BeansException {
|
||||||
if (this.target == null) {
|
if (this.target == null) {
|
||||||
this.target = getBeanFactory().getBean(getTargetBeanName());
|
this.target = getBeanFactory().getBean(getTargetBeanName());
|
||||||
|
|
|
@ -121,6 +121,7 @@ public class JCacheCacheManager extends AbstractTransactionSupportingCacheManage
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
protected Cache getMissingCache(String name) {
|
protected Cache getMissingCache(String name) {
|
||||||
CacheManager cacheManager = getCacheManager();
|
CacheManager cacheManager = getCacheManager();
|
||||||
Assert.state(cacheManager != null, "No CacheManager set");
|
Assert.state(cacheManager != null, "No CacheManager set");
|
||||||
|
|
|
@ -46,6 +46,7 @@ import org.springframework.util.StringUtils;
|
||||||
public abstract class AnnotationJCacheOperationSource extends AbstractFallbackJCacheOperationSource {
|
public abstract class AnnotationJCacheOperationSource extends AbstractFallbackJCacheOperationSource {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
protected JCacheOperation<?> findCacheOperation(Method method, @Nullable Class<?> targetType) {
|
protected JCacheOperation<?> findCacheOperation(Method method, @Nullable Class<?> targetType) {
|
||||||
CacheResult cacheResult = method.getAnnotation(CacheResult.class);
|
CacheResult cacheResult = method.getAnnotation(CacheResult.class);
|
||||||
CachePut cachePut = method.getAnnotation(CachePut.class);
|
CachePut cachePut = method.getAnnotation(CachePut.class);
|
||||||
|
|
|
@ -23,6 +23,7 @@ import org.springframework.cache.Cache;
|
||||||
import org.springframework.cache.interceptor.CacheErrorHandler;
|
import org.springframework.cache.interceptor.CacheErrorHandler;
|
||||||
import org.springframework.cache.interceptor.CacheOperationInvocationContext;
|
import org.springframework.cache.interceptor.CacheOperationInvocationContext;
|
||||||
import org.springframework.cache.interceptor.CacheOperationInvoker;
|
import org.springframework.cache.interceptor.CacheOperationInvoker;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Intercept methods annotated with {@link CachePut}.
|
* Intercept methods annotated with {@link CachePut}.
|
||||||
|
@ -39,6 +40,7 @@ class CachePutInterceptor extends AbstractKeyCacheInterceptor<CachePutOperation,
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
protected Object invoke(
|
protected Object invoke(
|
||||||
CacheOperationInvocationContext<CachePutOperation> context, CacheOperationInvoker invoker) {
|
CacheOperationInvocationContext<CachePutOperation> context, CacheOperationInvoker invoker) {
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ import org.springframework.cache.Cache;
|
||||||
import org.springframework.cache.interceptor.CacheErrorHandler;
|
import org.springframework.cache.interceptor.CacheErrorHandler;
|
||||||
import org.springframework.cache.interceptor.CacheOperationInvocationContext;
|
import org.springframework.cache.interceptor.CacheOperationInvocationContext;
|
||||||
import org.springframework.cache.interceptor.CacheOperationInvoker;
|
import org.springframework.cache.interceptor.CacheOperationInvoker;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Intercept methods annotated with {@link CacheRemoveAll}.
|
* Intercept methods annotated with {@link CacheRemoveAll}.
|
||||||
|
@ -38,6 +39,7 @@ class CacheRemoveAllInterceptor extends AbstractCacheInterceptor<CacheRemoveAllO
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
protected Object invoke(
|
protected Object invoke(
|
||||||
CacheOperationInvocationContext<CacheRemoveAllOperation> context, CacheOperationInvoker invoker) {
|
CacheOperationInvocationContext<CacheRemoveAllOperation> context, CacheOperationInvoker invoker) {
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ import org.springframework.cache.Cache;
|
||||||
import org.springframework.cache.interceptor.CacheErrorHandler;
|
import org.springframework.cache.interceptor.CacheErrorHandler;
|
||||||
import org.springframework.cache.interceptor.CacheOperationInvocationContext;
|
import org.springframework.cache.interceptor.CacheOperationInvocationContext;
|
||||||
import org.springframework.cache.interceptor.CacheOperationInvoker;
|
import org.springframework.cache.interceptor.CacheOperationInvoker;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Intercept methods annotated with {@link CacheRemove}.
|
* Intercept methods annotated with {@link CacheRemove}.
|
||||||
|
@ -38,6 +39,7 @@ class CacheRemoveEntryInterceptor extends AbstractKeyCacheInterceptor<CacheRemov
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
protected Object invoke(
|
protected Object invoke(
|
||||||
CacheOperationInvocationContext<CacheRemoveOperation> context, CacheOperationInvoker invoker) {
|
CacheOperationInvocationContext<CacheRemoveOperation> context, CacheOperationInvoker invoker) {
|
||||||
|
|
||||||
|
|
|
@ -180,6 +180,7 @@ public class JCacheAspectSupport extends AbstractCacheInvoker implements Initial
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public Object invoke() throws ThrowableWrapper {
|
public Object invoke() throws ThrowableWrapper {
|
||||||
return invokeOperation(this.delegate);
|
return invokeOperation(this.delegate);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ import org.springframework.cache.interceptor.AbstractCacheResolver;
|
||||||
import org.springframework.cache.interceptor.BasicOperation;
|
import org.springframework.cache.interceptor.BasicOperation;
|
||||||
import org.springframework.cache.interceptor.CacheOperationInvocationContext;
|
import org.springframework.cache.interceptor.CacheOperationInvocationContext;
|
||||||
import org.springframework.cache.interceptor.CacheResolver;
|
import org.springframework.cache.interceptor.CacheResolver;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple {@link CacheResolver} that resolves the exception cache
|
* A simple {@link CacheResolver} that resolves the exception cache
|
||||||
|
@ -41,6 +42,7 @@ public class SimpleExceptionCacheResolver extends AbstractCacheResolver {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
protected Collection<String> getCacheNames(CacheOperationInvocationContext<?> context) {
|
protected Collection<String> getCacheNames(CacheOperationInvocationContext<?> context) {
|
||||||
BasicOperation operation = context.getOperation();
|
BasicOperation operation = context.getOperation();
|
||||||
if (!(operation instanceof CacheResultOperation cacheResultOperation)) {
|
if (!(operation instanceof CacheResultOperation cacheResultOperation)) {
|
||||||
|
|
|
@ -83,6 +83,7 @@ public class TransactionAwareCacheDecorator implements Cache {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public <T> T get(Object key, @Nullable Class<T> type) {
|
public <T> T get(Object key, @Nullable Class<T> type) {
|
||||||
return this.targetCache.get(key, type);
|
return this.targetCache.get(key, type);
|
||||||
}
|
}
|
||||||
|
|
|
@ -199,6 +199,7 @@ public class MethodInvokingJobDetailFactoryBean extends ArgumentConvertingMethod
|
||||||
* Overridden to support the {@link #setTargetBeanName "targetBeanName"} feature.
|
* Overridden to support the {@link #setTargetBeanName "targetBeanName"} feature.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public Class<?> getTargetClass() {
|
public Class<?> getTargetClass() {
|
||||||
Class<?> targetClass = super.getTargetClass();
|
Class<?> targetClass = super.getTargetClass();
|
||||||
if (targetClass == null && this.targetBeanName != null) {
|
if (targetClass == null && this.targetBeanName != null) {
|
||||||
|
@ -212,6 +213,7 @@ public class MethodInvokingJobDetailFactoryBean extends ArgumentConvertingMethod
|
||||||
* Overridden to support the {@link #setTargetBeanName "targetBeanName"} feature.
|
* Overridden to support the {@link #setTargetBeanName "targetBeanName"} feature.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public Object getTargetObject() {
|
public Object getTargetObject() {
|
||||||
Object targetObject = super.getTargetObject();
|
Object targetObject = super.getTargetObject();
|
||||||
if (targetObject == null && this.targetBeanName != null) {
|
if (targetObject == null && this.targetBeanName != null) {
|
||||||
|
|
|
@ -22,6 +22,7 @@ import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||||
import org.springframework.aot.hint.TypeHint.Builder;
|
import org.springframework.aot.hint.TypeHint.Builder;
|
||||||
import org.springframework.aot.hint.TypeReference;
|
import org.springframework.aot.hint.TypeReference;
|
||||||
import org.springframework.aot.hint.annotation.ReflectiveRuntimeHintsRegistrar;
|
import org.springframework.aot.hint.annotation.ReflectiveRuntimeHintsRegistrar;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
import org.springframework.util.ClassUtils;
|
import org.springframework.util.ClassUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,7 +41,7 @@ class SchedulerFactoryBeanRuntimeHints implements RuntimeHintsRegistrar {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
|
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
|
||||||
if (!ClassUtils.isPresent(SCHEDULER_FACTORY_CLASS_NAME, classLoader)) {
|
if (!ClassUtils.isPresent(SCHEDULER_FACTORY_CLASS_NAME, classLoader)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -315,7 +315,7 @@ public interface Cache {
|
||||||
@Nullable
|
@Nullable
|
||||||
private final Object key;
|
private final Object key;
|
||||||
|
|
||||||
public ValueRetrievalException(@Nullable Object key, Callable<?> loader, Throwable ex) {
|
public ValueRetrievalException(@Nullable Object key, Callable<?> loader, @Nullable Throwable ex) {
|
||||||
super(String.format("Value for key '%s' could not be loaded using '%s'", key, loader), ex);
|
super(String.format("Value for key '%s' could not be loaded using '%s'", key, loader), ex);
|
||||||
this.key = key;
|
this.key = key;
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,6 +223,7 @@ public class ConcurrentMapCache extends AbstractValueAdaptingCache {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
protected Object fromStoreValue(@Nullable Object storeValue) {
|
protected Object fromStoreValue(@Nullable Object storeValue) {
|
||||||
if (storeValue != null && this.serialization != null) {
|
if (storeValue != null && this.serialization != null) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -52,6 +52,7 @@ public class NamedCacheResolver extends AbstractCacheResolver {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
protected Collection<String> getCacheNames(CacheOperationInvocationContext<?> context) {
|
protected Collection<String> getCacheNames(CacheOperationInvocationContext<?> context) {
|
||||||
return this.cacheNames;
|
return this.cacheNames;
|
||||||
}
|
}
|
||||||
|
|
|
@ -314,6 +314,7 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public BeanRegistrationAotContribution processAheadOfTime(RegisteredBean registeredBean) {
|
public BeanRegistrationAotContribution processAheadOfTime(RegisteredBean registeredBean) {
|
||||||
BeanRegistrationAotContribution parentAotContribution = super.processAheadOfTime(registeredBean);
|
BeanRegistrationAotContribution parentAotContribution = super.processAheadOfTime(registeredBean);
|
||||||
Class<?> beanClass = registeredBean.getBeanClass();
|
Class<?> beanClass = registeredBean.getBeanClass();
|
||||||
|
@ -350,6 +351,7 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public Object postProcessBeforeInstantiation(Class<?> beanClass, String beanName) {
|
public Object postProcessBeforeInstantiation(Class<?> beanClass, String beanName) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -334,6 +334,7 @@ class ConfigurationClassEnhancer {
|
||||||
return resolveBeanReference(beanMethod, beanMethodArgs, beanFactory, beanName);
|
return resolveBeanReference(beanMethod, beanMethodArgs, beanFactory, beanName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
private Object resolveBeanReference(Method beanMethod, Object[] beanMethodArgs,
|
private Object resolveBeanReference(Method beanMethod, Object[] beanMethodArgs,
|
||||||
ConfigurableBeanFactory beanFactory, String beanName) {
|
ConfigurableBeanFactory beanFactory, String beanName) {
|
||||||
|
|
||||||
|
|
|
@ -350,7 +350,7 @@ public class ApplicationListenerMethodAdapter implements GenericApplicationListe
|
||||||
* Invoke the event listener method with the given argument values.
|
* Invoke the event listener method with the given argument values.
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
protected Object doInvoke(Object... args) {
|
protected Object doInvoke(@Nullable Object... args) {
|
||||||
Object bean = getTargetBean();
|
Object bean = getTargetBean();
|
||||||
// Detect package-protected NullBean instance through equals(null) check
|
// Detect package-protected NullBean instance through equals(null) check
|
||||||
if (bean.equals(null)) {
|
if (bean.equals(null)) {
|
||||||
|
@ -416,8 +416,8 @@ public class ApplicationListenerMethodAdapter implements GenericApplicationListe
|
||||||
* the given error message.
|
* the given error message.
|
||||||
* @param message error message to append the HandlerMethod details to
|
* @param message error message to append the HandlerMethod details to
|
||||||
*/
|
*/
|
||||||
protected String getDetailedErrorMessage(Object bean, String message) {
|
protected String getDetailedErrorMessage(Object bean, @Nullable String message) {
|
||||||
StringBuilder sb = new StringBuilder(message).append('\n');
|
StringBuilder sb = (StringUtils.hasLength(message) ? new StringBuilder(message).append('\n') : new StringBuilder());
|
||||||
sb.append("HandlerMethod details: \n");
|
sb.append("HandlerMethod details: \n");
|
||||||
sb.append("Bean [").append(bean.getClass().getName()).append("]\n");
|
sb.append("Bean [").append(bean.getClass().getName()).append("]\n");
|
||||||
sb.append("Method [").append(this.method.toGenericString()).append("]\n");
|
sb.append("Method [").append(this.method.toGenericString()).append("]\n");
|
||||||
|
@ -431,7 +431,7 @@ public class ApplicationListenerMethodAdapter implements GenericApplicationListe
|
||||||
* beans, and others). Event listener beans that require proxying should prefer
|
* beans, and others). Event listener beans that require proxying should prefer
|
||||||
* class-based proxy mechanisms.
|
* class-based proxy mechanisms.
|
||||||
*/
|
*/
|
||||||
private void assertTargetBean(Method method, Object targetBean, Object[] args) {
|
private void assertTargetBean(Method method, Object targetBean, @Nullable Object[] args) {
|
||||||
Class<?> methodDeclaringClass = method.getDeclaringClass();
|
Class<?> methodDeclaringClass = method.getDeclaringClass();
|
||||||
Class<?> targetBeanClass = targetBean.getClass();
|
Class<?> targetBeanClass = targetBean.getClass();
|
||||||
if (!methodDeclaringClass.isAssignableFrom(targetBeanClass)) {
|
if (!methodDeclaringClass.isAssignableFrom(targetBeanClass)) {
|
||||||
|
@ -443,7 +443,7 @@ public class ApplicationListenerMethodAdapter implements GenericApplicationListe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getInvocationErrorMessage(Object bean, String message, Object[] resolvedArgs) {
|
private String getInvocationErrorMessage(Object bean, @Nullable String message, @Nullable Object[] resolvedArgs) {
|
||||||
StringBuilder sb = new StringBuilder(getDetailedErrorMessage(bean, message));
|
StringBuilder sb = new StringBuilder(getDetailedErrorMessage(bean, message));
|
||||||
sb.append("Resolved arguments: \n");
|
sb.append("Resolved arguments: \n");
|
||||||
for (int i = 0; i < resolvedArgs.length; i++) {
|
for (int i = 0; i < resolvedArgs.length; i++) {
|
||||||
|
|
|
@ -1463,6 +1463,7 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public String getMessage(String code, @Nullable Object[] args, @Nullable String defaultMessage, Locale locale) {
|
public String getMessage(String code, @Nullable Object[] args, @Nullable String defaultMessage, Locale locale) {
|
||||||
return getMessageSource().getMessage(code, args, defaultMessage, locale);
|
return getMessageSource().getMessage(code, args, defaultMessage, locale);
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,6 +137,7 @@ public abstract class AbstractMessageSource extends MessageSourceSupport impleme
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public final String getMessage(String code, @Nullable Object[] args, @Nullable String defaultMessage, Locale locale) {
|
public final String getMessage(String code, @Nullable Object[] args, @Nullable String defaultMessage, Locale locale) {
|
||||||
String msg = getMessageInternal(code, args, locale);
|
String msg = getMessageInternal(code, args, locale);
|
||||||
if (msg != null) {
|
if (msg != null) {
|
||||||
|
|
|
@ -123,6 +123,7 @@ class ContextTypeMatchClassLoader extends DecoratingClassLoader implements Smart
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
protected Class<?> loadClassForOverriding(String name) throws ClassNotFoundException {
|
protected Class<?> loadClassForOverriding(String name) throws ClassNotFoundException {
|
||||||
byte[] bytes = bytesCache.get(name);
|
byte[] bytes = bytesCache.get(name);
|
||||||
if (bytes == null) {
|
if (bytes == null) {
|
||||||
|
|
|
@ -191,6 +191,7 @@ public class ReloadableResourceBundleMessageSource extends AbstractResourceBased
|
||||||
* returning the value found in the bundle as-is (without MessageFormat parsing).
|
* returning the value found in the bundle as-is (without MessageFormat parsing).
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
protected String resolveCodeWithoutArguments(String code, Locale locale) {
|
protected String resolveCodeWithoutArguments(String code, Locale locale) {
|
||||||
if (getCacheMillis() < 0) {
|
if (getCacheMillis() < 0) {
|
||||||
PropertiesHolder propHolder = getMergedProperties(locale);
|
PropertiesHolder propHolder = getMergedProperties(locale);
|
||||||
|
|
|
@ -145,6 +145,7 @@ public class ResourceBundleMessageSource extends AbstractResourceBasedMessageSou
|
||||||
* returning the value found in the bundle as-is (without MessageFormat parsing).
|
* returning the value found in the bundle as-is (without MessageFormat parsing).
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
protected String resolveCodeWithoutArguments(String code, Locale locale) {
|
protected String resolveCodeWithoutArguments(String code, Locale locale) {
|
||||||
Set<String> basenames = getBasenameSet();
|
Set<String> basenames = getBasenameSet();
|
||||||
for (String basename : basenames) {
|
for (String basename : basenames) {
|
||||||
|
|
|
@ -19,6 +19,7 @@ package org.springframework.format.support;
|
||||||
import org.springframework.aot.hint.RuntimeHints;
|
import org.springframework.aot.hint.RuntimeHints;
|
||||||
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||||
import org.springframework.aot.hint.TypeReference;
|
import org.springframework.aot.hint.TypeReference;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link RuntimeHintsRegistrar} to register hints for {@link DefaultFormattingConversionService}.
|
* {@link RuntimeHintsRegistrar} to register hints for {@link DefaultFormattingConversionService}.
|
||||||
|
@ -29,7 +30,7 @@ import org.springframework.aot.hint.TypeReference;
|
||||||
class FormattingConversionServiceRuntimeHints implements RuntimeHintsRegistrar {
|
class FormattingConversionServiceRuntimeHints implements RuntimeHintsRegistrar {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
|
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
|
||||||
hints.reflection().registerType(TypeReference.of("javax.money.MonetaryAmount"));
|
hints.reflection().registerType(TypeReference.of("javax.money.MonetaryAmount"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,8 @@ package org.springframework.jmx.access;
|
||||||
|
|
||||||
import javax.management.JMRuntimeException;
|
import javax.management.JMRuntimeException;
|
||||||
|
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Thrown when trying to invoke an operation on a proxy that is not exposed
|
* Thrown when trying to invoke an operation on a proxy that is not exposed
|
||||||
* by the proxied MBean resource's management interface.
|
* by the proxied MBean resource's management interface.
|
||||||
|
@ -35,7 +37,7 @@ public class InvalidInvocationException extends JMRuntimeException {
|
||||||
* error message.
|
* error message.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public InvalidInvocationException(String msg) {
|
public InvalidInvocationException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -108,6 +108,7 @@ public class MBeanProxyFactoryBean extends MBeanClientInterceptor
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public Class<?> getObjectType() {
|
public Class<?> getObjectType() {
|
||||||
return this.proxyInterface;
|
return this.proxyInterface;
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,6 +273,7 @@ public class JndiObjectFactoryBean extends JndiObjectLocator
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public Class<?> getObjectType() {
|
public Class<?> getObjectType() {
|
||||||
if (this.proxyInterfaces != null) {
|
if (this.proxyInterfaces != null) {
|
||||||
if (this.proxyInterfaces.length == 1) {
|
if (this.proxyInterfaces.length == 1) {
|
||||||
|
|
|
@ -34,6 +34,7 @@ import org.springframework.lang.Nullable;
|
||||||
public class AsyncConfigurerSupport implements AsyncConfigurer {
|
public class AsyncConfigurerSupport implements AsyncConfigurer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public Executor getAsyncExecutor() {
|
public Executor getAsyncExecutor() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -334,16 +334,19 @@ public class ConcurrentTaskScheduler extends ConcurrentTaskExecutor implements T
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public Instant lastScheduledExecution() {
|
public Instant lastScheduledExecution() {
|
||||||
return (this.le != null ? toInstant(this.le.getScheduledStart()) : null);
|
return (this.le != null ? toInstant(this.le.getScheduledStart()) : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public Instant lastActualExecution() {
|
public Instant lastActualExecution() {
|
||||||
return (this.le != null ? toInstant(this.le.getRunStart()) : null);
|
return (this.le != null ? toInstant(this.le.getRunStart()) : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public Instant lastCompletion() {
|
public Instant lastCompletion() {
|
||||||
return (this.le != null ? toInstant(this.le.getRunEnd()) : null);
|
return (this.le != null ? toInstant(this.le.getRunEnd()) : null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,6 +106,7 @@ public class TaskSchedulerRouter implements TaskScheduler, BeanNameAware, BeanFa
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public ScheduledFuture<?> schedule(Runnable task, Trigger trigger) {
|
public ScheduledFuture<?> schedule(Runnable task, Trigger trigger) {
|
||||||
return determineTargetScheduler(task).schedule(task, trigger);
|
return determineTargetScheduler(task).schedule(task, trigger);
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,6 +112,7 @@ public class CronTrigger implements Trigger {
|
||||||
* previous execution; therefore, overlapping executions won't occur.
|
* previous execution; therefore, overlapping executions won't occur.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public Instant nextExecution(TriggerContext triggerContext) {
|
public Instant nextExecution(TriggerContext triggerContext) {
|
||||||
Instant timestamp = determineLatestTimestamp(triggerContext);
|
Instant timestamp = determineLatestTimestamp(triggerContext);
|
||||||
ZoneId zone = (this.zoneId != null ? this.zoneId : triggerContext.getClock().getZone());
|
ZoneId zone = (this.zoneId != null ? this.zoneId : triggerContext.getClock().getZone());
|
||||||
|
|
|
@ -338,6 +338,7 @@ final class QuartzCronField extends CronField {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public <T extends Temporal & Comparable<? super T>> T nextOrSame(T temporal) {
|
public <T extends Temporal & Comparable<? super T>> T nextOrSame(T temporal) {
|
||||||
T result = adjust(temporal);
|
T result = adjust(temporal);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
|
|
|
@ -22,6 +22,7 @@ import org.springframework.beans.factory.config.BeanDefinition;
|
||||||
import org.springframework.beans.factory.config.TypedStringValue;
|
import org.springframework.beans.factory.config.TypedStringValue;
|
||||||
import org.springframework.beans.factory.xml.BeanDefinitionParser;
|
import org.springframework.beans.factory.xml.BeanDefinitionParser;
|
||||||
import org.springframework.beans.factory.xml.ParserContext;
|
import org.springframework.beans.factory.xml.ParserContext;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,6 +39,7 @@ class ScriptingDefaultsParser implements BeanDefinitionParser {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public BeanDefinition parse(Element element, ParserContext parserContext) {
|
public BeanDefinition parse(Element element, ParserContext parserContext) {
|
||||||
BeanDefinition bd =
|
BeanDefinition bd =
|
||||||
LangNamespaceUtils.registerScriptFactoryPostProcessorIfNecessary(parserContext.getRegistry());
|
LangNamespaceUtils.registerScriptFactoryPostProcessorIfNecessary(parserContext.getRegistry());
|
||||||
|
|
|
@ -305,6 +305,7 @@ public class ScriptFactoryPostProcessor implements SmartInstantiationAwareBeanPo
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public Object postProcessBeforeInstantiation(Class<?> beanClass, String beanName) {
|
public Object postProcessBeforeInstantiation(Class<?> beanClass, String beanName) {
|
||||||
// We only apply special treatment to ScriptFactory implementations here.
|
// We only apply special treatment to ScriptFactory implementations here.
|
||||||
if (!ScriptFactory.class.isAssignableFrom(beanClass)) {
|
if (!ScriptFactory.class.isAssignableFrom(beanClass)) {
|
||||||
|
|
|
@ -70,6 +70,7 @@ public abstract class AbstractPropertyBindingResult extends AbstractBindingResul
|
||||||
* @see #getPropertyAccessor()
|
* @see #getPropertyAccessor()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public PropertyEditorRegistry getPropertyEditorRegistry() {
|
public PropertyEditorRegistry getPropertyEditorRegistry() {
|
||||||
return (getTarget() != null ? getPropertyAccessor() : null);
|
return (getTarget() != null ? getPropertyAccessor() : null);
|
||||||
}
|
}
|
||||||
|
@ -109,6 +110,7 @@ public abstract class AbstractPropertyBindingResult extends AbstractBindingResul
|
||||||
* @see #getCustomEditor
|
* @see #getCustomEditor
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
protected Object formatFieldValue(String field, @Nullable Object value) {
|
protected Object formatFieldValue(String field, @Nullable Object value) {
|
||||||
String fixedField = fixedField(field);
|
String fixedField = fixedField(field);
|
||||||
// Try custom editor...
|
// Try custom editor...
|
||||||
|
|
|
@ -147,6 +147,7 @@ public class SimpleErrors implements Errors, Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public Class<?> getFieldType(String field) {
|
public Class<?> getFieldType(String field) {
|
||||||
PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(this.target.getClass(), field);
|
PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(this.target.getClass(), field);
|
||||||
if (pd != null) {
|
if (pd != null) {
|
||||||
|
|
|
@ -147,6 +147,7 @@ public class ParameterErrors extends ParameterValidationResult implements Errors
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public ObjectError getGlobalError() {
|
public ObjectError getGlobalError() {
|
||||||
return this.errors.getGlobalError();
|
return this.errors.getGlobalError();
|
||||||
}
|
}
|
||||||
|
@ -167,6 +168,7 @@ public class ParameterErrors extends ParameterValidationResult implements Errors
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public FieldError getFieldError() {
|
public FieldError getFieldError() {
|
||||||
return this.errors.getFieldError();
|
return this.errors.getFieldError();
|
||||||
}
|
}
|
||||||
|
@ -187,16 +189,19 @@ public class ParameterErrors extends ParameterValidationResult implements Errors
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public FieldError getFieldError(String field) {
|
public FieldError getFieldError(String field) {
|
||||||
return this.errors.getFieldError(field);
|
return this.errors.getFieldError(field);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public Object getFieldValue(String field) {
|
public Object getFieldValue(String field) {
|
||||||
return this.errors.getFieldError(field);
|
return this.errors.getFieldError(field);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public Class<?> getFieldType(String field) {
|
public Class<?> getFieldType(String field) {
|
||||||
return this.errors.getFieldType(field);
|
return this.errors.getFieldType(field);
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class BindingReflectionHintsRegistrar {
|
||||||
* @param hints the hints instance to use
|
* @param hints the hints instance to use
|
||||||
* @param types the types to register
|
* @param types the types to register
|
||||||
*/
|
*/
|
||||||
public void registerReflectionHints(ReflectionHints hints, Type... types) {
|
public void registerReflectionHints(ReflectionHints hints, @Nullable Type... types) {
|
||||||
Set<Type> seen = new LinkedHashSet<>();
|
Set<Type> seen = new LinkedHashSet<>();
|
||||||
for (Type type : types) {
|
for (Type type : types) {
|
||||||
registerReflectionHints(hints, seen, type);
|
registerReflectionHints(hints, seen, type);
|
||||||
|
|
|
@ -92,7 +92,7 @@ public abstract class CoroutinesUtils {
|
||||||
* @return the method invocation result as reactive stream
|
* @return the method invocation result as reactive stream
|
||||||
* @throws IllegalArgumentException if {@code method} is not a suspending function
|
* @throws IllegalArgumentException if {@code method} is not a suspending function
|
||||||
*/
|
*/
|
||||||
public static Publisher<?> invokeSuspendingFunction(Method method, Object target, Object... args) {
|
public static Publisher<?> invokeSuspendingFunction(Method method, Object target, @Nullable Object... args) {
|
||||||
return invokeSuspendingFunction(Dispatchers.getUnconfined(), method, target, args);
|
return invokeSuspendingFunction(Dispatchers.getUnconfined(), method, target, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ public abstract class CoroutinesUtils {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({"deprecation", "DataFlowIssue"})
|
@SuppressWarnings({"deprecation", "DataFlowIssue"})
|
||||||
public static Publisher<?> invokeSuspendingFunction(
|
public static Publisher<?> invokeSuspendingFunction(
|
||||||
CoroutineContext context, Method method, @Nullable Object target, Object... args) {
|
CoroutineContext context, Method method, @Nullable Object target, @Nullable Object... args) {
|
||||||
|
|
||||||
Assert.isTrue(KotlinDetector.isSuspendingFunction(method), "Method must be a suspending function");
|
Assert.isTrue(KotlinDetector.isSuspendingFunction(method), "Method must be a suspending function");
|
||||||
KFunction<?> function = ReflectJvmMapping.getKotlinFunction(method);
|
KFunction<?> function = ReflectJvmMapping.getKotlinFunction(method);
|
||||||
|
|
|
@ -41,7 +41,7 @@ public abstract class NestedRuntimeException extends RuntimeException {
|
||||||
* Construct a {@code NestedRuntimeException} with the specified detail message.
|
* Construct a {@code NestedRuntimeException} with the specified detail message.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public NestedRuntimeException(String msg) {
|
public NestedRuntimeException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class CodecException extends NestedRuntimeException {
|
||||||
* Create a new CodecException.
|
* Create a new CodecException.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public CodecException(String msg) {
|
public CodecException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ public class CodecException extends NestedRuntimeException {
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
* @param cause root cause for the exception, if any
|
* @param cause root cause for the exception, if any
|
||||||
*/
|
*/
|
||||||
public CodecException(String msg, @Nullable Throwable cause) {
|
public CodecException(@Nullable String msg, @Nullable Throwable cause) {
|
||||||
super(msg, cause);
|
super(msg, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class DecodingException extends CodecException {
|
||||||
* Create a new DecodingException.
|
* Create a new DecodingException.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public DecodingException(String msg) {
|
public DecodingException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ public class DecodingException extends CodecException {
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
* @param cause root cause for the exception, if any
|
* @param cause root cause for the exception, if any
|
||||||
*/
|
*/
|
||||||
public DecodingException(String msg, @Nullable Throwable cause) {
|
public DecodingException(@Nullable String msg, @Nullable Throwable cause) {
|
||||||
super(msg, cause);
|
super(msg, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -201,7 +201,7 @@ public abstract class StreamUtils {
|
||||||
* @throws IOException in case of I/O errors
|
* @throws IOException in case of I/O errors
|
||||||
* @since 4.3
|
* @since 4.3
|
||||||
*/
|
*/
|
||||||
public static int drain(InputStream in) throws IOException {
|
public static int drain(@Nullable InputStream in) throws IOException {
|
||||||
Assert.notNull(in, "No InputStream specified");
|
Assert.notNull(in, "No InputStream specified");
|
||||||
return (int) in.transferTo(OutputStream.nullOutputStream());
|
return (int) in.transferTo(OutputStream.nullOutputStream());
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ import java.util.Collections;
|
||||||
import org.springframework.aot.hint.ExecutableMode;
|
import org.springframework.aot.hint.ExecutableMode;
|
||||||
import org.springframework.aot.hint.RuntimeHints;
|
import org.springframework.aot.hint.RuntimeHints;
|
||||||
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link RuntimeHintsRegistrar} implementation that registers reflection hints for
|
* {@link RuntimeHintsRegistrar} implementation that registers reflection hints for
|
||||||
|
@ -33,7 +34,7 @@ import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||||
class EmbeddedDatabaseFactoryRuntimeHints implements RuntimeHintsRegistrar {
|
class EmbeddedDatabaseFactoryRuntimeHints implements RuntimeHintsRegistrar {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
|
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
|
||||||
hints.reflection().registerTypeIfPresent(classLoader,
|
hints.reflection().registerTypeIfPresent(classLoader,
|
||||||
"org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory$EmbeddedDataSourceProxy",
|
"org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory$EmbeddedDataSourceProxy",
|
||||||
builder -> builder
|
builder -> builder
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class ObjectOptimisticLockingFailureException extends OptimisticLockingFa
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
* @param cause the source exception
|
* @param cause the source exception
|
||||||
*/
|
*/
|
||||||
public ObjectOptimisticLockingFailureException(@Nullable String msg, Throwable cause) {
|
public ObjectOptimisticLockingFailureException(@Nullable String msg, @Nullable Throwable cause) {
|
||||||
super(msg, cause);
|
super(msg, cause);
|
||||||
this.persistentClass = null;
|
this.persistentClass = null;
|
||||||
this.identifier = null;
|
this.identifier = null;
|
||||||
|
|
|
@ -22,6 +22,7 @@ import org.springframework.aot.hint.ExecutableMode;
|
||||||
import org.springframework.aot.hint.RuntimeHints;
|
import org.springframework.aot.hint.RuntimeHints;
|
||||||
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||||
import org.springframework.aot.hint.TypeReference;
|
import org.springframework.aot.hint.TypeReference;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
import org.springframework.util.ClassUtils;
|
import org.springframework.util.ClassUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,7 +43,7 @@ class EntityManagerRuntimeHints implements RuntimeHintsRegistrar {
|
||||||
private static final String NATIVE_QUERY_IMPL_CLASS_NAME = "org.hibernate.query.sql.internal.NativeQueryImpl";
|
private static final String NATIVE_QUERY_IMPL_CLASS_NAME = "org.hibernate.query.sql.internal.NativeQueryImpl";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
|
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
|
||||||
if (ClassUtils.isPresent(HIBERNATE_SESSION_FACTORY_CLASS_NAME, classLoader)) {
|
if (ClassUtils.isPresent(HIBERNATE_SESSION_FACTORY_CLASS_NAME, classLoader)) {
|
||||||
hints.proxies().registerJdkProxy(TypeReference.of(HIBERNATE_SESSION_FACTORY_CLASS_NAME),
|
hints.proxies().registerJdkProxy(TypeReference.of(HIBERNATE_SESSION_FACTORY_CLASS_NAME),
|
||||||
TypeReference.of(EntityManagerFactoryInfo.class));
|
TypeReference.of(EntityManagerFactoryInfo.class));
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
package org.springframework.dao;
|
package org.springframework.dao;
|
||||||
|
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception thrown on failure to acquire a lock during an update,
|
* Exception thrown on failure to acquire a lock during an update,
|
||||||
* for example during a "select for update" statement.
|
* for example during a "select for update" statement.
|
||||||
|
@ -32,7 +34,7 @@ public class CannotAcquireLockException extends PessimisticLockingFailureExcepti
|
||||||
* Constructor for CannotAcquireLockException.
|
* Constructor for CannotAcquireLockException.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public CannotAcquireLockException(String msg) {
|
public CannotAcquireLockException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +43,7 @@ public class CannotAcquireLockException extends PessimisticLockingFailureExcepti
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
* @param cause the root cause from the data access API in use
|
* @param cause the root cause from the data access API in use
|
||||||
*/
|
*/
|
||||||
public CannotAcquireLockException(String msg, Throwable cause) {
|
public CannotAcquireLockException(@Nullable String msg, @Nullable Throwable cause) {
|
||||||
super(msg, cause);
|
super(msg, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class ConcurrencyFailureException extends TransientDataAccessException {
|
||||||
* Constructor for ConcurrencyFailureException.
|
* Constructor for ConcurrencyFailureException.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public ConcurrencyFailureException(String msg) {
|
public ConcurrencyFailureException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public class ConcurrencyFailureException extends TransientDataAccessException {
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
* @param cause the root cause from the data access API in use
|
* @param cause the root cause from the data access API in use
|
||||||
*/
|
*/
|
||||||
public ConcurrencyFailureException(String msg, @Nullable Throwable cause) {
|
public ConcurrencyFailureException(@Nullable String msg, @Nullable Throwable cause) {
|
||||||
super(msg, cause);
|
super(msg, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ public abstract class DataAccessException extends NestedRuntimeException {
|
||||||
* Constructor for DataAccessException.
|
* Constructor for DataAccessException.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public DataAccessException(String msg) {
|
public DataAccessException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class DataAccessResourceFailureException extends NonTransientDataAccessRe
|
||||||
* Constructor for DataAccessResourceFailureException.
|
* Constructor for DataAccessResourceFailureException.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public DataAccessResourceFailureException(String msg) {
|
public DataAccessResourceFailureException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ public class DataAccessResourceFailureException extends NonTransientDataAccessRe
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
* @param cause the root cause from the data access API in use
|
* @param cause the root cause from the data access API in use
|
||||||
*/
|
*/
|
||||||
public DataAccessResourceFailureException(String msg, @Nullable Throwable cause) {
|
public DataAccessResourceFailureException(@Nullable String msg, @Nullable Throwable cause) {
|
||||||
super(msg, cause);
|
super(msg, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
package org.springframework.dao;
|
package org.springframework.dao;
|
||||||
|
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception thrown when an attempt to insert or update data
|
* Exception thrown when an attempt to insert or update data
|
||||||
* results in violation of an integrity constraint. Note that this
|
* results in violation of an integrity constraint. Note that this
|
||||||
|
@ -36,7 +38,7 @@ public class DataIntegrityViolationException extends NonTransientDataAccessExcep
|
||||||
* Constructor for DataIntegrityViolationException.
|
* Constructor for DataIntegrityViolationException.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public DataIntegrityViolationException(String msg) {
|
public DataIntegrityViolationException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +47,7 @@ public class DataIntegrityViolationException extends NonTransientDataAccessExcep
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
* @param cause the root cause from the data access API in use
|
* @param cause the root cause from the data access API in use
|
||||||
*/
|
*/
|
||||||
public DataIntegrityViolationException(String msg, Throwable cause) {
|
public DataIntegrityViolationException(@Nullable String msg, @Nullable Throwable cause) {
|
||||||
super(msg, cause);
|
super(msg, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class DataRetrievalFailureException extends NonTransientDataAccessExcepti
|
||||||
* Constructor for DataRetrievalFailureException.
|
* Constructor for DataRetrievalFailureException.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public DataRetrievalFailureException(String msg) {
|
public DataRetrievalFailureException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ public class DataRetrievalFailureException extends NonTransientDataAccessExcepti
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
* @param cause the root cause from the data access API in use
|
* @param cause the root cause from the data access API in use
|
||||||
*/
|
*/
|
||||||
public DataRetrievalFailureException(String msg, @Nullable Throwable cause) {
|
public DataRetrievalFailureException(@Nullable String msg, @Nullable Throwable cause) {
|
||||||
super(msg, cause);
|
super(msg, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
package org.springframework.dao;
|
package org.springframework.dao;
|
||||||
|
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception thrown when an attempt to insert or update data
|
* Exception thrown when an attempt to insert or update data
|
||||||
* results in violation of a primary key or unique constraint.
|
* results in violation of a primary key or unique constraint.
|
||||||
|
@ -34,7 +36,7 @@ public class DuplicateKeyException extends DataIntegrityViolationException {
|
||||||
* Constructor for DuplicateKeyException.
|
* Constructor for DuplicateKeyException.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public DuplicateKeyException(String msg) {
|
public DuplicateKeyException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +45,7 @@ public class DuplicateKeyException extends DataIntegrityViolationException {
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
* @param cause the root cause from the data access API in use
|
* @param cause the root cause from the data access API in use
|
||||||
*/
|
*/
|
||||||
public DuplicateKeyException(String msg, Throwable cause) {
|
public DuplicateKeyException(@Nullable String msg, @Nullable Throwable cause) {
|
||||||
super(msg, cause);
|
super(msg, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
package org.springframework.dao;
|
package org.springframework.dao;
|
||||||
|
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data access exception thrown when a result was expected to have at least
|
* Data access exception thrown when a result was expected to have at least
|
||||||
* one row (or element) but zero rows (or elements) were actually returned.
|
* one row (or element) but zero rows (or elements) were actually returned.
|
||||||
|
@ -40,7 +42,7 @@ public class EmptyResultDataAccessException extends IncorrectResultSizeDataAcces
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
* @param expectedSize the expected result size
|
* @param expectedSize the expected result size
|
||||||
*/
|
*/
|
||||||
public EmptyResultDataAccessException(String msg, int expectedSize) {
|
public EmptyResultDataAccessException(@Nullable String msg, int expectedSize) {
|
||||||
super(msg, expectedSize, 0);
|
super(msg, expectedSize, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +52,7 @@ public class EmptyResultDataAccessException extends IncorrectResultSizeDataAcces
|
||||||
* @param expectedSize the expected result size
|
* @param expectedSize the expected result size
|
||||||
* @param ex the wrapped exception
|
* @param ex the wrapped exception
|
||||||
*/
|
*/
|
||||||
public EmptyResultDataAccessException(String msg, int expectedSize, Throwable ex) {
|
public EmptyResultDataAccessException(@Nullable String msg, int expectedSize, Throwable ex) {
|
||||||
super(msg, expectedSize, 0, ex);
|
super(msg, expectedSize, 0, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
package org.springframework.dao;
|
package org.springframework.dao;
|
||||||
|
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data access exception thrown when a result was not of the expected size,
|
* Data access exception thrown when a result was not of the expected size,
|
||||||
* for example when expecting a single row but getting 0 or more than 1 rows.
|
* for example when expecting a single row but getting 0 or more than 1 rows.
|
||||||
|
@ -71,7 +73,7 @@ public class IncorrectResultSizeDataAccessException extends DataRetrievalFailure
|
||||||
* @param expectedSize the expected result size
|
* @param expectedSize the expected result size
|
||||||
* @param ex the wrapped exception
|
* @param ex the wrapped exception
|
||||||
*/
|
*/
|
||||||
public IncorrectResultSizeDataAccessException(String msg, int expectedSize, Throwable ex) {
|
public IncorrectResultSizeDataAccessException(@Nullable String msg, int expectedSize, @Nullable Throwable ex) {
|
||||||
super(msg, ex);
|
super(msg, ex);
|
||||||
this.expectedSize = expectedSize;
|
this.expectedSize = expectedSize;
|
||||||
this.actualSize = -1;
|
this.actualSize = -1;
|
||||||
|
@ -83,7 +85,7 @@ public class IncorrectResultSizeDataAccessException extends DataRetrievalFailure
|
||||||
* @param expectedSize the expected result size
|
* @param expectedSize the expected result size
|
||||||
* @param actualSize the actual result size (or -1 if unknown)
|
* @param actualSize the actual result size (or -1 if unknown)
|
||||||
*/
|
*/
|
||||||
public IncorrectResultSizeDataAccessException(String msg, int expectedSize, int actualSize) {
|
public IncorrectResultSizeDataAccessException(@Nullable String msg, int expectedSize, int actualSize) {
|
||||||
super(msg);
|
super(msg);
|
||||||
this.expectedSize = expectedSize;
|
this.expectedSize = expectedSize;
|
||||||
this.actualSize = actualSize;
|
this.actualSize = actualSize;
|
||||||
|
@ -96,7 +98,7 @@ public class IncorrectResultSizeDataAccessException extends DataRetrievalFailure
|
||||||
* @param actualSize the actual result size (or -1 if unknown)
|
* @param actualSize the actual result size (or -1 if unknown)
|
||||||
* @param ex the wrapped exception
|
* @param ex the wrapped exception
|
||||||
*/
|
*/
|
||||||
public IncorrectResultSizeDataAccessException(String msg, int expectedSize, int actualSize, Throwable ex) {
|
public IncorrectResultSizeDataAccessException(@Nullable String msg, int expectedSize, int actualSize, @Nullable Throwable ex) {
|
||||||
super(msg, ex);
|
super(msg, ex);
|
||||||
this.expectedSize = expectedSize;
|
this.expectedSize = expectedSize;
|
||||||
this.actualSize = actualSize;
|
this.actualSize = actualSize;
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
package org.springframework.dao;
|
package org.springframework.dao;
|
||||||
|
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception thrown on incorrect usage of the API, such as failing to
|
* Exception thrown on incorrect usage of the API, such as failing to
|
||||||
* "compile" a query object that needed compilation before execution.
|
* "compile" a query object that needed compilation before execution.
|
||||||
|
@ -32,7 +34,7 @@ public class InvalidDataAccessApiUsageException extends NonTransientDataAccessEx
|
||||||
* Constructor for InvalidDataAccessApiUsageException.
|
* Constructor for InvalidDataAccessApiUsageException.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public InvalidDataAccessApiUsageException(String msg) {
|
public InvalidDataAccessApiUsageException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +43,7 @@ public class InvalidDataAccessApiUsageException extends NonTransientDataAccessEx
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
* @param cause the root cause from the data access API in use
|
* @param cause the root cause from the data access API in use
|
||||||
*/
|
*/
|
||||||
public InvalidDataAccessApiUsageException(String msg, Throwable cause) {
|
public InvalidDataAccessApiUsageException(@Nullable String msg, @Nullable Throwable cause) {
|
||||||
super(msg, cause);
|
super(msg, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
package org.springframework.dao;
|
package org.springframework.dao;
|
||||||
|
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Root for exceptions thrown when we use a data access resource incorrectly.
|
* Root for exceptions thrown when we use a data access resource incorrectly.
|
||||||
* Thrown for example on specifying bad SQL when using a RDBMS.
|
* Thrown for example on specifying bad SQL when using a RDBMS.
|
||||||
|
@ -30,7 +32,7 @@ public class InvalidDataAccessResourceUsageException extends NonTransientDataAcc
|
||||||
* Constructor for InvalidDataAccessResourceUsageException.
|
* Constructor for InvalidDataAccessResourceUsageException.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public InvalidDataAccessResourceUsageException(String msg) {
|
public InvalidDataAccessResourceUsageException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +41,7 @@ public class InvalidDataAccessResourceUsageException extends NonTransientDataAcc
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
* @param cause the root cause from the data access API in use
|
* @param cause the root cause from the data access API in use
|
||||||
*/
|
*/
|
||||||
public InvalidDataAccessResourceUsageException(String msg, Throwable cause) {
|
public InvalidDataAccessResourceUsageException(@Nullable String msg, @Nullable Throwable cause) {
|
||||||
super(msg, cause);
|
super(msg, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ public abstract class NonTransientDataAccessException extends DataAccessExceptio
|
||||||
* Constructor for NonTransientDataAccessException.
|
* Constructor for NonTransientDataAccessException.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public NonTransientDataAccessException(String msg) {
|
public NonTransientDataAccessException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class NonTransientDataAccessResourceException extends NonTransientDataAcc
|
||||||
* Constructor for NonTransientDataAccessResourceException.
|
* Constructor for NonTransientDataAccessResourceException.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public NonTransientDataAccessResourceException(String msg) {
|
public NonTransientDataAccessResourceException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ public class NonTransientDataAccessResourceException extends NonTransientDataAcc
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
* @param cause the root cause from the data access API in use
|
* @param cause the root cause from the data access API in use
|
||||||
*/
|
*/
|
||||||
public NonTransientDataAccessResourceException(String msg, @Nullable Throwable cause) {
|
public NonTransientDataAccessResourceException(@Nullable String msg, @Nullable Throwable cause) {
|
||||||
super(msg, cause);
|
super(msg, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class OptimisticLockingFailureException extends ConcurrencyFailureExcepti
|
||||||
* Constructor for OptimisticLockingFailureException.
|
* Constructor for OptimisticLockingFailureException.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public OptimisticLockingFailureException(String msg) {
|
public OptimisticLockingFailureException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ public class OptimisticLockingFailureException extends ConcurrencyFailureExcepti
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
* @param cause the root cause from the data access API in use
|
* @param cause the root cause from the data access API in use
|
||||||
*/
|
*/
|
||||||
public OptimisticLockingFailureException(String msg, @Nullable Throwable cause) {
|
public OptimisticLockingFailureException(@Nullable String msg, @Nullable Throwable cause) {
|
||||||
super(msg, cause);
|
super(msg, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
package org.springframework.dao;
|
package org.springframework.dao;
|
||||||
|
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception thrown on a pessimistic locking violation.
|
* Exception thrown on a pessimistic locking violation.
|
||||||
* Thrown by Spring's SQLException translation mechanism
|
* Thrown by Spring's SQLException translation mechanism
|
||||||
|
@ -37,7 +39,7 @@ public class PessimisticLockingFailureException extends ConcurrencyFailureExcept
|
||||||
* Constructor for PessimisticLockingFailureException.
|
* Constructor for PessimisticLockingFailureException.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public PessimisticLockingFailureException(String msg) {
|
public PessimisticLockingFailureException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +48,7 @@ public class PessimisticLockingFailureException extends ConcurrencyFailureExcept
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
* @param cause the root cause from the data access API in use
|
* @param cause the root cause from the data access API in use
|
||||||
*/
|
*/
|
||||||
public PessimisticLockingFailureException(String msg, Throwable cause) {
|
public PessimisticLockingFailureException(@Nullable String msg, @Nullable Throwable cause) {
|
||||||
super(msg, cause);
|
super(msg, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
package org.springframework.dao;
|
package org.springframework.dao;
|
||||||
|
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception to be thrown on a query timeout. This could have different causes depending on
|
* Exception to be thrown on a query timeout. This could have different causes depending on
|
||||||
* the database API in use but most likely thrown after the database interrupts or stops
|
* the database API in use but most likely thrown after the database interrupts or stops
|
||||||
|
@ -34,7 +36,7 @@ public class QueryTimeoutException extends TransientDataAccessException {
|
||||||
* Constructor for QueryTimeoutException.
|
* Constructor for QueryTimeoutException.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public QueryTimeoutException(String msg) {
|
public QueryTimeoutException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +45,7 @@ public class QueryTimeoutException extends TransientDataAccessException {
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
* @param cause the root cause from the data access API in use
|
* @param cause the root cause from the data access API in use
|
||||||
*/
|
*/
|
||||||
public QueryTimeoutException(String msg, Throwable cause) {
|
public QueryTimeoutException(@Nullable String msg, @Nullable Throwable cause) {
|
||||||
super(msg, cause);
|
super(msg, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ public abstract class TransientDataAccessException extends DataAccessException {
|
||||||
* Constructor for TransientDataAccessException.
|
* Constructor for TransientDataAccessException.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public TransientDataAccessException(String msg) {
|
public TransientDataAccessException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ public abstract class TransientDataAccessException extends DataAccessException {
|
||||||
* @param cause the root cause (usually from using an underlying
|
* @param cause the root cause (usually from using an underlying
|
||||||
* data access API such as JDBC)
|
* data access API such as JDBC)
|
||||||
*/
|
*/
|
||||||
public TransientDataAccessException(String msg, @Nullable Throwable cause) {
|
public TransientDataAccessException(@Nullable String msg, @Nullable Throwable cause) {
|
||||||
super(msg, cause);
|
super(msg, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
package org.springframework.dao;
|
package org.springframework.dao;
|
||||||
|
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception thrown on mismatch between Java type and database type:
|
* Exception thrown on mismatch between Java type and database type:
|
||||||
* for example on an attempt to set an object of the wrong type
|
* for example on an attempt to set an object of the wrong type
|
||||||
|
@ -30,7 +32,7 @@ public class TypeMismatchDataAccessException extends InvalidDataAccessResourceUs
|
||||||
* Constructor for TypeMismatchDataAccessException.
|
* Constructor for TypeMismatchDataAccessException.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
*/
|
*/
|
||||||
public TypeMismatchDataAccessException(String msg) {
|
public TypeMismatchDataAccessException(@Nullable String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +41,7 @@ public class TypeMismatchDataAccessException extends InvalidDataAccessResourceUs
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
* @param cause the root cause from the data access API in use
|
* @param cause the root cause from the data access API in use
|
||||||
*/
|
*/
|
||||||
public TypeMismatchDataAccessException(String msg, Throwable cause) {
|
public TypeMismatchDataAccessException(@Nullable String msg, @Nullable Throwable cause) {
|
||||||
super(msg, cause);
|
super(msg, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -132,6 +132,7 @@ public class LocalConnectionFactoryBean implements FactoryBean<Object>, Initiali
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public Class<?> getObjectType() {
|
public Class<?> getObjectType() {
|
||||||
return (this.connectionFactory != null ? this.connectionFactory.getClass() : null);
|
return (this.connectionFactory != null ? this.connectionFactory.getClass() : null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ import org.springframework.beans.factory.aot.BeanRegistrationAotProcessor;
|
||||||
import org.springframework.beans.factory.aot.BeanRegistrationCode;
|
import org.springframework.beans.factory.aot.BeanRegistrationCode;
|
||||||
import org.springframework.beans.factory.support.RegisteredBean;
|
import org.springframework.beans.factory.support.RegisteredBean;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
import org.springframework.core.annotation.MergedAnnotations;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
import org.springframework.util.ClassUtils;
|
import org.springframework.util.ClassUtils;
|
||||||
import org.springframework.util.ReflectionUtils;
|
import org.springframework.util.ReflectionUtils;
|
||||||
|
|
||||||
|
@ -46,6 +47,7 @@ class TransactionBeanRegistrationAotProcessor implements BeanRegistrationAotProc
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public BeanRegistrationAotContribution processAheadOfTime(RegisteredBean registeredBean) {
|
public BeanRegistrationAotContribution processAheadOfTime(RegisteredBean registeredBean) {
|
||||||
Class<?> beanClass = registeredBean.getBeanClass();
|
Class<?> beanClass = registeredBean.getBeanClass();
|
||||||
if (isTransactional(beanClass)) {
|
if (isTransactional(beanClass)) {
|
||||||
|
|
|
@ -21,6 +21,7 @@ import org.springframework.aot.hint.RuntimeHints;
|
||||||
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||||
import org.springframework.aot.hint.TypeHint;
|
import org.springframework.aot.hint.TypeHint;
|
||||||
import org.springframework.aot.hint.TypeReference;
|
import org.springframework.aot.hint.TypeReference;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link RuntimeHintsRegistrar} implementation that registers runtime hints for
|
* {@link RuntimeHintsRegistrar} implementation that registers runtime hints for
|
||||||
|
@ -33,7 +34,7 @@ import org.springframework.aot.hint.TypeReference;
|
||||||
class TransactionRuntimeHints implements RuntimeHintsRegistrar {
|
class TransactionRuntimeHints implements RuntimeHintsRegistrar {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
|
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
|
||||||
hints.reflection().registerTypes(TypeReference.listOf(Isolation.class, Propagation.class),
|
hints.reflection().registerTypes(TypeReference.listOf(Isolation.class, Propagation.class),
|
||||||
TypeHint.builtWith(MemberCategory.DECLARED_FIELDS));
|
TypeHint.builtWith(MemberCategory.DECLARED_FIELDS));
|
||||||
}
|
}
|
||||||
|
|
|
@ -788,19 +788,19 @@ public final class ContentDisposition {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder name(String name) {
|
public Builder name(@Nullable String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder filename(String filename) {
|
public Builder filename(@Nullable String filename) {
|
||||||
this.filename = filename;
|
this.filename = filename;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder filename(String filename, Charset charset) {
|
public Builder filename(@Nullable String filename, @Nullable Charset charset) {
|
||||||
this.filename = filename;
|
this.filename = filename;
|
||||||
this.charset = charset;
|
this.charset = charset;
|
||||||
return this;
|
return this;
|
||||||
|
@ -808,28 +808,28 @@ public final class ContentDisposition {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public Builder size(Long size) {
|
public Builder size(@Nullable Long size) {
|
||||||
this.size = size;
|
this.size = size;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public Builder creationDate(ZonedDateTime creationDate) {
|
public Builder creationDate(@Nullable ZonedDateTime creationDate) {
|
||||||
this.creationDate = creationDate;
|
this.creationDate = creationDate;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public Builder modificationDate(ZonedDateTime modificationDate) {
|
public Builder modificationDate(@Nullable ZonedDateTime modificationDate) {
|
||||||
this.modificationDate = modificationDate;
|
this.modificationDate = modificationDate;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public Builder readDate(ZonedDateTime readDate) {
|
public Builder readDate(@Nullable ZonedDateTime readDate) {
|
||||||
this.readDate = readDate;
|
this.readDate = readDate;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -301,7 +301,7 @@ public class ProblemDetail {
|
||||||
/**
|
/**
|
||||||
* Create a {@code ProblemDetail} instance with the given status and detail.
|
* Create a {@code ProblemDetail} instance with the given status and detail.
|
||||||
*/
|
*/
|
||||||
public static ProblemDetail forStatusAndDetail(HttpStatusCode status, String detail) {
|
public static ProblemDetail forStatusAndDetail(HttpStatusCode status, @Nullable String detail) {
|
||||||
Assert.notNull(status, "HttpStatusCode is required");
|
Assert.notNull(status, "HttpStatusCode is required");
|
||||||
ProblemDetail problemDetail = forStatus(status.value());
|
ProblemDetail problemDetail = forStatus(status.value());
|
||||||
problemDetail.setDetail(detail);
|
problemDetail.setDetail(detail);
|
||||||
|
|
|
@ -54,6 +54,7 @@ class ReadOnlyHttpHeaders extends HttpHeaders {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public MediaType getContentType() {
|
public MediaType getContentType() {
|
||||||
if (this.cachedContentType != null) {
|
if (this.cachedContentType != null) {
|
||||||
return this.cachedContentType;
|
return this.cachedContentType;
|
||||||
|
@ -83,6 +84,7 @@ class ReadOnlyHttpHeaders extends HttpHeaders {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public List<String> get(Object key) {
|
public List<String> get(Object key) {
|
||||||
List<String> values = this.headers.get(key);
|
List<String> values = this.headers.get(key);
|
||||||
return (values != null ? Collections.unmodifiableList(values) : null);
|
return (values != null ? Collections.unmodifiableList(values) : null);
|
||||||
|
|
|
@ -28,6 +28,7 @@ import org.springframework.core.io.buffer.DataBuffer;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.codec.json.AbstractJackson2Decoder;
|
import org.springframework.http.codec.json.AbstractJackson2Decoder;
|
||||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.util.MimeType;
|
import org.springframework.util.MimeType;
|
||||||
|
|
||||||
|
@ -53,7 +54,7 @@ public class Jackson2CborDecoder extends AbstractJackson2Decoder {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Flux<Object> decode(Publisher<DataBuffer> input, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) {
|
public Flux<Object> decode(Publisher<DataBuffer> input, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String, Object> hints) {
|
||||||
throw new UnsupportedOperationException("Does not support stream decoding yet");
|
throw new UnsupportedOperationException("Does not support stream decoding yet");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ import org.springframework.core.io.buffer.DataBufferFactory;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.codec.json.AbstractJackson2Encoder;
|
import org.springframework.http.codec.json.AbstractJackson2Encoder;
|
||||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.util.MimeType;
|
import org.springframework.util.MimeType;
|
||||||
|
|
||||||
|
@ -54,7 +55,8 @@ public class Jackson2CborEncoder extends AbstractJackson2Encoder {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Flux<DataBuffer> encode(Publisher<?> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) {
|
public Flux<DataBuffer> encode(Publisher<?> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType,
|
||||||
|
@Nullable MimeType mimeType, @Nullable Map<String, Object> hints) {
|
||||||
throw new UnsupportedOperationException("Does not support stream encoding yet");
|
throw new UnsupportedOperationException("Does not support stream encoding yet");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -300,6 +300,7 @@ public abstract class AbstractJackson2Decoder extends Jackson2CodecSupport imple
|
||||||
// Jackson2CodecSupport
|
// Jackson2CodecSupport
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
protected <A extends Annotation> A getAnnotation(MethodParameter parameter, Class<A> annotType) {
|
protected <A extends Annotation> A getAnnotation(MethodParameter parameter, Class<A> annotType) {
|
||||||
return parameter.getParameterAnnotation(annotType);
|
return parameter.getParameterAnnotation(annotType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -426,6 +426,7 @@ public abstract class AbstractJackson2Encoder extends Jackson2CodecSupport imple
|
||||||
// Jackson2CodecSupport
|
// Jackson2CodecSupport
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
protected <A extends Annotation> A getAnnotation(MethodParameter parameter, Class<A> annotType) {
|
protected <A extends Annotation> A getAnnotation(MethodParameter parameter, Class<A> annotType) {
|
||||||
return parameter.getMethodAnnotation(annotType);
|
return parameter.getMethodAnnotation(annotType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,6 +82,7 @@ public class ResourceHttpMessageConverter extends AbstractHttpMessageConverter<R
|
||||||
if (this.supportsReadStreaming && InputStreamResource.class == clazz) {
|
if (this.supportsReadStreaming && InputStreamResource.class == clazz) {
|
||||||
return new InputStreamResource(inputMessage.getBody()) {
|
return new InputStreamResource(inputMessage.getBody()) {
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public String getFilename() {
|
public String getFilename() {
|
||||||
return inputMessage.getHeaders().getContentDisposition().getFilename();
|
return inputMessage.getHeaders().getContentDisposition().getFilename();
|
||||||
}
|
}
|
||||||
|
|
|
@ -469,6 +469,7 @@ public class Jackson2ObjectMapperFactoryBean implements FactoryBean<ObjectMapper
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public Class<?> getObjectType() {
|
public Class<?> getObjectType() {
|
||||||
return (this.objectMapper != null ? this.objectMapper.getClass() : null);
|
return (this.objectMapper != null ? this.objectMapper.getClass() : null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ import org.springframework.aot.hint.MemberCategory;
|
||||||
import org.springframework.aot.hint.RuntimeHints;
|
import org.springframework.aot.hint.RuntimeHints;
|
||||||
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||||
import org.springframework.aot.hint.TypeHint.Builder;
|
import org.springframework.aot.hint.TypeHint.Builder;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link RuntimeHintsRegistrar} implementation that registers reflection entries
|
* {@link RuntimeHintsRegistrar} implementation that registers reflection entries
|
||||||
|
@ -38,7 +39,7 @@ class JacksonModulesRuntimeHints implements RuntimeHintsRegistrar {
|
||||||
.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS);
|
.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
|
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
|
||||||
hints.reflection()
|
hints.reflection()
|
||||||
.registerTypeIfPresent(classLoader,
|
.registerTypeIfPresent(classLoader,
|
||||||
"com.fasterxml.jackson.datatype.jdk8.Jdk8Module", asJacksonModule)
|
"com.fasterxml.jackson.datatype.jdk8.Jdk8Module", asJacksonModule)
|
||||||
|
|
|
@ -20,6 +20,7 @@ import org.springframework.aot.hint.BindingReflectionHintsRegistrar;
|
||||||
import org.springframework.aot.hint.RuntimeHints;
|
import org.springframework.aot.hint.RuntimeHints;
|
||||||
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||||
import org.springframework.http.ProblemDetail;
|
import org.springframework.http.ProblemDetail;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
import org.springframework.util.ClassUtils;
|
import org.springframework.util.ClassUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -33,7 +34,7 @@ import org.springframework.util.ClassUtils;
|
||||||
class ProblemDetailRuntimeHints implements RuntimeHintsRegistrar {
|
class ProblemDetailRuntimeHints implements RuntimeHintsRegistrar {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
|
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
|
||||||
BindingReflectionHintsRegistrar bindingRegistrar = new BindingReflectionHintsRegistrar();
|
BindingReflectionHintsRegistrar bindingRegistrar = new BindingReflectionHintsRegistrar();
|
||||||
bindingRegistrar.registerReflectionHints(hints.reflection(), ProblemDetail.class);
|
bindingRegistrar.registerReflectionHints(hints.reflection(), ProblemDetail.class);
|
||||||
if (ClassUtils.isPresent("com.fasterxml.jackson.dataformat.xml.XmlMapper", classLoader)) {
|
if (ClassUtils.isPresent("com.fasterxml.jackson.dataformat.xml.XmlMapper", classLoader)) {
|
||||||
|
|
|
@ -61,6 +61,7 @@ public class ServerHttpResponseDecorator implements ServerHttpResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public HttpStatusCode getStatusCode() {
|
public HttpStatusCode getStatusCode() {
|
||||||
return getDelegate().getStatusCode();
|
return getDelegate().getStatusCode();
|
||||||
}
|
}
|
||||||
|
@ -71,6 +72,7 @@ public class ServerHttpResponseDecorator implements ServerHttpResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Integer getRawStatusCode() {
|
public Integer getRawStatusCode() {
|
||||||
return getDelegate().getRawStatusCode();
|
return getDelegate().getRawStatusCode();
|
||||||
|
|
|
@ -26,6 +26,7 @@ import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.http.RequestEntity;
|
import org.springframework.http.RequestEntity;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
import org.springframework.web.service.invoker.HttpExchangeAdapter;
|
import org.springframework.web.service.invoker.HttpExchangeAdapter;
|
||||||
|
@ -70,6 +71,7 @@ public final class RestTemplateAdapter implements HttpExchangeAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public <T> T exchangeForBody(HttpRequestValues values, ParameterizedTypeReference<T> bodyType) {
|
public <T> T exchangeForBody(HttpRequestValues values, ParameterizedTypeReference<T> bodyType) {
|
||||||
return this.restTemplate.exchange(newRequest(values), bodyType).getBody();
|
return this.restTemplate.exchange(newRequest(values), bodyType).getBody();
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,6 +144,7 @@ public abstract class AbstractRefreshableWebApplicationContext extends AbstractR
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public String[] getConfigLocations() {
|
public String[] getConfigLocations() {
|
||||||
return super.getConfigLocations();
|
return super.getConfigLocations();
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,6 +84,7 @@ public abstract class AbstractMultipartHttpServletRequest extends HttpServletReq
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public MultipartFile getFile(String name) {
|
public MultipartFile getFile(String name) {
|
||||||
return getMultipartFiles().getFirst(name);
|
return getMultipartFiles().getFirst(name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ import java.util.stream.Collectors;
|
||||||
import org.springframework.context.MessageSource;
|
import org.springframework.context.MessageSource;
|
||||||
import org.springframework.context.MessageSourceResolvable;
|
import org.springframework.context.MessageSourceResolvable;
|
||||||
import org.springframework.context.support.StaticMessageSource;
|
import org.springframework.context.support.StaticMessageSource;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.validation.FieldError;
|
import org.springframework.validation.FieldError;
|
||||||
|
|
||||||
|
@ -114,6 +115,7 @@ public abstract class BindErrorUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
protected String getDefaultMessage(MessageSourceResolvable resolvable, Locale locale) {
|
protected String getDefaultMessage(MessageSourceResolvable resolvable, Locale locale) {
|
||||||
String message = super.getDefaultMessage(resolvable, locale);
|
String message = super.getDefaultMessage(resolvable, locale);
|
||||||
return (resolvable instanceof FieldError error ? error.getField() + ": " + message : message);
|
return (resolvable instanceof FieldError error ? error.getField() + ": " + message : message);
|
||||||
|
|
|
@ -19,6 +19,7 @@ package org.springframework.web.util;
|
||||||
import org.springframework.aot.hint.RuntimeHints;
|
import org.springframework.aot.hint.RuntimeHints;
|
||||||
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||||
import org.springframework.core.io.ClassPathResource;
|
import org.springframework.core.io.ClassPathResource;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link RuntimeHintsRegistrar} implementation that registers resource
|
* {@link RuntimeHintsRegistrar} implementation that registers resource
|
||||||
|
@ -30,7 +31,7 @@ import org.springframework.core.io.ClassPathResource;
|
||||||
class WebUtilRuntimeHints implements RuntimeHintsRegistrar {
|
class WebUtilRuntimeHints implements RuntimeHintsRegistrar {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
|
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
|
||||||
hints.resources().registerResource(
|
hints.resources().registerResource(
|
||||||
new ClassPathResource("HtmlCharacterEntityReferences.properties", getClass()));
|
new ClassPathResource("HtmlCharacterEntityReferences.properties", getClass()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -337,6 +337,7 @@ class DefaultServerRequest implements ServerRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public InetSocketAddress host() {
|
public InetSocketAddress host() {
|
||||||
return this.httpHeaders.getHost();
|
return this.httpHeaders.getHost();
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,6 +80,7 @@ public class ServerWebExchangeMethodArgumentResolver extends HandlerMethodArgume
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public Object resolveArgumentValue(
|
public Object resolveArgumentValue(
|
||||||
MethodParameter methodParameter, BindingContext context, ServerWebExchange exchange) {
|
MethodParameter methodParameter, BindingContext context, ServerWebExchange exchange) {
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ package org.springframework.web.reactive.socket.server.support;
|
||||||
import org.springframework.aot.hint.MemberCategory;
|
import org.springframework.aot.hint.MemberCategory;
|
||||||
import org.springframework.aot.hint.RuntimeHints;
|
import org.springframework.aot.hint.RuntimeHints;
|
||||||
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link RuntimeHintsRegistrar} implementation that registers reflection hints related to
|
* {@link RuntimeHintsRegistrar} implementation that registers reflection hints related to
|
||||||
|
@ -30,7 +31,7 @@ import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||||
class HandshakeWebSocketServiceRuntimeHints implements RuntimeHintsRegistrar {
|
class HandshakeWebSocketServiceRuntimeHints implements RuntimeHintsRegistrar {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
|
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
|
||||||
hints.reflection().registerType(HandshakeWebSocketService.initUpgradeStrategy().getClass(),
|
hints.reflection().registerType(HandshakeWebSocketService.initUpgradeStrategy().getClass(),
|
||||||
MemberCategory.INVOKE_DECLARED_CONSTRUCTORS);
|
MemberCategory.INVOKE_DECLARED_CONSTRUCTORS);
|
||||||
}
|
}
|
||||||
|
|
|
@ -378,6 +378,7 @@ class DefaultServerRequest implements ServerRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public InetSocketAddress host() {
|
public InetSocketAddress host() {
|
||||||
return this.httpHeaders.getHost();
|
return this.httpHeaders.getHost();
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ import org.springframework.aot.hint.ReflectionHints;
|
||||||
import org.springframework.aot.hint.RuntimeHints;
|
import org.springframework.aot.hint.RuntimeHints;
|
||||||
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||||
import org.springframework.aot.hint.TypeReference;
|
import org.springframework.aot.hint.TypeReference;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
import org.springframework.util.ClassUtils;
|
import org.springframework.util.ClassUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,7 +62,7 @@ class HandshakeHandlerRuntimeHints implements RuntimeHintsRegistrar {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
|
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
|
||||||
ReflectionHints reflectionHints = hints.reflection();
|
ReflectionHints reflectionHints = hints.reflection();
|
||||||
if (tomcatWsPresent) {
|
if (tomcatWsPresent) {
|
||||||
registerType(reflectionHints, "org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy");
|
registerType(reflectionHints, "org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy");
|
||||||
|
|
Loading…
Reference in New Issue