mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
Polishing
This commit is contained in:
+2
-2
@@ -60,7 +60,7 @@ class AspectJExpressionPointcutTests {
|
|||||||
|
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() throws NoSuchMethodException {
|
void setup() throws NoSuchMethodException {
|
||||||
getAge = TestBean.class.getMethod("getAge");
|
getAge = TestBean.class.getMethod("getAge");
|
||||||
setAge = TestBean.class.getMethod("setAge", int.class);
|
setAge = TestBean.class.getMethod("setAge", int.class);
|
||||||
setSomeNumber = TestBean.class.getMethod("setSomeNumber", Number.class);
|
setSomeNumber = TestBean.class.getMethod("setSomeNumber", Number.class);
|
||||||
@@ -193,7 +193,7 @@ class AspectJExpressionPointcutTests {
|
|||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testMatchWithArgs() throws Exception {
|
void testMatchWithArgs() {
|
||||||
String expression = "execution(void org.springframework.beans.testfixture.beans.TestBean.setSomeNumber(Number)) && args(Double)";
|
String expression = "execution(void org.springframework.beans.testfixture.beans.TestBean.setSomeNumber(Number)) && args(Double)";
|
||||||
|
|
||||||
Pointcut pointcut = getPointcut(expression);
|
Pointcut pointcut = getPointcut(expression);
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ public abstract class StringUtils {
|
|||||||
* @see #hasText(CharSequence)
|
* @see #hasText(CharSequence)
|
||||||
*/
|
*/
|
||||||
public static boolean hasLength(@Nullable CharSequence str) {
|
public static boolean hasLength(@Nullable CharSequence str) {
|
||||||
return (str != null && str.length() > 0);
|
return (str != null && !str.isEmpty()); // as of JDK 15
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -853,7 +853,7 @@ public abstract class StringUtils {
|
|||||||
if (!localeValue.contains("_") && !localeValue.contains(" ")) {
|
if (!localeValue.contains("_") && !localeValue.contains(" ")) {
|
||||||
validateLocalePart(localeValue);
|
validateLocalePart(localeValue);
|
||||||
Locale resolved = Locale.forLanguageTag(localeValue);
|
Locale resolved = Locale.forLanguageTag(localeValue);
|
||||||
if (resolved.getLanguage().length() > 0) {
|
if (!resolved.getLanguage().isEmpty()) {
|
||||||
return resolved;
|
return resolved;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1182,7 +1182,7 @@ public abstract class StringUtils {
|
|||||||
if (trimTokens) {
|
if (trimTokens) {
|
||||||
token = token.trim();
|
token = token.trim();
|
||||||
}
|
}
|
||||||
if (!ignoreEmptyTokens || token.length() > 0) {
|
if (!ignoreEmptyTokens || !token.isEmpty()) {
|
||||||
tokens.add(token);
|
tokens.add(token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1244,7 +1244,7 @@ public abstract class StringUtils {
|
|||||||
result.add(deleteAny(str.substring(pos, delPos), charsToDelete));
|
result.add(deleteAny(str.substring(pos, delPos), charsToDelete));
|
||||||
pos = delPos + delimiter.length();
|
pos = delPos + delimiter.length();
|
||||||
}
|
}
|
||||||
if (str.length() > 0 && pos <= str.length()) {
|
if (!str.isEmpty() && pos <= str.length()) {
|
||||||
// Add rest of String, but not in case of empty input.
|
// Add rest of String, but not in case of empty input.
|
||||||
result.add(deleteAny(str.substring(pos), charsToDelete));
|
result.add(deleteAny(str.substring(pos), charsToDelete));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user