Browse Source

Replace usage of deprecated Spring Framework methods

See gh-28642
pull/28925/head
Scott Frederick 4 years ago
parent
commit
33953823fc
  1. 5
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java
  2. 5
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java
  3. 5
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxProperties.java
  4. 5
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java

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

@ -102,7 +102,10 @@ public class ManagementServerProperties { @@ -102,7 +102,10 @@ public class ManagementServerProperties {
}
private String cleanBasePath(String basePath) {
String candidate = StringUtils.trimWhitespace(basePath);
String candidate = null;
if (StringUtils.hasLength(basePath)) {
candidate = basePath.strip();
}
if (StringUtils.hasText(candidate)) {
if (!candidate.startsWith("/")) {
candidate = "/" + candidate;

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

@ -262,7 +262,10 @@ public class ServerProperties { @@ -262,7 +262,10 @@ public class ServerProperties {
}
private String cleanContextPath(String contextPath) {
String candidate = StringUtils.trimWhitespace(contextPath);
String candidate = null;
if (StringUtils.hasLength(contextPath)) {
candidate = contextPath.strip();
}
if (StringUtils.hasText(candidate) && candidate.endsWith("/")) {
return candidate.substring(0, candidate.length() - 1);
}

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

@ -52,7 +52,10 @@ public class WebFluxProperties { @@ -52,7 +52,10 @@ public class WebFluxProperties {
}
private String cleanBasePath(String basePath) {
String candidate = StringUtils.trimWhitespace(basePath);
String candidate = null;
if (StringUtils.hasLength(basePath)) {
candidate = basePath.strip();
}
if (StringUtils.hasText(candidate)) {
if (!candidate.startsWith("/")) {
candidate = "/" + candidate;

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

@ -306,7 +306,10 @@ public class LoggingApplicationListener implements GenericApplicationListener { @@ -306,7 +306,10 @@ public class LoggingApplicationListener implements GenericApplicationListener {
}
private void initializeSystem(ConfigurableEnvironment environment, LoggingSystem system, LogFile logFile) {
String logConfig = StringUtils.trimWhitespace(environment.getProperty(CONFIG_PROPERTY));
String logConfig = environment.getProperty(CONFIG_PROPERTY);
if (StringUtils.hasLength(logConfig)) {
logConfig = logConfig.strip();
}
try {
LoggingInitializationContext initializationContext = new LoggingInitializationContext(environment);
if (ignoreLogConfig(logConfig)) {

Loading…
Cancel
Save