Browse Source

Remove duplicate words in Java source code

Discovered using regular expression: \b(\w+)\s+\1\b[^(}]
pull/35405/head
Sam Brannen 8 months ago
parent
commit
a22d204681
  1. 4
      spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverrides.java
  2. 4
      spring-beans/src/main/java/org/springframework/beans/factory/support/MethodReplacer.java
  3. 8
      spring-beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java
  4. 4
      spring-context/src/main/java/org/springframework/validation/method/MethodValidationResult.java
  5. 2
      spring-test/src/test/java/org/springframework/test/context/bean/override/mockito/MockitoBeanOverrideHandlerTests.java
  6. 4
      spring-web/src/main/java/org/springframework/web/context/ContextLoaderListener.java
  7. 24
      spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctions.java
  8. 24
      spring-webmvc/src/main/java/org/springframework/web/servlet/function/RouterFunctions.java
  9. 8
      spring-webmvc/src/main/java/org/springframework/web/servlet/function/ServerResponse.java
  10. 2
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitterReturnValueHandler.java

4
spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverrides.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -87,7 +87,7 @@ public class MethodOverrides { @@ -87,7 +87,7 @@ public class MethodOverrides {
/**
* Return the override for the given method, if any.
* @param method method to check for overrides for
* @param method the method to check for overrides for
* @return the method override, or {@code null} if none
*/
@Nullable

4
spring-beans/src/main/java/org/springframework/beans/factory/support/MethodReplacer.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -35,7 +35,7 @@ public interface MethodReplacer { @@ -35,7 +35,7 @@ public interface MethodReplacer {
* @param obj the instance we're reimplementing the method for
* @param method the method to reimplement
* @param args arguments to the method
* @return return value for the method
* @return the return value for the method
*/
Object reimplement(Object obj, Method method, Object[] args) throws Throwable;

8
spring-beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -405,10 +405,10 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader @@ -405,10 +405,10 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader
/**
* Get all property values, given a prefix (which will be stripped)
* and add the bean they define to the factory with the given name.
* @param beanName name of the bean to define
* @param beanName the name of the bean to define
* @param map a Map containing string pairs
* @param prefix prefix of each entry, which will be stripped
* @param resourceDescription description of the resource that the
* @param prefix the prefix of each entry, which will be stripped
* @param resourceDescription the description of the resource that the
* Map came from (for logging purposes)
* @throws BeansException if the bean definition could not be parsed or registered
*/

4
spring-context/src/main/java/org/springframework/validation/method/MethodValidationResult.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -87,7 +87,7 @@ public interface MethodValidationResult { @@ -87,7 +87,7 @@ public interface MethodValidationResult {
* on their fields and properties.
* @see #getValueResults()
* @see #getBeanResults()
* @deprecated deprecated in favor of {@link #getParameterValidationResults()}
* @deprecated As of Spring Framework 6.2, in favor of {@link #getParameterValidationResults()}
*/
@Deprecated(since = "6.2", forRemoval = true)
default List<ParameterValidationResult> getAllValidationResults() {

2
spring-test/src/test/java/org/springframework/test/context/bean/override/mockito/MockitoBeanOverrideHandlerTests.java

@ -126,7 +126,7 @@ class MockitoBeanOverrideHandlerTests { @@ -126,7 +126,7 @@ class MockitoBeanOverrideHandlerTests {
/**
* Since the "field name as fallback qualifier" is not available for an annotated class,
* what would seem to be "equivalent" handlers are actually not considered "equal" when
* the the lookup is "by type".
* the lookup is "by type".
*/
@Test // gh-33925
void isNotEqualToWithSameByTypeLookupMetadataFromFieldAndClassLevel() {

4
spring-web/src/main/java/org/springframework/web/context/ContextLoaderListener.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -91,7 +91,7 @@ public class ContextLoaderListener extends ContextLoader implements ServletConte @@ -91,7 +91,7 @@ public class ContextLoaderListener extends ContextLoader implements ServletConte
* <li>{@code ServletContext} and {@code ServletConfig} objects will be delegated to
* the application context</li>
* <li>{@link #customizeContext} will be called</li>
* <li>Any {@link org.springframework.context.ApplicationContextInitializer ApplicationContextInitializer org.springframework.context.ApplicationContextInitializer ApplicationContextInitializers}
* <li>Any {@link org.springframework.context.ApplicationContextInitializer ApplicationContextInitializers}
* specified through the "contextInitializerClasses" init-param will be applied.</li>
* <li>{@link org.springframework.context.ConfigurableApplicationContext#refresh refresh()} will be called</li>
* </ul>

24
spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctions.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -153,7 +153,7 @@ public abstract class RouterFunctions { @@ -153,7 +153,7 @@ public abstract class RouterFunctions {
* Resource resource = new ClassPathResource("static/index.html")
* RouterFunction&lt;ServerResponse&gt; resources = RouterFunctions.resource(path("/api/**").negate(), resource);
* </pre>
* @param predicate predicate to match
* @param predicate the predicate to match
* @param resource the resources to serve
* @return a router function that routes to a resource
* @since 6.1.4
@ -169,7 +169,7 @@ public abstract class RouterFunctions { @@ -169,7 +169,7 @@ public abstract class RouterFunctions {
* Resource resource = new ClassPathResource("static/index.html")
* RouterFunction&lt;ServerResponse&gt; resources = RouterFunctions.resource(path("/api/**").negate(), resource);
* </pre>
* @param predicate predicate to match
* @param predicate the predicate to match
* @param resource the resources to serve
* @param headersConsumer provides access to the HTTP headers for served resources
* @return a router function that routes to a resource
@ -384,7 +384,7 @@ public abstract class RouterFunctions { @@ -384,7 +384,7 @@ public abstract class RouterFunctions {
/**
* Adds a route to the given handler function that handles all HTTP {@code GET} requests
* that match the given predicate.
* @param predicate predicate to match
* @param predicate the predicate to match
* @param handlerFunction the handler function to handle all {@code GET} requests that
* match {@code predicate}
* @return this builder
@ -436,7 +436,7 @@ public abstract class RouterFunctions { @@ -436,7 +436,7 @@ public abstract class RouterFunctions {
/**
* Adds a route to the given handler function that handles all HTTP {@code HEAD} requests
* that match the given predicate.
* @param predicate predicate to match
* @param predicate the predicate to match
* @param handlerFunction the handler function to handle all {@code HEAD} requests that
* match {@code predicate}
* @return this builder
@ -479,7 +479,7 @@ public abstract class RouterFunctions { @@ -479,7 +479,7 @@ public abstract class RouterFunctions {
/**
* Adds a route to the given handler function that handles all HTTP {@code POST} requests
* that match the given predicate.
* @param predicate predicate to match
* @param predicate the predicate to match
* @param handlerFunction the handler function to handle all {@code POST} requests that
* match {@code predicate}
* @return this builder
@ -530,7 +530,7 @@ public abstract class RouterFunctions { @@ -530,7 +530,7 @@ public abstract class RouterFunctions {
/**
* Adds a route to the given handler function that handles all HTTP {@code PUT} requests
* that match the given predicate.
* @param predicate predicate to match
* @param predicate the predicate to match
* @param handlerFunction the handler function to handle all {@code PUT} requests that
* match {@code predicate}
* @return this builder
@ -581,7 +581,7 @@ public abstract class RouterFunctions { @@ -581,7 +581,7 @@ public abstract class RouterFunctions {
/**
* Adds a route to the given handler function that handles all HTTP {@code PATCH} requests
* that match the given predicate.
* @param predicate predicate to match
* @param predicate the predicate to match
* @param handlerFunction the handler function to handle all {@code PATCH} requests that
* match {@code predicate}
* @return this builder
@ -632,7 +632,7 @@ public abstract class RouterFunctions { @@ -632,7 +632,7 @@ public abstract class RouterFunctions {
/**
* Adds a route to the given handler function that handles all HTTP {@code DELETE} requests
* that match the given predicate.
* @param predicate predicate to match
* @param predicate the predicate to match
* @param handlerFunction the handler function to handle all {@code DELETE} requests that
* match {@code predicate}
* @return this builder
@ -675,7 +675,7 @@ public abstract class RouterFunctions { @@ -675,7 +675,7 @@ public abstract class RouterFunctions {
/**
* Adds a route to the given handler function that handles all HTTP {@code OPTIONS} requests
* that match the given predicate.
* @param predicate predicate to match
* @param predicate the predicate to match
* @param handlerFunction the handler function to handle all {@code OPTIONS} requests that
* match {@code predicate}
* @return this builder
@ -735,7 +735,7 @@ public abstract class RouterFunctions { @@ -735,7 +735,7 @@ public abstract class RouterFunctions {
* Resource resource = new ClassPathResource("static/index.html")
* RouterFunction&lt;ServerResponse&gt; resources = RouterFunctions.resource(path("/api/**").negate(), resource);
* </pre>
* @param predicate predicate to match
* @param predicate the predicate to match
* @param resource the resources to serve
* @return a router function that routes to a resource
* @since 6.1.4
@ -749,7 +749,7 @@ public abstract class RouterFunctions { @@ -749,7 +749,7 @@ public abstract class RouterFunctions {
* Resource resource = new ClassPathResource("static/index.html")
* RouterFunction&lt;ServerResponse&gt; resources = RouterFunctions.resource(path("/api/**").negate(), resource);
* </pre>
* @param predicate predicate to match
* @param predicate the predicate to match
* @param resource the resources to serve
* @param headersConsumer provides access to the HTTP headers for served resources
* @return a router function that routes to a resource

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -136,7 +136,7 @@ public abstract class RouterFunctions { @@ -136,7 +136,7 @@ public abstract class RouterFunctions {
* Resource resource = new ClassPathResource("static/index.html")
* RouterFunction&lt;ServerResponse&gt; resources = RouterFunctions.resource(path("/api/**").negate(), resource);
* </pre>
* @param predicate predicate to match
* @param predicate the predicate to match
* @param resource the resources to serve
* @return a router function that routes to a resource
* @since 6.1.4
@ -152,7 +152,7 @@ public abstract class RouterFunctions { @@ -152,7 +152,7 @@ public abstract class RouterFunctions {
* Resource resource = new ClassPathResource("static/index.html")
* RouterFunction&lt;ServerResponse&gt; resources = RouterFunctions.resource(path("/api/**").negate(), resource);
* </pre>
* @param predicate predicate to match
* @param predicate the predicate to match
* @param resource the resources to serve
* @param headersConsumer provides access to the HTTP headers for served resources
* @return a router function that routes to a resource
@ -298,7 +298,7 @@ public abstract class RouterFunctions { @@ -298,7 +298,7 @@ public abstract class RouterFunctions {
/**
* Adds a route to the given handler function that handles all HTTP {@code GET} requests
* that match the given predicate.
* @param predicate predicate to match
* @param predicate the predicate to match
* @param handlerFunction the handler function to handle all {@code GET} requests that
* match {@code predicate}
* @return this builder
@ -350,7 +350,7 @@ public abstract class RouterFunctions { @@ -350,7 +350,7 @@ public abstract class RouterFunctions {
/**
* Adds a route to the given handler function that handles all HTTP {@code HEAD} requests
* that match the given predicate.
* @param predicate predicate to match
* @param predicate the predicate to match
* @param handlerFunction the handler function to handle all {@code HEAD} requests that
* match {@code predicate}
* @return this builder
@ -393,7 +393,7 @@ public abstract class RouterFunctions { @@ -393,7 +393,7 @@ public abstract class RouterFunctions {
/**
* Adds a route to the given handler function that handles all HTTP {@code POST} requests
* that match the given predicate.
* @param predicate predicate to match
* @param predicate the predicate to match
* @param handlerFunction the handler function to handle all {@code POST} requests that
* match {@code predicate}
* @return this builder
@ -444,7 +444,7 @@ public abstract class RouterFunctions { @@ -444,7 +444,7 @@ public abstract class RouterFunctions {
/**
* Adds a route to the given handler function that handles all HTTP {@code PUT} requests
* that match the given predicate.
* @param predicate predicate to match
* @param predicate the predicate to match
* @param handlerFunction the handler function to handle all {@code PUT} requests that
* match {@code predicate}
* @return this builder
@ -495,7 +495,7 @@ public abstract class RouterFunctions { @@ -495,7 +495,7 @@ public abstract class RouterFunctions {
/**
* Adds a route to the given handler function that handles all HTTP {@code PATCH} requests
* that match the given predicate.
* @param predicate predicate to match
* @param predicate the predicate to match
* @param handlerFunction the handler function to handle all {@code PATCH} requests that
* match {@code predicate}
* @return this builder
@ -546,7 +546,7 @@ public abstract class RouterFunctions { @@ -546,7 +546,7 @@ public abstract class RouterFunctions {
/**
* Adds a route to the given handler function that handles all HTTP {@code DELETE} requests
* that match the given predicate.
* @param predicate predicate to match
* @param predicate the predicate to match
* @param handlerFunction the handler function to handle all {@code DELETE} requests that
* match {@code predicate}
* @return this builder
@ -589,7 +589,7 @@ public abstract class RouterFunctions { @@ -589,7 +589,7 @@ public abstract class RouterFunctions {
/**
* Adds a route to the given handler function that handles all HTTP {@code OPTIONS} requests
* that match the given predicate.
* @param predicate predicate to match
* @param predicate the predicate to match
* @param handlerFunction the handler function to handle all {@code OPTIONS} requests that
* match {@code predicate}
* @return this builder
@ -648,7 +648,7 @@ public abstract class RouterFunctions { @@ -648,7 +648,7 @@ public abstract class RouterFunctions {
* Resource resource = new ClassPathResource("static/index.html")
* RouterFunction&lt;ServerResponse&gt; resources = RouterFunctions.resource(path("/api/**").negate(), resource);
* </pre>
* @param predicate predicate to match
* @param predicate the predicate to match
* @param resource the resources to serve
* @return a router function that routes to a resource
* @since 6.1.4
@ -662,7 +662,7 @@ public abstract class RouterFunctions { @@ -662,7 +662,7 @@ public abstract class RouterFunctions {
* Resource resource = new ClassPathResource("static/index.html")
* RouterFunction&lt;ServerResponse&gt; resources = RouterFunctions.resource(path("/api/**").negate(), resource);
* </pre>
* @param predicate predicate to match
* @param predicate the predicate to match
* @param resource the resources to serve
* @param headersConsumer provides access to the HTTP headers for served resources
* @return a router function that routes to a resource

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

@ -290,7 +290,7 @@ public interface ServerResponse { @@ -290,7 +290,7 @@ public interface ServerResponse {
* .send("Hello World!"));
* }
* </pre>
* @param consumer consumer that will be provided with an event builder
* @param consumer the consumer that will be provided with an event builder
* @return the server-side event response
* @since 5.3.2
* @see <a href="https://html.spec.whatwg.org/multipage/server-sent-events.html">Server-Sent Events</a>
@ -319,8 +319,8 @@ public interface ServerResponse { @@ -319,8 +319,8 @@ public interface ServerResponse {
* .send("Hello World!"));
* }
* </pre>
* @param consumer consumer that will be provided with an event builder
* @param timeout maximum time period to wait before timing out
* @param consumer the consumer that will be provided with an event builder
* @param timeout maximum time period to wait before timing out
* @return the server-side event response
* @since 5.3.2
* @see <a href="https://html.spec.whatwg.org/multipage/server-sent-events.html">Server-Sent Events</a>
@ -338,7 +338,7 @@ public interface ServerResponse { @@ -338,7 +338,7 @@ public interface ServerResponse {
/**
* 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)

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

@ -135,7 +135,7 @@ public class ResponseBodyEmitterReturnValueHandler implements HandlerMethodRetur @@ -135,7 +135,7 @@ public class ResponseBodyEmitterReturnValueHandler implements HandlerMethodRetur
* @param executor for blocking I/O writes of items emitted from reactive types
* @param manager for detecting streaming media types
* @param viewResolvers resolvers for fragment stream rendering
* @param localeResolver localeResolver for fragment stream rendering
* @param localeResolver the {@link LocaleResolver} for fragment stream rendering
* @since 6.2
*/
public ResponseBodyEmitterReturnValueHandler(

Loading…
Cancel
Save