diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanDefinitionPropertyValueCodeGeneratorDelegates.java b/spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanDefinitionPropertyValueCodeGeneratorDelegates.java
index f9cfc2ad00..20a0f860d8 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanDefinitionPropertyValueCodeGeneratorDelegates.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanDefinitionPropertyValueCodeGeneratorDelegates.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2023 the original author or authors.
+ * Copyright 2002-2024 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.
@@ -47,15 +47,15 @@ import org.springframework.javapoet.CodeBlock;
abstract class BeanDefinitionPropertyValueCodeGeneratorDelegates {
/**
- * Return the {@link Delegate} implementations for common bean definition
- * property value types. These are:
+ * A list of {@link Delegate} implementations for the following common bean
+ * definition property value types.
*
- * - {@link ManagedList},
- * - {@link ManagedSet},
- * - {@link ManagedMap},
- * - {@link LinkedHashMap},
- * - {@link BeanReference},
- * - {@link TypedStringValue}.
+ * - {@link ManagedList}
+ * - {@link ManagedSet}
+ * - {@link ManagedMap}
+ * - {@link LinkedHashMap}
+ * - {@link BeanReference}
+ * - {@link TypedStringValue}
*
* When combined with {@linkplain ValueCodeGeneratorDelegates#INSTANCES the
* delegates for common value types}, this should be added first as they have
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/aot/CodeWarnings.java b/spring-beans/src/main/java/org/springframework/beans/factory/aot/CodeWarnings.java
index ba0de5056e..feb216ea59 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/aot/CodeWarnings.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/aot/CodeWarnings.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2023 the original author or authors.
+ * Copyright 2002-2024 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.
@@ -20,7 +20,6 @@ import java.lang.reflect.AnnotatedElement;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
-import java.util.StringJoiner;
import java.util.stream.Stream;
import org.springframework.javapoet.AnnotationSpec;
@@ -118,9 +117,7 @@ class CodeWarnings {
@Override
public String toString() {
- return new StringJoiner(", ", CodeWarnings.class.getSimpleName(), "")
- .add(this.warnings.toString())
- .toString();
+ return CodeWarnings.class.getSimpleName() + this.warnings;
}
}
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/aot/CodeWarningsTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/aot/CodeWarningsTests.java
index 4f7c57edcd..8f920cded3 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/aot/CodeWarningsTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/aot/CodeWarningsTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2023 the original author or authors.
+ * Copyright 2002-2024 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.
@@ -43,14 +43,10 @@ class CodeWarningsTests {
private static final TestCompiler TEST_COMPILER = TestCompiler.forSystem()
.withCompilerOptions("-Xlint:all", "-Werror");
- private final CodeWarnings codeWarnings;
+ private final CodeWarnings codeWarnings = new CodeWarnings();
- private final TestGenerationContext generationContext;
+ private final TestGenerationContext generationContext = new TestGenerationContext();
- CodeWarningsTests() {
- this.codeWarnings = new CodeWarnings();
- this.generationContext = new TestGenerationContext();
- }
@Test
void registerNoWarningDoesNotIncludeAnnotation() {
@@ -67,8 +63,7 @@ class CodeWarningsTests {
compile(method -> {
this.codeWarnings.suppress(method);
method.addStatement("$T bean = new $T()", DeprecatedBean.class, DeprecatedBean.class);
- }, compiled -> assertThat(compiled.getSourceFile())
- .contains("@SuppressWarnings(\"deprecation\")"));
+ }, compiled -> assertThat(compiled.getSourceFile()).contains("@SuppressWarnings(\"deprecation\")"));
}
@Test
@@ -80,26 +75,25 @@ class CodeWarningsTests {
this.codeWarnings.suppress(method);
method.addStatement("$T bean = new $T()", DeprecatedBean.class, DeprecatedBean.class);
method.addStatement("$T another = new $T()", DeprecatedForRemovalBean.class, DeprecatedForRemovalBean.class);
- }, compiled -> assertThat(compiled.getSourceFile())
- .contains("@SuppressWarnings({ \"deprecation\", \"removal\" })"));
+ }, compiled -> assertThat(compiled.getSourceFile()).contains("@SuppressWarnings({ \"deprecation\", \"removal\" })"));
}
@Test
@SuppressWarnings("deprecation")
void detectDeprecationOnAnnotatedElementWithDeprecated() {
this.codeWarnings.detectDeprecation(DeprecatedBean.class);
- assertThat(this.codeWarnings.getWarnings()).containsExactly("deprecation");
+ assertThat(this.codeWarnings.getWarnings()).containsOnly("deprecation");
}
@Test
@SuppressWarnings("removal")
void detectDeprecationOnAnnotatedElementWithDeprecatedForRemoval() {
this.codeWarnings.detectDeprecation(DeprecatedForRemovalBean.class);
- assertThat(this.codeWarnings.getWarnings()).containsExactly("removal");
+ assertThat(this.codeWarnings.getWarnings()).containsOnly("removal");
}
@Test
- void toStringIncludeWarnings() {
+ void toStringIncludesWarnings() {
this.codeWarnings.register("deprecation");
this.codeWarnings.register("rawtypes");
assertThat(this.codeWarnings).hasToString("CodeWarnings[deprecation, rawtypes]");
diff --git a/spring-context/src/main/java/org/springframework/context/event/ApplicationListenerMethodAdapter.java b/spring-context/src/main/java/org/springframework/context/event/ApplicationListenerMethodAdapter.java
index e3446c83d1..030f598767 100644
--- a/spring-context/src/main/java/org/springframework/context/event/ApplicationListenerMethodAdapter.java
+++ b/spring-context/src/main/java/org/springframework/context/event/ApplicationListenerMethodAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2023 the original author or authors.
+ * Copyright 2002-2024 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.
diff --git a/spring-context/src/main/java/org/springframework/scheduling/support/CronExpression.java b/spring-context/src/main/java/org/springframework/scheduling/support/CronExpression.java
index fdc7cb96dc..47b5db1a2c 100644
--- a/spring-context/src/main/java/org/springframework/scheduling/support/CronExpression.java
+++ b/spring-context/src/main/java/org/springframework/scheduling/support/CronExpression.java
@@ -142,11 +142,11 @@ public final class CronExpression {
*
* Example expressions:
*
- * - {@code "0 0 * * * *"} = the top of every hour of every day.
- * "*/10 * * * * *" = every ten seconds.
- * - {@code "0 0 8-10 * * *"} = 8, 9 and 10 o'clock of every day.
- * - {@code "0 0 6,19 * * *"} = 6:00 AM and 7:00 PM every day.
- * - {@code "0 0/30 8-10 * * *"} = 8:00, 8:30, 9:00, 9:30, 10:00 and 10:30 every day.
+ * - {@code "0 0 * * * *"} = the top of every hour of every day
+ * "*/10 * * * * *" = every ten seconds
+ * - {@code "0 0 8-10 * * *"} = 8, 9 and 10 o'clock of every day
+ * - {@code "0 0 6,19 * * *"} = 6:00 AM and 7:00 PM every day
+ * - {@code "0 0/30 8-10 * * *"} = 8:00, 8:30, 9:00, 9:30, 10:00 and 10:30 every day
* - {@code "0 0 9-17 * * MON-FRI"} = on the hour nine-to-five weekdays
* - {@code "0 0 0 25 12 ?"} = every Christmas Day at midnight
* - {@code "0 0 0 L * *"} = last day of the month at midnight
@@ -159,13 +159,13 @@ public final class CronExpression {
* - {@code "0 0 0 ? * MON#1"} = the first Monday in the month at midnight
*
*
- * The following macros are also supported:
+ *
The following macros are also supported.
*
- * - {@code "@yearly"} (or {@code "@annually"}) to run un once a year, i.e. {@code "0 0 0 1 1 *"},
- * - {@code "@monthly"} to run once a month, i.e. {@code "0 0 0 1 * *"},
- * - {@code "@weekly"} to run once a week, i.e. {@code "0 0 0 * * 0"},
- * - {@code "@daily"} (or {@code "@midnight"}) to run once a day, i.e. {@code "0 0 0 * * *"},
- * - {@code "@hourly"} to run once an hour, i.e. {@code "0 0 * * * *"}.
+ * - {@code "@yearly"} (or {@code "@annually"}) to run un once a year, i.e. {@code "0 0 0 1 1 *"}
+ * - {@code "@monthly"} to run once a month, i.e. {@code "0 0 0 1 * *"}
+ * - {@code "@weekly"} to run once a week, i.e. {@code "0 0 0 * * 0"}
+ * - {@code "@daily"} (or {@code "@midnight"}) to run once a day, i.e. {@code "0 0 0 * * *"}
+ * - {@code "@hourly"} to run once an hour, i.e. {@code "0 0 * * * *"}
*
* @param expression the expression string to parse
* @return the parsed {@code CronExpression} object
diff --git a/spring-core/src/main/java/org/springframework/aot/generate/ValueCodeGeneratorDelegates.java b/spring-core/src/main/java/org/springframework/aot/generate/ValueCodeGeneratorDelegates.java
index ce4ade2027..fc91ff363d 100644
--- a/spring-core/src/main/java/org/springframework/aot/generate/ValueCodeGeneratorDelegates.java
+++ b/spring-core/src/main/java/org/springframework/aot/generate/ValueCodeGeneratorDelegates.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2023 the original author or authors.
+ * Copyright 2002-2024 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.
@@ -47,19 +47,19 @@ import org.springframework.util.ObjectUtils;
public abstract class ValueCodeGeneratorDelegates {
/**
- * Return the {@link Delegate} implementations for common value types.
- * These are:
+ * A list of {@link Delegate} implementations for the following common value
+ * types.
*
- * - Primitive types,
- * - String,
- * - Charset,
- * - Enum,
- * - Class,
- * - {@link ResolvableType},
- * - Array,
- * - List via {@code List.of},
- * - Set via {@code Set.of} and support of {@link LinkedHashSet},
- * - Map via {@code Map.of} or {@code Map.ofEntries}.
+ * - Primitive types
+ * - String
+ * - Charset
+ * - Enum
+ * - Class
+ * - {@link ResolvableType}
+ * - Array
+ * - List via {@code List.of}
+ * - Set via {@code Set.of} and support for {@link LinkedHashSet}
+ * - Map via {@code Map.of} or {@code Map.ofEntries}
*
* Those implementations do not require the {@link ValueCodeGenerator} to be
* {@linkplain ValueCodeGenerator#scoped(GeneratedMethods) scoped}.
diff --git a/spring-core/src/main/java/org/springframework/aot/hint/TypeHint.java b/spring-core/src/main/java/org/springframework/aot/hint/TypeHint.java
index a4d927c73c..e4a14a74fd 100644
--- a/spring-core/src/main/java/org/springframework/aot/hint/TypeHint.java
+++ b/spring-core/src/main/java/org/springframework/aot/hint/TypeHint.java
@@ -23,7 +23,6 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
-import java.util.StringJoiner;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -123,9 +122,7 @@ public final class TypeHint implements ConditionalHint {
@Override
public String toString() {
- return new StringJoiner(", ", TypeHint.class.getSimpleName() + "[", "]")
- .add("type=" + this.type)
- .toString();
+ return TypeHint.class.getSimpleName() + "[type=" + this.type + "]";
}
/**
diff --git a/spring-core/src/main/java/org/springframework/core/ResolvableType.java b/spring-core/src/main/java/org/springframework/core/ResolvableType.java
index 9734b2a61d..485dbdf1e0 100644
--- a/spring-core/src/main/java/org/springframework/core/ResolvableType.java
+++ b/spring-core/src/main/java/org/springframework/core/ResolvableType.java
@@ -1169,7 +1169,8 @@ public class ResolvableType implements Serializable {
Assert.notNull(clazz, "Class must not be null");
Assert.notNull(generics, "Generics array must not be null");
TypeVariable>[] variables = clazz.getTypeParameters();
- Assert.isTrue(variables.length == generics.length, () -> "Mismatched number of generics specified for " + clazz.toGenericString());
+ Assert.isTrue(variables.length == generics.length,
+ () -> "Mismatched number of generics specified for " + clazz.toGenericString());
Type[] arguments = new Type[generics.length];
for (int i = 0; i < generics.length; i++) {
diff --git a/spring-core/src/main/java/org/springframework/util/ClassUtils.java b/spring-core/src/main/java/org/springframework/util/ClassUtils.java
index 3218838cac..8f57e14bb2 100644
--- a/spring-core/src/main/java/org/springframework/util/ClassUtils.java
+++ b/spring-core/src/main/java/org/springframework/util/ClassUtils.java
@@ -1019,10 +1019,10 @@ public abstract class ClassUtils {
}
Class> clazz = value.getClass();
if (Proxy.isProxyClass(clazz)) {
- String prefix = clazz.getName() + " implementing ";
+ String prefix = clazz.getTypeName() + " implementing ";
StringJoiner result = new StringJoiner(",", prefix, "");
for (Class> ifc : clazz.getInterfaces()) {
- result.add(ifc.getName());
+ result.add(ifc.getTypeName());
}
return result.toString();
}
diff --git a/spring-core/src/main/java/org/springframework/util/PlaceholderParser.java b/spring-core/src/main/java/org/springframework/util/PlaceholderParser.java
index 6836d10d12..ea16a25561 100644
--- a/spring-core/src/main/java/org/springframework/util/PlaceholderParser.java
+++ b/spring-core/src/main/java/org/springframework/util/PlaceholderParser.java
@@ -46,13 +46,13 @@ import org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver;
* a given key can involve the resolution of nested placeholders. Default values
* can also have placeholders.
*
- * For situations where the syntax of a valid placeholder match a String that
+ *
For situations where the syntax of a valid placeholder matches a String that
* must be rendered as is, the placeholder can be escaped using an {@code escape}
* character. For instance {@code \${name}} resolves as {@code ${name}}.
*
*
The prefix, suffix, separator, and escape characters are configurable. Only
- * the prefix and suffix are mandatory and the support of default values or
- * escaping are conditional on providing a non-null value for them.
+ * the prefix and suffix are mandatory, and the support for default values or
+ * escaping is conditional on providing non-null values for them.
*
*
This parser makes sure to resolves placeholders as lazily as possible.
*
@@ -64,7 +64,11 @@ final class PlaceholderParser {
private static final Log logger = LogFactory.getLog(PlaceholderParser.class);
private static final Map wellKnownSimplePrefixes = Map.of(
- "}", "{", "]", "[", ")", "(");
+ "}", "{",
+ "]", "[",
+ ")", "("
+ );
+
private final String prefix;
@@ -80,9 +84,9 @@ final class PlaceholderParser {
@Nullable
private final Character escape;
+
/**
* Create an instance using the specified input for the parser.
- *
* @param prefix the prefix that denotes the start of a placeholder
* @param suffix the suffix that denotes the end of a placeholder
* @param ignoreUnresolvablePlaceholders whether unresolvable placeholders
@@ -90,7 +94,7 @@ final class PlaceholderParser {
* @param separator the separating character between the placeholder
* variable and the associated default value, if any
* @param escape the character to use at the beginning of a placeholder
- * to escape it and render it as is
+ * prefix or separator to escape it and render it as is
*/
PlaceholderParser(String prefix, String suffix, boolean ignoreUnresolvablePlaceholders,
@Nullable String separator, @Nullable Character escape) {
@@ -109,7 +113,7 @@ final class PlaceholderParser {
}
/**
- * Replaces all placeholders of format {@code ${name}} with the value returned
+ * Replace all placeholders of format {@code ${name}} with the value returned
* from the supplied {@link PlaceholderResolver}.
* @param value the value containing the placeholders to be replaced
* @param placeholderResolver the {@code PlaceholderResolver} to use for replacement
@@ -138,8 +142,7 @@ final class PlaceholderParser {
LinkedList parts = new LinkedList<>();
int startIndex = nextStartPrefix(value, 0);
if (startIndex == -1) {
- Part part = inPlaceholder ? createSimplePlaceholderPart(value)
- : new TextPart(value);
+ Part part = (inPlaceholder ? createSimplePlaceholderPart(value) : new TextPart(value));
parts.add(part);
return parts;
}
@@ -168,13 +171,13 @@ final class PlaceholderParser {
}
// Add rest of text if necessary
addText(value, position, value.length(), parts);
- return inPlaceholder ? List.of(createNestedPlaceholderPart(value, parts)) : parts;
+ return (inPlaceholder ? List.of(createNestedPlaceholderPart(value, parts)) : parts);
}
private SimplePlaceholderPart createSimplePlaceholderPart(String text) {
String[] keyAndDefault = splitKeyAndDefault(text);
- return (keyAndDefault != null) ? new SimplePlaceholderPart(text, keyAndDefault[0], keyAndDefault[1])
- : new SimplePlaceholderPart(text, text, null);
+ return ((keyAndDefault != null) ? new SimplePlaceholderPart(text, keyAndDefault[0], keyAndDefault[1]) :
+ new SimplePlaceholderPart(text, text, null));
}
private NestedPlaceholderPart createNestedPlaceholderPart(String text, List parts) {
@@ -291,7 +294,7 @@ final class PlaceholderParser {
}
/**
- * Provide the necessary to handle and resolve underlying placeholders.
+ * Provide the necessary context to handle and resolve underlying placeholders.
*/
static class PartResolutionContext implements PlaceholderResolver {
@@ -308,6 +311,7 @@ final class PlaceholderParser {
@Nullable
private Set visitedPlaceholders;
+
PartResolutionContext(PlaceholderResolver resolver, String prefix, String suffix,
boolean ignoreUnresolvablePlaceholders, Function> parser) {
this.prefix = prefix;
diff --git a/spring-core/src/main/java/org/springframework/util/PropertyPlaceholderHelper.java b/spring-core/src/main/java/org/springframework/util/PropertyPlaceholderHelper.java
index 00b2791b9c..d6281b7576 100644
--- a/spring-core/src/main/java/org/springframework/util/PropertyPlaceholderHelper.java
+++ b/spring-core/src/main/java/org/springframework/util/PropertyPlaceholderHelper.java
@@ -22,7 +22,8 @@ import org.springframework.lang.Nullable;
/**
* Utility class for working with Strings that have placeholder values in them.
- * A placeholder takes the form {@code ${name}}. Using {@code PropertyPlaceholderHelper}
+ *
+ * A placeholder takes the form {@code ${name}}. Using {@code PropertyPlaceholderHelper}
* these placeholders can be substituted for user-supplied values.
*
*
Values for substitution can be supplied using a {@link Properties} instance or
@@ -39,7 +40,7 @@ public class PropertyPlaceholderHelper {
/**
- * Creates a new {@code PropertyPlaceholderHelper} that uses the supplied prefix and suffix.
+ * Create a new {@code PropertyPlaceholderHelper} that uses the supplied prefix and suffix.
* Unresolvable placeholders are ignored.
* @param placeholderPrefix the prefix that denotes the start of a placeholder
* @param placeholderSuffix the suffix that denotes the end of a placeholder
@@ -49,14 +50,15 @@ public class PropertyPlaceholderHelper {
}
/**
- * Creates a new {@code PropertyPlaceholderHelper} that uses the supplied prefix and suffix.
+ * Create a new {@code PropertyPlaceholderHelper} that uses the supplied prefix and suffix.
* @param placeholderPrefix the prefix that denotes the start of a placeholder
* @param placeholderSuffix the suffix that denotes the end of a placeholder
* @param valueSeparator the separating character between the placeholder variable
* and the associated default value, if any
* @param ignoreUnresolvablePlaceholders indicates whether unresolvable placeholders should
* be ignored ({@code true}) or cause an exception ({@code false})
- * @deprecated in favor of {@link PropertyPlaceholderHelper#PropertyPlaceholderHelper(String, String, String, boolean, Character)}
+ * @deprecated as of 6.2, in favor of
+ * {@link PropertyPlaceholderHelper#PropertyPlaceholderHelper(String, String, String, Character, boolean)}
*/
@Deprecated(since = "6.2", forRemoval = true)
public PropertyPlaceholderHelper(String placeholderPrefix, String placeholderSuffix,
@@ -66,7 +68,7 @@ public class PropertyPlaceholderHelper {
}
/**
- * Creates a new {@code PropertyPlaceholderHelper} that uses the supplied prefix and suffix.
+ * Create a new {@code PropertyPlaceholderHelper} that uses the supplied prefix and suffix.
* @param placeholderPrefix the prefix that denotes the start of a placeholder
* @param placeholderSuffix the suffix that denotes the end of a placeholder
* @param valueSeparator the separating character between the placeholder variable
@@ -89,7 +91,7 @@ public class PropertyPlaceholderHelper {
/**
- * Replaces all placeholders of format {@code ${name}} with the corresponding
+ * Replace all placeholders of format {@code ${name}} with the corresponding
* property from the supplied {@link Properties}.
* @param value the value containing the placeholders to be replaced
* @param properties the {@code Properties} to use for replacement
@@ -101,7 +103,7 @@ public class PropertyPlaceholderHelper {
}
/**
- * Replaces all placeholders of format {@code ${name}} with the value returned
+ * Replace all placeholders of format {@code ${name}} with the value returned
* from the supplied {@link PlaceholderResolver}.
* @param value the value containing the placeholders to be replaced
* @param placeholderResolver the {@code PlaceholderResolver} to use for replacement
diff --git a/spring-core/src/test/java/org/springframework/core/ResolvableTypeTests.java b/spring-core/src/test/java/org/springframework/core/ResolvableTypeTests.java
index 5f4c1f0a81..0516c2fb32 100644
--- a/spring-core/src/test/java/org/springframework/core/ResolvableTypeTests.java
+++ b/spring-core/src/test/java/org/springframework/core/ResolvableTypeTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2023 the original author or authors.
+ * Copyright 2002-2024 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.
diff --git a/spring-core/src/test/java/org/springframework/util/PlaceholderParserTests.java b/spring-core/src/test/java/org/springframework/util/PlaceholderParserTests.java
index 110383eb68..87aedf1c6e 100644
--- a/spring-core/src/test/java/org/springframework/util/PlaceholderParserTests.java
+++ b/spring-core/src/test/java/org/springframework/util/PlaceholderParserTests.java
@@ -336,7 +336,7 @@ class PlaceholderParserTests {
if (pairs.length % 2 == 1) {
throw new IllegalArgumentException("size must be even, it is a set of key=value pairs");
}
- PlaceholderResolver resolver = mock(PlaceholderResolver.class);
+ PlaceholderResolver resolver = mock();
for (int i = 0; i < pairs.length; i += 2) {
String key = pairs[i];
String value = pairs[i + 1];
diff --git a/spring-web/src/main/java/org/springframework/http/client/ClientHttpRequestInterceptor.java b/spring-web/src/main/java/org/springframework/http/client/ClientHttpRequestInterceptor.java
index c4d36bcf72..9c22b283fa 100644
--- a/spring-web/src/main/java/org/springframework/http/client/ClientHttpRequestInterceptor.java
+++ b/spring-web/src/main/java/org/springframework/http/client/ClientHttpRequestInterceptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2023 the original author or authors.
+ * Copyright 2002-2024 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.
@@ -43,11 +43,9 @@ public interface ClientHttpRequestInterceptor {
* wrap} the request to filter HTTP attributes.
*
Optionally modify the body of the request.
*
- * - Either
- *
- execute the request using
- * {@link ClientHttpRequestExecution#execute(org.springframework.http.HttpRequest, byte[])},
- * - or
- * - do not execute the request to block the execution altogether.
+ * - either execute the request using
+ * {@link ClientHttpRequestExecution#execute(HttpRequest, byte[])}
+ * - or do not execute the request to block the execution altogether
*
* Optionally wrap the response to filter HTTP attributes.
*
diff --git a/spring-web/src/main/java/org/springframework/web/client/RestClient.java b/spring-web/src/main/java/org/springframework/web/client/RestClient.java
index 1cd9183a94..e1a560062b 100644
--- a/spring-web/src/main/java/org/springframework/web/client/RestClient.java
+++ b/spring-web/src/main/java/org/springframework/web/client/RestClient.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2023 the original author or authors.
+ * Copyright 2002-2024 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.
@@ -155,16 +155,17 @@ public interface RestClient {
}
/**
- * Create a new {@code RestClient} based on the configuration of the
- * given {@code RestTemplate}. The returned builder is configured with the
- * template's
+ * Create a new {@code RestClient} based on the configuration of the given
+ * {@code RestTemplate}.
+ * The returned builder is configured with the following attributes of
+ * the template.
*
- * - {@link RestTemplate#getRequestFactory() ClientHttpRequestFactory},
- * - {@link RestTemplate#getMessageConverters() HttpMessageConverters},
- * - {@link RestTemplate#getInterceptors() ClientHttpRequestInterceptors},
- * - {@link RestTemplate#getClientHttpRequestInitializers() ClientHttpRequestInitializers},
- * - {@link RestTemplate#getUriTemplateHandler() UriBuilderFactory}, and
- * - {@linkplain RestTemplate#getErrorHandler() error handler}.
+ * - {@link RestTemplate#getRequestFactory() ClientHttpRequestFactory}
+ * - {@link RestTemplate#getMessageConverters() HttpMessageConverters}
+ * - {@link RestTemplate#getInterceptors() ClientHttpRequestInterceptors}
+ * - {@link RestTemplate#getClientHttpRequestInitializers() ClientHttpRequestInitializers}
+ * - {@link RestTemplate#getUriTemplateHandler() UriBuilderFactory}
+ * - {@linkplain RestTemplate#getErrorHandler() error handler}
*
* @param restTemplate the rest template to base the returned client's
* configuration on
@@ -184,15 +185,16 @@ public interface RestClient {
/**
* Obtain a {@code RestClient} builder based on the configuration of the
- * given {@code RestTemplate}. The returned builder is configured with the
- * template's
+ * given {@code RestTemplate}.
+ * The returned builder is configured with the following attributes of
+ * the template.
*
- * - {@link RestTemplate#getRequestFactory() ClientHttpRequestFactory},
- * - {@link RestTemplate#getMessageConverters() HttpMessageConverters},
- * - {@link RestTemplate#getInterceptors() ClientHttpRequestInterceptors},
- * - {@link RestTemplate#getClientHttpRequestInitializers() ClientHttpRequestInitializers},
- * - {@link RestTemplate#getUriTemplateHandler() UriBuilderFactory}, and
- * - {@linkplain RestTemplate#getErrorHandler() error handler}.
+ * - {@link RestTemplate#getRequestFactory() ClientHttpRequestFactory}
+ * - {@link RestTemplate#getMessageConverters() HttpMessageConverters}
+ * - {@link RestTemplate#getInterceptors() ClientHttpRequestInterceptors}
+ * - {@link RestTemplate#getClientHttpRequestInitializers() ClientHttpRequestInitializers}
+ * - {@link RestTemplate#getUriTemplateHandler() UriBuilderFactory}
+ * - {@linkplain RestTemplate#getErrorHandler() error handler}
*
* @param restTemplate the rest template to base the returned builder's
* configuration on
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 ef35021332..33e34568d0 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
@@ -79,8 +79,8 @@ public abstract class RouterFunctions {
RouterFunctions.class.getName() + ".uriTemplateVariables";
/**
- * Name of the {@link ServerWebExchange#getAttributes() attribute} that
- * contains the matching pattern, as a {@link org.springframework.web.util.pattern.PathPattern}.
+ * Name of the {@link ServerWebExchange#getAttributes() attribute} that contains
+ * the matching pattern, as an {@link org.springframework.web.util.pattern.PathPattern}.
*/
public static final String MATCHING_PATTERN_ATTRIBUTE =
RouterFunctions.class.getName() + ".matchingPattern";
@@ -263,42 +263,43 @@ public abstract class RouterFunctions {
}
/**
- * Convert the given {@linkplain RouterFunction router function} into a {@link HttpHandler}.
- * This conversion uses {@linkplain HandlerStrategies#builder() default strategies}.
- * The returned handler can be adapted to run in
+ * Convert the given {@linkplain RouterFunction router function} into an
+ * {@link HttpHandler}, using the {@linkplain HandlerStrategies#builder()
+ * default strategies}.
+ *
The returned handler can be adapted to run in the following environments.
*
* - Servlet environments using the
- * {@link org.springframework.http.server.reactive.ServletHttpHandlerAdapter},
+ * {@link org.springframework.http.server.reactive.ServletHttpHandlerAdapter}
* - Reactor using the
- * {@link org.springframework.http.server.reactive.ReactorHttpHandlerAdapter},
+ * {@link org.springframework.http.server.reactive.ReactorHttpHandlerAdapter}
* - Undertow using the
- * {@link org.springframework.http.server.reactive.UndertowHttpHandlerAdapter}.
+ * {@link org.springframework.http.server.reactive.UndertowHttpHandlerAdapter}
*
- * Note that {@code HttpWebHandlerAdapter} also implements {@link WebHandler}, allowing
- * for additional filter and exception handler registration through
+ *
Note that {@code HttpWebHandlerAdapter} also implements {@link WebHandler},
+ * allowing for additional filter and exception handler registration through
* {@link WebHttpHandlerBuilder}.
* @param routerFunction the router function to convert
- * @return an HTTP handler that handles HTTP request using the given router function
+ * @return an HTTP handler that handles HTTP requests using the given router function
*/
public static HttpHandler toHttpHandler(RouterFunction> routerFunction) {
return toHttpHandler(routerFunction, HandlerStrategies.withDefaults());
}
/**
- * Convert the given {@linkplain RouterFunction router function} into a {@link HttpHandler},
- * using the given strategies.
- *
The returned {@code HttpHandler} can be adapted to run in
+ * Convert the given {@linkplain RouterFunction router function} into an
+ * {@link HttpHandler}, using the given strategies.
+ *
The returned handler can be adapted to run in the following environments.
*
* - Servlet environments using the
- * {@link org.springframework.http.server.reactive.ServletHttpHandlerAdapter},
+ * {@link org.springframework.http.server.reactive.ServletHttpHandlerAdapter}
* - Reactor using the
- * {@link org.springframework.http.server.reactive.ReactorHttpHandlerAdapter},
+ * {@link org.springframework.http.server.reactive.ReactorHttpHandlerAdapter}
* - Undertow using the
- * {@link org.springframework.http.server.reactive.UndertowHttpHandlerAdapter}.
+ * {@link org.springframework.http.server.reactive.UndertowHttpHandlerAdapter}
*
* @param routerFunction the router function to convert
* @param strategies the strategies to use
- * @return an HTTP handler that handles HTTP request using the given router function
+ * @return an HTTP handler that handles HTTP requests using the given router function
*/
public static HttpHandler toHttpHandler(RouterFunction> routerFunction, HandlerStrategies strategies) {
WebHandler webHandler = toWebHandler(routerFunction, strategies);