diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/NoSuchBeanDefinitionException.java b/spring-beans/src/main/java/org/springframework/beans/factory/NoSuchBeanDefinitionException.java index 0b9241c2f2..4197ce1482 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/NoSuchBeanDefinitionException.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/NoSuchBeanDefinitionException.java @@ -18,6 +18,7 @@ package org.springframework.beans.factory; import org.springframework.beans.BeansException; import org.springframework.core.ResolvableType; +import org.springframework.lang.Nullable; /** * Exception thrown when a {@code BeanFactory} is asked for a bean instance for which it @@ -100,6 +101,7 @@ public class NoSuchBeanDefinitionException extends BeansException { /** * Return the name of the missing bean, if it was a lookup by name that failed. */ + @Nullable public String getBeanName() { return this.beanName; } @@ -108,6 +110,7 @@ public class NoSuchBeanDefinitionException extends BeansException { * Return the required type of the missing bean, if it was a lookup by type * that failed. */ + @Nullable public Class getBeanType() { return (this.resolvableType != null ? this.resolvableType.resolve() : null); } @@ -117,6 +120,7 @@ public class NoSuchBeanDefinitionException extends BeansException { * by type that failed. * @since 4.3.4 */ + @Nullable public ResolvableType getResolvableType() { return this.resolvableType; } diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/UnsatisfiedDependencyException.java b/spring-beans/src/main/java/org/springframework/beans/factory/UnsatisfiedDependencyException.java index 957a87908c..83b6c1ddc1 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/UnsatisfiedDependencyException.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/UnsatisfiedDependencyException.java @@ -17,6 +17,7 @@ package org.springframework.beans.factory; import org.springframework.beans.BeansException; +import org.springframework.lang.Nullable; import org.springframework.util.StringUtils; /** @@ -42,7 +43,7 @@ public class UnsatisfiedDependencyException extends BeanCreationException { * @param msg the detail message */ public UnsatisfiedDependencyException( - String resourceDescription, String beanName, String propertyName, String msg) { + @Nullable String resourceDescription, @Nullable String beanName, String propertyName, String msg) { super(resourceDescription, beanName, "Unsatisfied dependency expressed through bean property '" + propertyName + "'" + @@ -57,7 +58,7 @@ public class UnsatisfiedDependencyException extends BeanCreationException { * @param ex the bean creation exception that indicated the unsatisfied dependency */ public UnsatisfiedDependencyException( - String resourceDescription, String beanName, String propertyName, BeansException ex) { + @Nullable String resourceDescription, @Nullable String beanName, String propertyName, BeansException ex) { this(resourceDescription, beanName, propertyName, ""); initCause(ex); @@ -72,7 +73,7 @@ public class UnsatisfiedDependencyException extends BeanCreationException { * @since 4.3 */ public UnsatisfiedDependencyException( - String resourceDescription, String beanName, InjectionPoint injectionPoint, String msg) { + @Nullable String resourceDescription, @Nullable String beanName, @Nullable InjectionPoint injectionPoint, String msg) { super(resourceDescription, beanName, "Unsatisfied dependency expressed through " + injectionPoint + @@ -89,7 +90,7 @@ public class UnsatisfiedDependencyException extends BeanCreationException { * @since 4.3 */ public UnsatisfiedDependencyException( - String resourceDescription, String beanName, InjectionPoint injectionPoint, BeansException ex) { + @Nullable String resourceDescription, @Nullable String beanName, @Nullable InjectionPoint injectionPoint, BeansException ex) { this(resourceDescription, beanName, injectionPoint, ""); initCause(ex); @@ -100,6 +101,7 @@ public class UnsatisfiedDependencyException extends BeanCreationException { * Return the injection point (field or method/constructor parameter), if known. * @since 4.3 */ + @Nullable public InjectionPoint getInjectionPoint() { return this.injectionPoint; } diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/ConfigurableListableBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/ConfigurableListableBeanFactory.java index 3b3f510d58..8899a904c4 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/config/ConfigurableListableBeanFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/ConfigurableListableBeanFactory.java @@ -21,6 +21,7 @@ import java.util.Iterator; import org.springframework.beans.BeansException; import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.beans.factory.NoSuchBeanDefinitionException; +import org.springframework.lang.Nullable; /** * Configuration interface to be implemented by most listable bean factories. @@ -105,7 +106,7 @@ public interface ConfigurableListableBeanFactory * @throws NoSuchBeanDefinitionException if there is no bean with the given name * defined in this factory */ - BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefinitionException; + BeanDefinition getBeanDefinition(@Nullable String beanName) throws NoSuchBeanDefinitionException; /** * Return a unified view over all bean names managed by this factory. diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java index 8e0317c729..7f07b414df 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java @@ -1738,7 +1738,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp * @see ChildBeanDefinition * @see org.springframework.beans.factory.config.ConfigurableListableBeanFactory#getBeanDefinition */ - protected abstract BeanDefinition getBeanDefinition(String beanName) throws BeansException; + protected abstract BeanDefinition getBeanDefinition(@Nullable String beanName) throws BeansException; /** * Create a bean instance for the given merged bean definition (and arguments). diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionRegistry.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionRegistry.java index 326e1fb58c..ba96f93dcb 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionRegistry.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionRegistry.java @@ -20,6 +20,7 @@ import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.core.AliasRegistry; +import org.springframework.lang.Nullable; /** * Interface for registries that hold bean definitions, for example RootBeanDefinition @@ -74,7 +75,7 @@ public interface BeanDefinitionRegistry extends AliasRegistry { * @return the BeanDefinition for the given name (never {@code null}) * @throws NoSuchBeanDefinitionException if there is no such bean definition */ - BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefinitionException; + BeanDefinition getBeanDefinition(@Nullable String beanName) throws NoSuchBeanDefinitionException; /** * Check if this registry contains a bean definition with the given name. diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java index e1666ed6fa..0f6f9d102c 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java @@ -195,7 +195,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto * Specify an id for serialization purposes, allowing this BeanFactory to be * deserialized from this id back into the BeanFactory object, if needed. */ - public void setSerializationId(String serializationId) { + public void setSerializationId(@Nullable String serializationId) { if (serializationId != null) { serializableFactories.put(serializationId, new WeakReference<>(this)); } @@ -671,7 +671,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto } @Override - public BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefinitionException { + public BeanDefinition getBeanDefinition(@Nullable String beanName) throws NoSuchBeanDefinitionException { BeanDefinition bd = this.beanDefinitionMap.get(beanName); if (bd == null) { if (this.logger.isTraceEnabled()) { diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java index f36eec10b3..01c0ae2623 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java @@ -117,7 +117,7 @@ public class RootBeanDefinition extends AbstractBeanDefinition { * @param beanClass the class of the bean to instantiate * @see #setBeanClass */ - public RootBeanDefinition(Class beanClass) { + public RootBeanDefinition(@Nullable Class beanClass) { super(); setBeanClass(beanClass); } @@ -131,7 +131,7 @@ public class RootBeanDefinition extends AbstractBeanDefinition { * @since 5.0 * @see #setInstanceSupplier */ - public RootBeanDefinition(Class beanClass, Supplier instanceSupplier) { + public RootBeanDefinition(@Nullable Class beanClass, @Nullable Supplier instanceSupplier) { super(); setBeanClass(beanClass); setInstanceSupplier(instanceSupplier); @@ -147,7 +147,7 @@ public class RootBeanDefinition extends AbstractBeanDefinition { * @since 5.0 * @see #setInstanceSupplier */ - public RootBeanDefinition(Class beanClass, String scope, Supplier instanceSupplier) { + public RootBeanDefinition(@Nullable Class beanClass, String scope, @Nullable Supplier instanceSupplier) { super(); setBeanClass(beanClass); setScope(scope); @@ -162,7 +162,7 @@ public class RootBeanDefinition extends AbstractBeanDefinition { * @param dependencyCheck whether to perform a dependency check for objects * (not applicable to autowiring a constructor, thus ignored there) */ - public RootBeanDefinition(Class beanClass, int autowireMode, boolean dependencyCheck) { + public RootBeanDefinition(@Nullable Class beanClass, int autowireMode, boolean dependencyCheck) { super(); setBeanClass(beanClass); setAutowireMode(autowireMode); @@ -178,7 +178,7 @@ public class RootBeanDefinition extends AbstractBeanDefinition { * @param cargs the constructor argument values to apply * @param pvs the property values to apply */ - public RootBeanDefinition(Class beanClass, ConstructorArgumentValues cargs, MutablePropertyValues pvs) { + public RootBeanDefinition(@Nullable Class beanClass, ConstructorArgumentValues cargs, MutablePropertyValues pvs) { super(cargs, pvs); setBeanClass(beanClass); } diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleBeanDefinitionRegistry.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleBeanDefinitionRegistry.java index 6bcde141a7..623c318114 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleBeanDefinitionRegistry.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleBeanDefinitionRegistry.java @@ -23,6 +23,7 @@ import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.core.SimpleAliasRegistry; +import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -57,7 +58,7 @@ public class SimpleBeanDefinitionRegistry extends SimpleAliasRegistry implements } @Override - public BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefinitionException { + public BeanDefinition getBeanDefinition(@Nullable String beanName) throws NoSuchBeanDefinitionException { BeanDefinition bd = this.beanDefinitionMap.get(beanName); if (bd == null) { throw new NoSuchBeanDefinitionException(beanName); diff --git a/spring-context/src/main/java/org/springframework/context/support/GenericApplicationContext.java b/spring-context/src/main/java/org/springframework/context/support/GenericApplicationContext.java index f02d4f8ced..6c73686707 100644 --- a/spring-context/src/main/java/org/springframework/context/support/GenericApplicationContext.java +++ b/spring-context/src/main/java/org/springframework/context/support/GenericApplicationContext.java @@ -330,7 +330,7 @@ public class GenericApplicationContext extends AbstractApplicationContext implem } @Override - public BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefinitionException { + public BeanDefinition getBeanDefinition(@Nullable String beanName) throws NoSuchBeanDefinitionException { return this.beanFactory.getBeanDefinition(beanName); } diff --git a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java index fa9d6b0bca..e40e813e03 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java @@ -231,7 +231,7 @@ public abstract class AnnotationUtils { * @see AnnotatedElement#getAnnotations() */ @Nullable - public static Annotation[] getAnnotations(AnnotatedElement annotatedElement) { + public static Annotation[] getAnnotations(@Nullable AnnotatedElement annotatedElement) { try { return synthesizeAnnotationArray(annotatedElement.getAnnotations(), annotatedElement); } @@ -1441,7 +1441,7 @@ public abstract class AnnotationUtils { } @SuppressWarnings("unchecked") - static A synthesizeAnnotation(A annotation, Object annotatedElement) { + static A synthesizeAnnotation(A annotation, @Nullable Object annotatedElement) { if (annotation == null) { return null; } @@ -1548,8 +1548,7 @@ public abstract class AnnotationUtils { * @see #synthesizeAnnotation(Annotation, AnnotatedElement) * @see #synthesizeAnnotation(Map, Class, AnnotatedElement) */ - @Nullable - static Annotation[] synthesizeAnnotationArray(@Nullable Annotation[] annotations, @Nullable Object annotatedElement) { + static Annotation[] synthesizeAnnotationArray(Annotation[] annotations, @Nullable Object annotatedElement) { if (annotations == null) { return null; } diff --git a/spring-core/src/main/java/org/springframework/core/env/PropertySourcesPropertyResolver.java b/spring-core/src/main/java/org/springframework/core/env/PropertySourcesPropertyResolver.java index 424b2be498..424ea518d0 100644 --- a/spring-core/src/main/java/org/springframework/core/env/PropertySourcesPropertyResolver.java +++ b/spring-core/src/main/java/org/springframework/core/env/PropertySourcesPropertyResolver.java @@ -38,7 +38,7 @@ public class PropertySourcesPropertyResolver extends AbstractPropertyResolver { * Create a new resolver against the given property sources. * @param propertySources the set of {@link PropertySource} objects to use */ - public PropertySourcesPropertyResolver(PropertySources propertySources) { + public PropertySourcesPropertyResolver(@Nullable PropertySources propertySources) { this.propertySources = propertySources; } diff --git a/spring-core/src/main/java/org/springframework/lang/NonNullApi.java b/spring-core/src/main/java/org/springframework/lang/NonNullApi.java index ae95ebfa13..7c06b2dbde 100644 --- a/spring-core/src/main/java/org/springframework/lang/NonNullApi.java +++ b/spring-core/src/main/java/org/springframework/lang/NonNullApi.java @@ -18,6 +18,7 @@ import javax.annotation.meta.TypeQualifierDefault; * * @author Sebastien Deleuze * @since 5.0 + * @see NonNull * @see javax.annotation.Nonnull */ @Documented diff --git a/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java b/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java index 976b997148..33d6b0c328 100644 --- a/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java +++ b/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java @@ -140,7 +140,8 @@ public abstract class ReflectionUtils { * @param target the target object from which to get the field * @return the field's current value */ - public static Object getField(Field field, Object target) { + @Nullable + public static Object getField(Field field, @Nullable Object target) { try { return field.get(target); } diff --git a/spring-core/src/main/java/org/springframework/util/StringUtils.java b/spring-core/src/main/java/org/springframework/util/StringUtils.java index 1cf25b3775..37e41dc8c9 100644 --- a/spring-core/src/main/java/org/springframework/util/StringUtils.java +++ b/spring-core/src/main/java/org/springframework/util/StringUtils.java @@ -978,7 +978,7 @@ public abstract class StringUtils { * @param array the original {@code String} array * @return the resulting array (of the same size) with trimmed elements */ - public static String[] trimArrayElements(String[] array) { + public static String[] trimArrayElements(@Nullable String[] array) { if (ObjectUtils.isEmpty(array)) { return new String[0]; } diff --git a/spring-web/src/main/java/org/springframework/web/context/WebApplicationContext.java b/spring-web/src/main/java/org/springframework/web/context/WebApplicationContext.java index 92ac80c1b5..ef137630c4 100644 --- a/spring-web/src/main/java/org/springframework/web/context/WebApplicationContext.java +++ b/spring-web/src/main/java/org/springframework/web/context/WebApplicationContext.java @@ -19,6 +19,7 @@ package org.springframework.web.context; import javax.servlet.ServletContext; import org.springframework.context.ApplicationContext; +import org.springframework.lang.Nullable; /** * Interface to provide configuration for a web application. This is read-only while @@ -100,6 +101,7 @@ public interface WebApplicationContext extends ApplicationContext { * Return the standard Servlet API ServletContext for this application. *

Also available for a Portlet application, in addition to the PortletContext. */ + @Nullable ServletContext getServletContext(); } diff --git a/spring-web/src/main/java/org/springframework/web/util/HtmlUtils.java b/spring-web/src/main/java/org/springframework/web/util/HtmlUtils.java index 3546efd130..f14a28945b 100644 --- a/spring-web/src/main/java/org/springframework/web/util/HtmlUtils.java +++ b/spring-web/src/main/java/org/springframework/web/util/HtmlUtils.java @@ -16,6 +16,7 @@ package org.springframework.web.util; +import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** @@ -58,7 +59,7 @@ public abstract class HtmlUtils { * @param input the (unescaped) input string * @return the escaped string */ - public static String htmlEscape(String input) { + public static String htmlEscape(@Nullable String input) { return htmlEscape(input, WebUtils.DEFAULT_CHARACTER_ENCODING); } @@ -78,7 +79,7 @@ public abstract class HtmlUtils { * @return the escaped string * @since 4.1.2 */ - public static String htmlEscape(String input, String encoding) { + public static String htmlEscape(@Nullable String input, String encoding) { Assert.notNull(encoding, "Encoding is required"); if (input == null) { return null; @@ -109,7 +110,7 @@ public abstract class HtmlUtils { * @param input the (unescaped) input string * @return the escaped string */ - public static String htmlEscapeDecimal(String input) { + public static String htmlEscapeDecimal(@Nullable String input) { return htmlEscapeDecimal(input, WebUtils.DEFAULT_CHARACTER_ENCODING); } @@ -129,7 +130,7 @@ public abstract class HtmlUtils { * @return the escaped string * @since 4.1.2 */ - public static String htmlEscapeDecimal(String input, String encoding) { + public static String htmlEscapeDecimal(@Nullable String input, String encoding) { Assert.notNull(encoding, "Encoding is required"); if (input == null) { return null; @@ -161,7 +162,7 @@ public abstract class HtmlUtils { * @param input the (unescaped) input string * @return the escaped string */ - public static String htmlEscapeHex(String input) { + public static String htmlEscapeHex(@Nullable String input) { return htmlEscapeHex(input, WebUtils.DEFAULT_CHARACTER_ENCODING); } @@ -181,7 +182,7 @@ public abstract class HtmlUtils { * @return the escaped string * @since 4.1.2 */ - public static String htmlEscapeHex(String input, String encoding) { + public static String htmlEscapeHex(@Nullable String input, String encoding) { Assert.notNull(encoding, "Encoding is required"); if (input == null) { return null; @@ -220,7 +221,7 @@ public abstract class HtmlUtils { * @param input the (escaped) input string * @return the unescaped string */ - public static String htmlUnescape(String input) { + public static String htmlUnescape(@Nullable String input) { if (input == null) { return null; } diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/RequestMappingInfo.java b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/RequestMappingInfo.java index 3741b94a45..1b0e5d6188 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/RequestMappingInfo.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/RequestMappingInfo.java @@ -69,9 +69,9 @@ public final class RequestMappingInfo implements RequestCondition custom) { + public RequestMappingInfo(@Nullable String name, @Nullable PatternsRequestCondition patterns, @Nullable RequestMethodsRequestCondition methods, + @Nullable ParamsRequestCondition params, @Nullable HeadersRequestCondition headers, @Nullable ConsumesRequestCondition consumes, + @Nullable ProducesRequestCondition produces, @Nullable RequestCondition custom) { this.name = (StringUtils.hasText(name) ? name : null); this.patternsCondition = (patterns != null ? patterns : new PatternsRequestCondition()); @@ -86,9 +86,9 @@ public final class RequestMappingInfo implements RequestCondition custom) { + public RequestMappingInfo(@Nullable PatternsRequestCondition patterns, @Nullable RequestMethodsRequestCondition methods, + @Nullable ParamsRequestCondition params, @Nullable HeadersRequestCondition headers, @Nullable ConsumesRequestCondition consumes, + @Nullable ProducesRequestCondition produces, @Nullable RequestCondition custom) { this(null, patterns, methods, params, headers, consumes, produces, custom); } @@ -96,7 +96,7 @@ public final class RequestMappingInfo implements RequestCondition customRequestCondition) { + public RequestMappingInfo(RequestMappingInfo info, @Nullable RequestCondition customRequestCondition) { this(info.name, info.patternsCondition, info.methodsCondition, info.paramsCondition, info.headersCondition, info.consumesCondition, info.producesCondition, customRequestCondition); } diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExecutionChain.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExecutionChain.java index 45a6f740a2..8ac5f38e42 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExecutionChain.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExecutionChain.java @@ -54,7 +54,7 @@ public class HandlerExecutionChain { * Create a new HandlerExecutionChain. * @param handler the handler object to execute */ - public HandlerExecutionChain(Object handler) { + public HandlerExecutionChain(@Nullable Object handler) { this(handler, (HandlerInterceptor[]) null); } @@ -64,7 +64,7 @@ public class HandlerExecutionChain { * @param interceptors the array of interceptors to apply * (in the given order) before the handler itself executes */ - public HandlerExecutionChain(Object handler, HandlerInterceptor... interceptors) { + public HandlerExecutionChain(@Nullable Object handler, HandlerInterceptor... interceptors) { if (handler instanceof HandlerExecutionChain) { HandlerExecutionChain originalChain = (HandlerExecutionChain) handler; this.handler = originalChain.getHandler(); diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/RequestMappingInfo.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/RequestMappingInfo.java index 2f6670c195..693a6d855b 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/RequestMappingInfo.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/RequestMappingInfo.java @@ -71,9 +71,9 @@ public final class RequestMappingInfo implements RequestCondition custom) { + public RequestMappingInfo(@Nullable String name, @Nullable PatternsRequestCondition patterns, @Nullable RequestMethodsRequestCondition methods, + @Nullable ParamsRequestCondition params, @Nullable HeadersRequestCondition headers, @Nullable ConsumesRequestCondition consumes, + @Nullable ProducesRequestCondition produces, @Nullable RequestCondition custom) { this.name = (StringUtils.hasText(name) ? name : null); this.patternsCondition = (patterns != null ? patterns : new PatternsRequestCondition()); @@ -88,9 +88,9 @@ public final class RequestMappingInfo implements RequestCondition custom) { + public RequestMappingInfo(@Nullable PatternsRequestCondition patterns, @Nullable RequestMethodsRequestCondition methods, + @Nullable ParamsRequestCondition params, @Nullable HeadersRequestCondition headers, @Nullable ConsumesRequestCondition consumes, + @Nullable ProducesRequestCondition produces, @Nullable RequestCondition custom) { this(null, patterns, methods, params, headers, consumes, produces, custom); } @@ -98,7 +98,7 @@ public final class RequestMappingInfo implements RequestCondition customRequestCondition) { + public RequestMappingInfo(RequestMappingInfo info, @Nullable RequestCondition customRequestCondition) { this(info.name, info.patternsCondition, info.methodsCondition, info.paramsCondition, info.headersCondition, info.consumesCondition, info.producesCondition, customRequestCondition); }