Skip to content

Commit cf88100

Browse files
committed
Merge branch '6.1.x'
2 parents 88bc3f2 + a16e8c3 commit cf88100

31 files changed

+41
-2
lines changed

spring-webmvc/src/main/java/org/springframework/web/servlet/config/ResourcesBeanDefinitionParser.java

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class ResourcesBeanDefinitionParser implements BeanDefinitionParser {
8686

8787

8888
@Override
89+
@Nullable
8990
public BeanDefinition parse(Element element, ParserContext context) {
9091
Object source = context.extractSource(element);
9192

spring-webmvc/src/main/java/org/springframework/web/servlet/config/ViewControllerBeanDefinitionParser.java

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class ViewControllerBeanDefinitionParser implements BeanDefinitionParser {
6060

6161

6262
@Override
63+
@Nullable
6364
@SuppressWarnings("unchecked")
6465
public BeanDefinition parse(Element element, ParserContext parserContext) {
6566
Object source = parserContext.extractSource(element);

spring-webmvc/src/main/java/org/springframework/web/servlet/config/ViewResolversBeanDefinitionParser.java

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.springframework.beans.factory.xml.BeanDefinitionParser;
3030
import org.springframework.beans.factory.xml.ParserContext;
3131
import org.springframework.core.Ordered;
32+
import org.springframework.lang.Nullable;
3233
import org.springframework.util.xml.DomUtils;
3334
import org.springframework.web.servlet.view.BeanNameViewResolver;
3435
import org.springframework.web.servlet.view.ContentNegotiatingViewResolver;
@@ -68,6 +69,7 @@ public class ViewResolversBeanDefinitionParser implements BeanDefinitionParser {
6869

6970

7071
@Override
72+
@Nullable
7173
public BeanDefinition parse(Element element, ParserContext context) {
7274
Object source = context.extractSource(element);
7375
context.pushContainingComponent(new CompositeComponentDefinition(element.getTagName(), source));

spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurerComposite.java

+1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ public void addErrorResponseInterceptors(List<ErrorResponse.Interceptor> interce
168168
}
169169

170170
@Override
171+
@Nullable
171172
public Validator getValidator() {
172173
Validator selected = null;
173174
for (WebMvcConfigurer configurer : this.delegates) {

spring-webmvc/src/main/java/org/springframework/web/servlet/function/AbstractServerResponse.java

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public MultiValueMap<String, Cookie> cookies() {
8282
}
8383

8484
@Override
85+
@Nullable
8586
public ModelAndView writeTo(HttpServletRequest request, HttpServletResponse response,
8687
Context context) throws ServletException, IOException {
8788

spring-webmvc/src/main/java/org/springframework/web/servlet/function/DefaultEntityResponseBuilder.java

+3
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ public T entity() {
264264
}
265265

266266
@Override
267+
@Nullable
267268
protected ModelAndView writeToInternal(HttpServletRequest servletRequest,
268269
HttpServletResponse servletResponse, Context context)
269270
throws ServletException, IOException {
@@ -363,6 +364,7 @@ public CompletionStageEntityResponse(HttpStatusCode statusCode, HttpHeaders head
363364
}
364365

365366
@Override
367+
@Nullable
366368
protected ModelAndView writeToInternal(HttpServletRequest servletRequest, HttpServletResponse servletResponse,
367369
Context context) throws ServletException, IOException {
368370

@@ -416,6 +418,7 @@ public PublisherEntityResponse(HttpStatusCode statusCode, HttpHeaders headers,
416418
}
417419

418420
@Override
421+
@Nullable
419422
protected ModelAndView writeToInternal(HttpServletRequest servletRequest, HttpServletResponse servletResponse,
420423
Context context) throws ServletException, IOException {
421424

spring-webmvc/src/main/java/org/springframework/web/servlet/function/DefaultServerResponseBuilder.java

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.springframework.http.HttpMethod;
3636
import org.springframework.http.HttpStatusCode;
3737
import org.springframework.http.MediaType;
38+
import org.springframework.lang.Nullable;
3839
import org.springframework.util.Assert;
3940
import org.springframework.util.LinkedMultiValueMap;
4041
import org.springframework.util.MultiValueMap;
@@ -229,6 +230,7 @@ public WriteFunctionResponse(HttpStatusCode statusCode, HttpHeaders headers, Mul
229230
}
230231

231232
@Override
233+
@Nullable
232234
protected ModelAndView writeToInternal(HttpServletRequest request, HttpServletResponse response,
233235
Context context) throws Exception {
234236

spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodMapping.java

+2
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ protected boolean hasCorsConfigurationSource(Object handler) {
483483
}
484484

485485
@Override
486+
@Nullable
486487
protected CorsConfiguration getCorsConfiguration(Object handler, HttpServletRequest request) {
487488
CorsConfiguration corsConfig = super.getCorsConfiguration(handler, request);
488489
if (handler instanceof HandlerMethod handlerMethod) {
@@ -600,6 +601,7 @@ public List<T> getMappingsByDirectPath(String urlPath) {
600601
/**
601602
* Return handler methods by mapping name. Thread-safe for concurrent use.
602603
*/
604+
@Nullable
603605
public List<HandlerMethod> getHandlerMethodsByMappingName(String mappingName) {
604606
return this.nameLookup.get(mappingName);
605607
}

spring-webmvc/src/main/java/org/springframework/web/servlet/handler/HandlerMappingIntrospector.java

+2
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ public void setAttribute(String name, Object value) {
500500
}
501501

502502
@Override
503+
@Nullable
503504
public Object getAttribute(String name) {
504505
return this.attributes.get(name);
505506
}
@@ -532,6 +533,7 @@ private static class LookupPathMatchableHandlerMapping implements MatchableHandl
532533
}
533534

534535
@Override
536+
@Nullable
535537
public PathPatternParser getPatternParser() {
536538
return this.delegate.getPatternParser();
537539
}

spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/FixedLocaleResolver.java

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public Locale getLocale() {
8888
return getDefaultLocale();
8989
}
9090
@Override
91+
@Nullable
9192
public TimeZone getTimeZone() {
9293
return getDefaultTimeZone();
9394
}

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ParameterizableViewController.java

+1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ public boolean isStatusOnly() {
149149
* @see #getViewName()
150150
*/
151151
@Override
152+
@Nullable
152153
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
153154
throws Exception {
154155

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ServletForwardingController.java

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ public void setBeanName(String name) {
119119

120120

121121
@Override
122+
@Nullable
122123
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
123124
throws Exception {
124125

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ServletWrappingController.java

+1
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ public void afterPropertiesSet() throws Exception {
159159
* @see jakarta.servlet.Servlet#service(jakarta.servlet.ServletRequest, jakarta.servlet.ServletResponse)
160160
*/
161161
@Override
162+
@Nullable
162163
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
163164
throws Exception {
164165

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/ResponseStatusExceptionResolver.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class ResponseStatusExceptionResolver extends AbstractHandlerExceptionRes
6161

6262

6363
@Override
64-
public void setMessageSource(MessageSource messageSource) {
64+
public void setMessageSource(@Nullable MessageSource messageSource) {
6565
this.messageSource = messageSource;
6666
}
6767

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoHandlerMapping.java

+2
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ protected Set<String> getDirectPaths(RequestMappingInfo info) {
106106
* @return an info in case of a match; or {@code null} otherwise.
107107
*/
108108
@Override
109+
@Nullable
109110
protected RequestMappingInfo getMatchingMapping(RequestMappingInfo info, HttpServletRequest request) {
110111
return info.getMatchingCondition(request);
111112
}
@@ -243,6 +244,7 @@ private Map<String, MultiValueMap<String, String>> extractMatrixVariables(
243244
* but not by consumable/producible media types
244245
*/
245246
@Override
247+
@Nullable
246248
protected HandlerMethod handleNoMatch(
247249
Set<RequestMappingInfo> infos, String lookupPath, HttpServletRequest request) throws ServletException {
248250

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ContinuationHandlerMethodArgumentResolver.java

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public boolean supportsParameter(MethodParameter parameter) {
3737
}
3838

3939
@Override
40+
@Nullable
4041
public Object resolveArgument(MethodParameter parameter, @Nullable ModelAndViewContainer mavContainer,
4142
NativeWebRequest webRequest, @Nullable WebDataBinderFactory binderFactory) throws Exception {
4243

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ExtendedServletRequestDataBinder.java

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ private static class ExtendedServletRequestValueResolver extends ServletRequestV
112112
}
113113

114114
@Override
115+
@Nullable
115116
protected Object getRequestParameter(String name, Class<?> type) {
116117
Object value = super.getRequestParameter(name, type);
117118
if (value == null) {

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java

+1
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,7 @@ protected boolean supportsInternal(HandlerMethod handlerMethod) {
829829
}
830830

831831
@Override
832+
@Nullable
832833
protected ModelAndView handleInternal(HttpServletRequest request,
833834
HttpServletResponse response, HandlerMethod handlerMethod) throws Exception {
834835

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java

+2
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ private void updateConsumesCondition(RequestMappingInfo info, Method method) {
523523
}
524524

525525
@Override
526+
@Nullable
526527
public RequestMatchResult match(HttpServletRequest request, String pattern) {
527528
Assert.state(getPatternParser() == null, "This HandlerMapping uses PathPatterns.");
528529
RequestMappingInfo info = RequestMappingInfo.paths(pattern).options(this.config).build();
@@ -535,6 +536,7 @@ public RequestMatchResult match(HttpServletRequest request, String pattern) {
535536
}
536537

537538
@Override
539+
@Nullable
538540
protected CorsConfiguration initCorsConfiguration(Object handler, Method method, RequestMappingInfo mappingInfo) {
539541
HandlerMethod handlerMethod = createHandlerMethod(handler, method);
540542
Class<?> beanType = handlerMethod.getBeanType();

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessor.java

+2
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ public boolean supportsReturnType(MethodParameter returnType) {
142142
* converter to read the content with.
143143
*/
144144
@Override
145+
@Nullable
145146
public Object resolveArgument(MethodParameter parameter, @Nullable ModelAndViewContainer mavContainer,
146147
NativeWebRequest webRequest, @Nullable WebDataBinderFactory binderFactory) throws Exception {
147148

@@ -167,6 +168,7 @@ public Object resolveArgument(MethodParameter parameter, @Nullable ModelAndViewC
167168
}
168169

169170
@Override
171+
@Nullable
170172
protected <T> Object readWithMessageConverters(NativeWebRequest webRequest, MethodParameter parameter,
171173
Type paramType) throws IOException, HttpMediaTypeNotSupportedException, HttpMessageNotReadableException {
172174

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletInvocableHandlerMethod.java

+1
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ public MethodParameter getReturnValueType(@Nullable Object returnValue) {
253253
* Bridge to controller method-level annotations.
254254
*/
255255
@Override
256+
@Nullable
256257
public <A extends Annotation> A getMethodAnnotation(Class<A> annotationType) {
257258
return ServletInvocableHandlerMethod.this.getMethodAnnotation(annotationType);
258259
}

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletRequestMethodArgumentResolver.java

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public boolean supportsParameter(MethodParameter parameter) {
8585
}
8686

8787
@Override
88+
@Nullable
8889
public Object resolveArgument(MethodParameter parameter, @Nullable ModelAndViewContainer mavContainer,
8990
NativeWebRequest webRequest, @Nullable WebDataBinderFactory binderFactory) throws Exception {
9091

spring-webmvc/src/main/java/org/springframework/web/servlet/support/JspAwareRequestContext.java

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ protected Locale getFallbackLocale() {
9595
* request, session or application scope; if not found, returns {@code null}.
9696
*/
9797
@Override
98+
@Nullable
9899
protected TimeZone getFallbackTimeZone() {
99100
if (jstlPresent) {
100101
TimeZone timeZone = JstlPageLocaleResolver.getJstlTimeZone(getPageContext());

spring-webmvc/src/main/java/org/springframework/web/servlet/tags/MessageTag.java

+1
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ protected MessageSource getMessageSource() {
395395
/**
396396
* Return default exception message.
397397
*/
398+
@Nullable
398399
protected String getNoSuchMessageExceptionDescription(NoSuchMessageException ex) {
399400
return ex.getMessage();
400401
}

spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractMultiCheckedElementTag.java

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ public String getElement() {
180180
* since we're dealing with multiple HTML elements.
181181
*/
182182
@Override
183+
@Nullable
183184
protected String resolveId() throws JspException {
184185
Object id = evaluate("id", getId());
185186
if (id != null) {

spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/OptionTag.java

+1
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ private void renderOption(Object value, String label, TagWriter tagWriter) throw
364364
}
365365

366366
@Override
367+
@Nullable
367368
protected String autogenerateId() throws JspException {
368369
return null;
369370
}

spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/OptionsTag.java

+1
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ protected int writeTagContent(TagWriter tagWriter) throws JspException {
323323
* since we're dealing with multiple HTML elements.
324324
*/
325325
@Override
326+
@Nullable
326327
protected String resolveId() throws JspException {
327328
Object id = evaluate("id", getId());
328329
if (id != null) {

spring-webmvc/src/main/java/org/springframework/web/servlet/view/ResourceBundleViewResolver.java

+1
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ public void afterPropertiesSet() throws BeansException {
200200

201201

202202
@Override
203+
@Nullable
203204
protected View loadView(String viewName, Locale locale) throws Exception {
204205
BeanFactory factory = initFactory(locale);
205206
try {

spring-webmvc/src/main/java/org/springframework/web/servlet/view/UrlBasedViewResolver.java

+2
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ protected Object getCacheKey(String viewName, Locale locale) {
461461
* @see #requiredViewClass
462462
*/
463463
@Override
464+
@Nullable
464465
protected View createView(String viewName, Locale locale) throws Exception {
465466
// If this resolver is not supposed to handle the given view,
466467
// return null to pass on to the next resolver in the chain.
@@ -545,6 +546,7 @@ protected AbstractUrlBasedView instantiateView() {
545546
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet
546547
*/
547548
@Override
549+
@Nullable
548550
protected View loadView(String viewName, Locale locale) throws Exception {
549551
AbstractUrlBasedView view = buildView(viewName);
550552
View result = applyLifecycleMethods(viewName, view);

spring-webmvc/src/main/java/org/springframework/web/servlet/view/XmlViewResolver.java

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ protected Object getCacheKey(String viewName, Locale locale) {
119119
}
120120

121121
@Override
122+
@Nullable
122123
protected View loadView(String viewName, Locale locale) throws BeansException {
123124
BeanFactory factory = initFactory();
124125
try {

spring-webmvc/src/main/java/org/springframework/web/servlet/view/xslt/XsltView.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ protected Class<?>[] getSourceTypes() {
306306
* @return the adapted XSLT Source
307307
* @throws IllegalArgumentException if the given Object is not of a supported type
308308
*/
309-
protected Source convertSource(Object sourceObject) throws Exception {
309+
protected Source convertSource(@Nullable Object sourceObject) throws Exception {
310310
if (sourceObject instanceof Source source) {
311311
return source;
312312
}

0 commit comments

Comments
 (0)