diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/Sanitizer.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/Sanitizer.java index 6a72d25d8c..7cb865f052 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/Sanitizer.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/Sanitizer.java @@ -101,10 +101,11 @@ public class Sanitizer { } private Object sanitizeUri(Object value) { - Matcher matcher = URI_USERINFO_PATTERN.matcher(value.toString()); + String uriString = value.toString(); + Matcher matcher = URI_USERINFO_PATTERN.matcher(uriString); String password = matcher.matches() ? matcher.group(1) : null; if (password != null) { - return StringUtils.replace(value.toString(), ":" + password + "@", ":******@"); + return StringUtils.replace(uriString, ":" + password + "@", ":******@"); } return value; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java index d608045913..a814ecd822 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java @@ -275,7 +275,7 @@ class FlywayAutoConfigurationTests { .withUserConfiguration(EmbeddedDataSourceConfiguration.class, FlywayJavaMigrationsConfiguration.class) .run((context) -> { Flyway flyway = context.getBean(Flyway.class); - assertThat(flyway.getConfiguration().getJavaMigrations().length).isEqualTo(2); + assertThat(flyway.getConfiguration().getJavaMigrations()).hasSize(2); }); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerAutoConfigurationTests.java index 89f664b5e1..6a3cacf0aa 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerAutoConfigurationTests.java @@ -342,7 +342,7 @@ class ReactiveOAuth2ResourceServerAutoConfigurationTests { .getField(reactiveJwtDecoder, "jwtValidator"); Collection> tokenValidators = (Collection>) ReflectionTestUtils .getField(jwtValidator, "tokenValidators"); - assertThat(tokenValidators.stream()).hasAtLeastOneElementOfType(JwtIssuerValidator.class); + assertThat(tokenValidators).hasAtLeastOneElementOfType(JwtIssuerValidator.class); }); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerAutoConfigurationTests.java index 5fa4b909fa..dc37b27f46 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerAutoConfigurationTests.java @@ -345,7 +345,7 @@ class OAuth2ResourceServerAutoConfigurationTests { .getField(jwtDecoder, "jwtValidator"); Collection> tokenValidators = (Collection>) ReflectionTestUtils .getField(jwtValidator, "tokenValidators"); - assertThat(tokenValidators.stream()).hasAtLeastOneElementOfType(JwtIssuerValidator.class); + assertThat(tokenValidators).hasAtLeastOneElementOfType(JwtIssuerValidator.class); }); } diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc index 0e563c33e2..a1c53b64fb 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -1247,7 +1247,7 @@ include::{code-examples}/web/client/RestTemplateProxyCustomizationExample.java[t === Configure the TcpClient used by a Reactor Netty-based WebClient When Reactor Netty is on the classpath a Reactor Netty-based `WebClient` is auto-configured. To customize the client's handling of network connections, provide a `ClientHttpConnector` bean. -The following example configures a 60 second read timeout and adds a `ReadTimeoutHandler`: +The following example configures a 60 second connect timeout and adds a `ReadTimeoutHandler`: [source,java,indent=0] ---- diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 7a7e0ea617..baa4037d59 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -727,7 +727,7 @@ For example, consider the following config in a file: password: "secret" ---- -If you run the application with the arguments `--spring.profiles.active=dev" you might expect `security.user.password` to be set to "`secret`", but this is not the case. +If you run the application with the argument `--spring.profiles.active=dev` you might expect `security.user.password` to be set to "`secret`", but this is not the case. The nested document will be filtered because the main file is named `application-dev.yml`. It is already considered to be profile-specific, and nested documents will be ignored.