Replace usage of deprecated Spring Framework methods

See gh-28642
This commit is contained in:
Scott Frederick 2021-12-06 16:12:34 -06:00
parent 16f54d2c5c
commit 33953823fc
4 changed files with 16 additions and 4 deletions

View File

@ -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;

View File

@ -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);
}

View File

@ -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;

View File

@ -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)) {