From 3d0f55273cf94f38735d818229a06d187b5af430 Mon Sep 17 00:00:00 2001 From: shin-mallang Date: Sat, 16 Sep 2023 05:33:53 +0900 Subject: [PATCH] Replace double spaces w/ single spaces in code & comments in spring-webmvc Except for meaningful double spaces (for example, to align the indentation of comments), this commit replaces all unnecessary double spaces with single spaces in the spring-webmvc module. Closes gh-31245 --- .../config/DefaultServletHandlerBeanDefinitionParser.java | 2 +- .../web/servlet/config/MvcNamespaceUtils.java | 6 +++--- .../web/servlet/function/RequestPredicates.java | 2 +- .../springframework/web/servlet/function/ServerRequest.java | 2 +- .../web/servlet/function/ServerResponse.java | 2 +- .../web/servlet/mvc/WebContentInterceptor.java | 2 +- .../web/servlet/mvc/condition/PatternsRequestCondition.java | 2 +- .../RedirectAttributesMethodArgumentResolver.java | 2 +- .../annotation/RequestAttributeMethodArgumentResolver.java | 2 +- .../method/annotation/ServletRequestDataBinderFactory.java | 2 +- .../mvc/support/DefaultHandlerExceptionResolver.java | 2 +- .../servlet/resource/DefaultServletHttpRequestHandler.java | 4 ++-- .../org/springframework/web/servlet/tags/HtmlEscapeTag.java | 2 +- .../java/org/springframework/web/servlet/tags/UrlTag.java | 6 +++--- .../web/servlet/tags/form/AbstractHtmlElementTag.java | 2 +- .../springframework/web/servlet/tags/form/OptionWriter.java | 2 +- .../web/servlet/view/json/MappingJackson2JsonView.java | 2 +- 17 files changed, 22 insertions(+), 22 deletions(-) diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/DefaultServletHandlerBeanDefinitionParser.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/DefaultServletHandlerBeanDefinitionParser.java index 572826053a52..4bbfe48966cf 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/DefaultServletHandlerBeanDefinitionParser.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/DefaultServletHandlerBeanDefinitionParser.java @@ -34,7 +34,7 @@ /** * {@link BeanDefinitionParser} that parses a {@code default-servlet-handler} element to - * register a {@link DefaultServletHttpRequestHandler}. Will also register a + * register a {@link DefaultServletHttpRequestHandler}. Will also register a * {@link SimpleUrlHandlerMapping} for mapping resource requests, and a * {@link HttpRequestHandlerAdapter}. * diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/MvcNamespaceUtils.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/MvcNamespaceUtils.java index fcf9054751e6..9e7d7d681aee 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/MvcNamespaceUtils.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/MvcNamespaceUtils.java @@ -131,7 +131,7 @@ else if (!context.getRegistry().isAlias(PATH_MATCHER_BEAN_NAME) && } /** - * Registers an {@link HttpRequestHandlerAdapter} under a well-known + * Registers an {@link HttpRequestHandlerAdapter} under a well-known * name unless already registered. */ private static void registerBeanNameUrlHandlerMapping(ParserContext context, @Nullable Object source) { @@ -148,7 +148,7 @@ private static void registerBeanNameUrlHandlerMapping(ParserContext context, @Nu } /** - * Registers an {@link HttpRequestHandlerAdapter} under a well-known + * Registers an {@link HttpRequestHandlerAdapter} under a well-known * name unless already registered. */ private static void registerHttpRequestHandlerAdapter(ParserContext context, @Nullable Object source) { @@ -203,7 +203,7 @@ else if (corsConfigurations != null) { } /** - * Registers an {@link HandlerMappingIntrospector} under a well-known name + * Registers an {@link HandlerMappingIntrospector} under a well-known name * unless already registered. */ private static void registerHandlerMappingIntrospector(ParserContext context, @Nullable Object source) { diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/function/RequestPredicates.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/function/RequestPredicates.java index 906dbcce7485..3f85ef5f2072 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/function/RequestPredicates.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/function/RequestPredicates.java @@ -1189,7 +1189,7 @@ public Optional checkNotModified(Instant lastModified, String et @Override public String toString() { - return method() + " " + path(); + return method() + " " + path(); } } diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/function/ServerRequest.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/function/ServerRequest.java index ced5bb0da39c..33d2e8a1e0ff 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/function/ServerRequest.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/function/ServerRequest.java @@ -501,7 +501,7 @@ interface Builder { /** * Add the given header value(s) under the given name. - * @param headerName the header name + * @param headerName the header name * @param headerValues the header value(s) * @return this builder * @see HttpHeaders#add(String, String) diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/function/ServerResponse.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/function/ServerResponse.java index 611072905f1e..bcffc381996d 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/function/ServerResponse.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/function/ServerResponse.java @@ -635,7 +635,7 @@ interface SseBuilder { /** * Register a callback to be invoked when an error occurs during SSE * processing. - * @param onError the callback to invoke on error + * @param onError the callback to invoke on error * @return this builder */ SseBuilder onError(Consumer onError); diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/WebContentInterceptor.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/WebContentInterceptor.java index 661b2ffd17d1..ce654923138b 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/WebContentInterceptor.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/WebContentInterceptor.java @@ -155,7 +155,7 @@ public void setPathMatcher(PathMatcher pathMatcher) { } /** - * Map settings for cache seconds to specific URL paths via patterns. + * Map settings for cache seconds to specific URL paths via patterns. *

Overrides the default cache seconds setting of this interceptor. * Can specify "-1" to exclude a URL path from default caching. *

For pattern syntax see {@link AntPathMatcher} and {@link PathPattern} diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/PatternsRequestCondition.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/PatternsRequestCondition.java index ea28749fe6a2..614e7f2ccd11 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/PatternsRequestCondition.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/PatternsRequestCondition.java @@ -80,7 +80,7 @@ public PatternsRequestCondition(String... patterns) { * {@link PathMatcher} and flag for matching trailing slashes. * @since 5.3 */ - public PatternsRequestCondition(String[] patterns, boolean useTrailingSlashMatch, + public PatternsRequestCondition(String[] patterns, boolean useTrailingSlashMatch, @Nullable PathMatcher pathMatcher) { this(patterns, null, pathMatcher, useTrailingSlashMatch); diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RedirectAttributesMethodArgumentResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RedirectAttributesMethodArgumentResolver.java index 74a893d520f8..23dece50411d 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RedirectAttributesMethodArgumentResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RedirectAttributesMethodArgumentResolver.java @@ -63,7 +63,7 @@ public Object resolveArgument(MethodParameter parameter, @Nullable ModelAndViewC redirectAttributes = new RedirectAttributesModelMap(dataBinder); } else { - redirectAttributes = new RedirectAttributesModelMap(); + redirectAttributes = new RedirectAttributesModelMap(); } mavContainer.setRedirectModel(redirectAttributes); return redirectAttributes; diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestAttributeMethodArgumentResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestAttributeMethodArgumentResolver.java index 9156c86f7277..e2294fe22ee3 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestAttributeMethodArgumentResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestAttributeMethodArgumentResolver.java @@ -57,7 +57,7 @@ protected Object resolveName(String name, MethodParameter parameter, NativeWebRe @Override protected void handleMissingValue(String name, MethodParameter parameter) throws ServletException { throw new ServletRequestBindingException("Missing request attribute '" + name + - "' of type " + parameter.getNestedParameterType().getSimpleName()); + "' of type " + parameter.getNestedParameterType().getSimpleName()); } } diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletRequestDataBinderFactory.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletRequestDataBinderFactory.java index e00a6a132481..72c4ba57b3f4 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletRequestDataBinderFactory.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletRequestDataBinderFactory.java @@ -49,7 +49,7 @@ public ServletRequestDataBinderFactory(@Nullable List bi */ @Override protected ServletRequestDataBinder createBinderInstance( - @Nullable Object target, String objectName, NativeWebRequest request) throws Exception { + @Nullable Object target, String objectName, NativeWebRequest request) throws Exception { return new ExtendedServletRequestDataBinder(target, objectName); } diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java index 7e5e69617954..fd1e520b3fa7 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java @@ -498,7 +498,7 @@ protected ModelAndView handleAsyncRequestTimeoutException(AsyncRequestTimeoutExc * Handle an {@link ErrorResponse} exception. *

The default implementation sets status and the headers of the response * to those obtained from the {@code ErrorResponse}. If available, the - * {@link ProblemDetail#getDetail()} is used as the message for + * {@link ProblemDetail#getDetail()} is used as the message for * {@link HttpServletResponse#sendError(int, String)}. * @param errorResponse the exception to be handled * @param request current HTTP request diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/DefaultServletHttpRequestHandler.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/DefaultServletHttpRequestHandler.java index ab68bbe6c53a..9ff4f27c8b4a 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/DefaultServletHttpRequestHandler.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/DefaultServletHttpRequestHandler.java @@ -35,7 +35,7 @@ * *

This handler is intended to be used with a "/*" mapping when the * {@link org.springframework.web.servlet.DispatcherServlet DispatcherServlet} - * is mapped to "/", thus overriding the Servlet container's default handling of static resources. + * is mapped to "/", thus overriding the Servlet container's default handling of static resources. * The mapping to this handler should generally be ordered as the last in the chain so that it will * only execute when no other more specific mappings (i.e., to controllers) can be matched. * @@ -45,7 +45,7 @@ * handler checks at initialization time for the presence of the default Servlet of well-known * containers such as Tomcat, Jetty, Resin, WebLogic and WebSphere. However, when running in a * container where the default Servlet's name is not known, or where it has been customized - * via server configuration, the {@code defaultServletName} will need to be set explicitly. + * via server configuration, the {@code defaultServletName} will need to be set explicitly. * * @author Jeremy Grelle * @author Juergen Hoeller diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/HtmlEscapeTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/HtmlEscapeTag.java index 0d4ba42e51f3..0c18d77370a1 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/HtmlEscapeTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/HtmlEscapeTag.java @@ -20,7 +20,7 @@ /** * The {@code } tag sets default HTML escape value for the current - * page. The actual value can be overridden by escaping-aware tags. + * page. The actual value can be overridden by escaping-aware tags. * The default is "false". * *

Note: You can also set a "defaultHtmlEscape" web.xml context-param. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/UrlTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/UrlTag.java index 421a50e3d9fb..d3062c94c715 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/UrlTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/UrlTag.java @@ -57,13 +57,13 @@ * string. * *

Use of the spring:param tag for URI template variables is strongly recommended - * over direct EL substitution as the values are URL encoded. Failure to properly + * over direct EL substitution as the values are URL encoded. Failure to properly * encode URL can leave an application vulnerable to XSS and other injection attacks. * *

URLs can be HTML/XML escaped by setting the {@link #setHtmlEscape(boolean) - * 'htmlEscape'} attribute to 'true'. Detects an HTML escaping setting, either on + * 'htmlEscape'} attribute to 'true'. Detects an HTML escaping setting, either on * this tag instance, the page level, or the {@code web.xml} level. The default - * is 'false'. When setting the URL value into a variable, escaping is not recommended. + * is 'false'. When setting the URL value into a variable, escaping is not recommended. * *

Example usage: *

<spring:url value="/url/path/{variableName}">
diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTag.java
index 11fd195246d2..2acad334a1d0 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTag.java
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTag.java
@@ -33,7 +33,7 @@
  * across elements.
  *
  * 

Additionally, this base class allows for rendering non-standard attributes - * as part of the tag's output. These attributes are accessible to subclasses if + * as part of the tag's output. These attributes are accessible to subclasses if * needed via the {@link AbstractHtmlElementTag#getDynamicAttributes() dynamicAttributes} * map. * diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/OptionWriter.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/OptionWriter.java index b8a02730d833..36242076ec58 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/OptionWriter.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/OptionWriter.java @@ -43,7 +43,7 @@ * the {@code labelProperty}). These properties are then used when * rendering each element of the array/{@link Collection} as an '{@code option}'. * If either property name is omitted, the value of {@link Object#toString()} of - * the corresponding array/{@link Collection} element is used instead. However, + * the corresponding array/{@link Collection} element is used instead. However, * if the item is an enum, {@link Enum#name()} is used as the default value. *

*

Using a {@link Map}:

diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java index ea7af86ad2e4..dab69ed53f91 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java @@ -38,7 +38,7 @@ * *

By default, the entire contents of the model map (with the exception of framework-specific classes) * will be encoded as JSON. If the model contains only one key, you can have it extracted encoded as JSON - * alone via {@link #setExtractValueFromSingleKeyModel}. + * alone via {@link #setExtractValueFromSingleKeyModel}. * *

The default constructor uses the default configuration provided by {@link Jackson2ObjectMapperBuilder}. *