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 572826053a..4bbfe48966 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 @@ import org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler /** * {@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 fcf9054751..9e7d7d681a 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 @@ public abstract class MvcNamespaceUtils { } /** - * 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 @@ public abstract class MvcNamespaceUtils { } /** - * 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 @@ public abstract class MvcNamespaceUtils { } /** - * 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 906dbcce74..3f85ef5f20 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 abstract class RequestPredicates { @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 ced5bb0da3..33d2e8a1e0 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 @@ public interface ServerRequest { /** * 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 611072905f..bcffc38199 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 @@ public interface ServerResponse { /** * 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 661b2ffd17..ce65492313 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 class WebContentInterceptor extends WebContentGenerator implements Handle } /** - * 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 ea28749fe6..614e7f2ccd 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 class PatternsRequestCondition extends AbstractRequestConditionThe 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 ab68bbe6c5..9ff4f27c8b 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 @@ import org.springframework.web.context.ServletContextAware; * *

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 @@ import org.springframework.web.context.ServletContextAware; * 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 0d4ba42e51..0c18d77370 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 @@ import jakarta.servlet.jsp.JspException; /** * 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 421a50e3d9..d3062c94c7 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 @@ import org.springframework.web.util.UriUtils; * 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 11fd195246..2acad334a1 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 @@ import org.springframework.util.StringUtils;
  * 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 b8a02730d8..36242076ec 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 @@ import org.springframework.web.servlet.support.BindStatus; * 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 ea7af86ad2..dab69ed53f 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 @@ import org.springframework.web.servlet.View; * *

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}. *