Skip to content

Commit 3395382

Browse files
Replace usage of deprecated Spring Framework methods
See gh-28642
1 parent 16f54d2 commit 3395382

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ public void setSsl(Ssl ssl) {
102102
}
103103

104104
private String cleanBasePath(String basePath) {
105-
String candidate = StringUtils.trimWhitespace(basePath);
105+
String candidate = null;
106+
if (StringUtils.hasLength(basePath)) {
107+
candidate = basePath.strip();
108+
}
106109
if (StringUtils.hasText(candidate)) {
107110
if (!candidate.startsWith("/")) {
108111
candidate = "/" + candidate;

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,10 @@ public void setContextPath(String contextPath) {
262262
}
263263

264264
private String cleanContextPath(String contextPath) {
265-
String candidate = StringUtils.trimWhitespace(contextPath);
265+
String candidate = null;
266+
if (StringUtils.hasLength(contextPath)) {
267+
candidate = contextPath.strip();
268+
}
266269
if (StringUtils.hasText(candidate) && candidate.endsWith("/")) {
267270
return candidate.substring(0, candidate.length() - 1);
268271
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxProperties.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ public void setBasePath(String basePath) {
5252
}
5353

5454
private String cleanBasePath(String basePath) {
55-
String candidate = StringUtils.trimWhitespace(basePath);
55+
String candidate = null;
56+
if (StringUtils.hasLength(basePath)) {
57+
candidate = basePath.strip();
58+
}
5659
if (StringUtils.hasText(candidate)) {
5760
if (!candidate.startsWith("/")) {
5861
candidate = "/" + candidate;

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,10 @@ private boolean isSet(ConfigurableEnvironment environment, String property) {
306306
}
307307

308308
private void initializeSystem(ConfigurableEnvironment environment, LoggingSystem system, LogFile logFile) {
309-
String logConfig = StringUtils.trimWhitespace(environment.getProperty(CONFIG_PROPERTY));
309+
String logConfig = environment.getProperty(CONFIG_PROPERTY);
310+
if (StringUtils.hasLength(logConfig)) {
311+
logConfig = logConfig.strip();
312+
}
310313
try {
311314
LoggingInitializationContext initializationContext = new LoggingInitializationContext(environment);
312315
if (ignoreLogConfig(logConfig)) {

0 commit comments

Comments
 (0)