Skip to content

Commit 9516f87

Browse files
committed
Merge branch '6.1.x'
2 parents 376d783 + b7aafda commit 9516f87

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJExpressionPointcutTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class AspectJExpressionPointcutTests {
6060

6161

6262
@BeforeEach
63-
public void setup() throws NoSuchMethodException {
63+
void setup() throws NoSuchMethodException {
6464
getAge = TestBean.class.getMethod("getAge");
6565
setAge = TestBean.class.getMethod("setAge", int.class);
6666
setSomeNumber = TestBean.class.getMethod("setSomeNumber", Number.class);
@@ -193,7 +193,7 @@ void testFriendlyErrorOnNoLocation3ArgMatching() {
193193

194194

195195
@Test
196-
void testMatchWithArgs() throws Exception {
196+
void testMatchWithArgs() {
197197
String expression = "execution(void org.springframework.beans.testfixture.beans.TestBean.setSomeNumber(Number)) && args(Double)";
198198

199199
Pointcut pointcut = getPointcut(expression);

spring-core/src/main/java/org/springframework/util/StringUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public static boolean isEmpty(@Nullable Object str) {
125125
*/
126126
@Contract("null -> false")
127127
public static boolean hasLength(@Nullable CharSequence str) {
128-
return (str != null && str.length() > 0);
128+
return (str != null && !str.isEmpty()); // as of JDK 15
129129
}
130130

131131
/**
@@ -858,7 +858,7 @@ public static Locale parseLocale(String localeValue) {
858858
if (!localeValue.contains("_") && !localeValue.contains(" ")) {
859859
validateLocalePart(localeValue);
860860
Locale resolved = Locale.forLanguageTag(localeValue);
861-
if (resolved.getLanguage().length() > 0) {
861+
if (!resolved.getLanguage().isEmpty()) {
862862
return resolved;
863863
}
864864
}
@@ -1187,7 +1187,7 @@ public static String[] tokenizeToStringArray(
11871187
if (trimTokens) {
11881188
token = token.trim();
11891189
}
1190-
if (!ignoreEmptyTokens || token.length() > 0) {
1190+
if (!ignoreEmptyTokens || !token.isEmpty()) {
11911191
tokens.add(token);
11921192
}
11931193
}
@@ -1249,7 +1249,7 @@ public static String[] delimitedListToStringArray(
12491249
result.add(deleteAny(str.substring(pos, delPos), charsToDelete));
12501250
pos = delPos + delimiter.length();
12511251
}
1252-
if (str.length() > 0 && pos <= str.length()) {
1252+
if (!str.isEmpty() && pos <= str.length()) {
12531253
// Add rest of String, but not in case of empty input.
12541254
result.add(deleteAny(str.substring(pos), charsToDelete));
12551255
}

0 commit comments

Comments
 (0)