Remove duplicate words in Java source code

Discovered using regular expression: \b(\w+)\s+\1\b[^(}]
This commit is contained in:
Sam Brannen
2025-04-14 11:24:55 +02:00
parent f27382cfb6
commit a22d204681
10 changed files with 42 additions and 42 deletions

View File

@@ -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 {
/**
* 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

View File

@@ -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 {
* @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;

View File

@@ -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
/**
* 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
*/

View File

@@ -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 {
* 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() {

View File

@@ -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() {

View File

@@ -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
* <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>

View File

@@ -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 {
* 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 {
* 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 {
/**
* 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 {
/**
* 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 {
/**
* 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 {
/**
* 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 {
/**
* 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 {
/**
* 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 {
/**
* 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 {
* 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 {
* 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

View File

@@ -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 {
* 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 {
* 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 {
/**
* 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 {
/**
* 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 {
/**
* 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 {
/**
* 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 {
/**
* 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 {
/**
* 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 {
/**
* 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 {
* 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 {
* 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

View File

@@ -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 {
* .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 {
/**
* 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)

View File

@@ -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(