From a22d204681c575c3f61c325d205a96fb92ea8e7a Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Mon, 14 Apr 2025 11:24:55 +0200 Subject: [PATCH] Remove duplicate words in Java source code Discovered using regular expression: \b(\w+)\s+\1\b[^(}] --- .../factory/support/MethodOverrides.java | 4 ++-- .../beans/factory/support/MethodReplacer.java | 4 ++-- .../PropertiesBeanDefinitionReader.java | 8 +++---- .../method/MethodValidationResult.java | 4 ++-- .../MockitoBeanOverrideHandlerTests.java | 2 +- .../web/context/ContextLoaderListener.java | 4 ++-- .../function/server/RouterFunctions.java | 24 +++++++++---------- .../web/servlet/function/RouterFunctions.java | 24 +++++++++---------- .../web/servlet/function/ServerResponse.java | 8 +++---- ...ResponseBodyEmitterReturnValueHandler.java | 2 +- 10 files changed, 42 insertions(+), 42 deletions(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverrides.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverrides.java index d9d9e6c1217..41321805dbd 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverrides.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverrides.java @@ -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 diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodReplacer.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodReplacer.java index e4e5df879e5..e8d844db7d1 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodReplacer.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodReplacer.java @@ -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; diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java index 37f90946393..25dcc716ffb 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java @@ -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 */ diff --git a/spring-context/src/main/java/org/springframework/validation/method/MethodValidationResult.java b/spring-context/src/main/java/org/springframework/validation/method/MethodValidationResult.java index 69ff06f55c2..9e79e2a0362 100644 --- a/spring-context/src/main/java/org/springframework/validation/method/MethodValidationResult.java +++ b/spring-context/src/main/java/org/springframework/validation/method/MethodValidationResult.java @@ -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 getAllValidationResults() { diff --git a/spring-test/src/test/java/org/springframework/test/context/bean/override/mockito/MockitoBeanOverrideHandlerTests.java b/spring-test/src/test/java/org/springframework/test/context/bean/override/mockito/MockitoBeanOverrideHandlerTests.java index 466bcd93e34..1875e2e2d63 100644 --- a/spring-test/src/test/java/org/springframework/test/context/bean/override/mockito/MockitoBeanOverrideHandlerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/bean/override/mockito/MockitoBeanOverrideHandlerTests.java @@ -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() { diff --git a/spring-web/src/main/java/org/springframework/web/context/ContextLoaderListener.java b/spring-web/src/main/java/org/springframework/web/context/ContextLoaderListener.java index e065e415261..9a4101d8470 100644 --- a/spring-web/src/main/java/org/springframework/web/context/ContextLoaderListener.java +++ b/spring-web/src/main/java/org/springframework/web/context/ContextLoaderListener.java @@ -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 *
  • {@code ServletContext} and {@code ServletConfig} objects will be delegated to * the application context
  • *
  • {@link #customizeContext} will be called
  • - *
  • Any {@link org.springframework.context.ApplicationContextInitializer ApplicationContextInitializer org.springframework.context.ApplicationContextInitializer ApplicationContextInitializers} + *
  • Any {@link org.springframework.context.ApplicationContextInitializer ApplicationContextInitializers} * specified through the "contextInitializerClasses" init-param will be applied.
  • *
  • {@link org.springframework.context.ConfigurableApplicationContext#refresh refresh()} will be called
  • * diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctions.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctions.java index d2b81a2278e..8331ceb0f5a 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctions.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctions.java @@ -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<ServerResponse> resources = RouterFunctions.resource(path("/api/**").negate(), resource); * - * @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<ServerResponse> resources = RouterFunctions.resource(path("/api/**").negate(), resource); * - * @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<ServerResponse> resources = RouterFunctions.resource(path("/api/**").negate(), resource); * - * @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<ServerResponse> resources = RouterFunctions.resource(path("/api/**").negate(), resource); * - * @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 diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/function/RouterFunctions.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/function/RouterFunctions.java index 536f3b43d01..f2ea64ea97a 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/function/RouterFunctions.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/function/RouterFunctions.java @@ -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<ServerResponse> resources = RouterFunctions.resource(path("/api/**").negate(), resource); * - * @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<ServerResponse> resources = RouterFunctions.resource(path("/api/**").negate(), resource); * - * @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<ServerResponse> resources = RouterFunctions.resource(path("/api/**").negate(), resource); * - * @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<ServerResponse> resources = RouterFunctions.resource(path("/api/**").negate(), resource); * - * @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 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 2f4356e3802..47eab85dcaa 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 @@ -290,7 +290,7 @@ public interface ServerResponse { * .send("Hello World!")); * } * - * @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 Server-Sent Events @@ -319,8 +319,8 @@ public interface ServerResponse { * .send("Hello World!")); * } * - * @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 Server-Sent Events @@ -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) diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitterReturnValueHandler.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitterReturnValueHandler.java index 26cc1e8811d..d9f3ca5e5bb 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitterReturnValueHandler.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitterReturnValueHandler.java @@ -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(