Deprecate StringUtils::trimWhitespace and variants
This commits deprecates - StringUtils::trimWhitespace in favor of String::strip - StringUtils::trimLeadingWhitespace in favor of String::stripLeading - StringUtils::trimTrailingWhitespace in favor of String::stripTrailing Closes gh-27769
This commit is contained in:
@@ -261,7 +261,7 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
|
||||
public void setArgumentNamesFromStringArray(String... args) {
|
||||
this.argumentNames = new String[args.length];
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
this.argumentNames[i] = StringUtils.trimWhitespace(args[i]);
|
||||
this.argumentNames[i] = args[i].strip();
|
||||
if (!isVariableName(this.argumentNames[i])) {
|
||||
throw new IllegalArgumentException(
|
||||
"'argumentNames' property of AbstractAspectJAdvice contains an argument name '" +
|
||||
|
||||
@@ -486,7 +486,7 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
|
||||
}
|
||||
String[] tokens = StringUtils.tokenizeToStringArray(argsSpec, ",");
|
||||
for (int i = 0; i < tokens.length; i++) {
|
||||
tokens[i] = StringUtils.trimWhitespace(tokens[i]);
|
||||
tokens[i] = tokens[i].strip();
|
||||
String varName = maybeExtractVariableName(tokens[i]);
|
||||
if (varName != null) {
|
||||
varNames.add(varName);
|
||||
|
||||
@@ -25,7 +25,6 @@ import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.PatternMatchUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Auto proxy creator that identifies beans to proxy via a list of names.
|
||||
@@ -69,7 +68,7 @@ public class BeanNameAutoProxyCreator extends AbstractAutoProxyCreator {
|
||||
Assert.notEmpty(beanNames, "'beanNames' must not be empty");
|
||||
this.beanNames = new ArrayList<>(beanNames.length);
|
||||
for (String mappedName : beanNames) {
|
||||
this.beanNames.add(StringUtils.trimWhitespace(mappedName));
|
||||
this.beanNames.add(mappedName.strip());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Abstract base regular expression pointcut bean. JavaBean properties are:
|
||||
@@ -81,7 +80,7 @@ public abstract class AbstractRegexpMethodPointcut extends StaticMethodMatcherPo
|
||||
Assert.notEmpty(patterns, "'patterns' must not be empty");
|
||||
this.patterns = new String[patterns.length];
|
||||
for (int i = 0; i < patterns.length; i++) {
|
||||
this.patterns[i] = StringUtils.trimWhitespace(patterns[i]);
|
||||
this.patterns[i] = patterns[i].strip();
|
||||
}
|
||||
initPatternRepresentation(this.patterns);
|
||||
}
|
||||
@@ -111,7 +110,7 @@ public abstract class AbstractRegexpMethodPointcut extends StaticMethodMatcherPo
|
||||
Assert.notEmpty(excludedPatterns, "'excludedPatterns' must not be empty");
|
||||
this.excludedPatterns = new String[excludedPatterns.length];
|
||||
for (int i = 0; i < excludedPatterns.length; i++) {
|
||||
this.excludedPatterns[i] = StringUtils.trimWhitespace(excludedPatterns[i]);
|
||||
this.excludedPatterns[i] = excludedPatterns[i].strip();
|
||||
}
|
||||
initExcludedPatternRepresentation(this.excludedPatterns);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user