Skip to content

Commit

Permalink
Merge branch '6.1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed May 14, 2024
2 parents 376d783 + b7aafda commit 9516f87
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class AspectJExpressionPointcutTests {


@BeforeEach
public void setup() throws NoSuchMethodException {
void setup() throws NoSuchMethodException {
getAge = TestBean.class.getMethod("getAge");
setAge = TestBean.class.getMethod("setAge", int.class);
setSomeNumber = TestBean.class.getMethod("setSomeNumber", Number.class);
Expand Down Expand Up @@ -193,7 +193,7 @@ void testFriendlyErrorOnNoLocation3ArgMatching() {


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

Pointcut pointcut = getPointcut(expression);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public static boolean isEmpty(@Nullable Object str) {
*/
@Contract("null -> false")
public static boolean hasLength(@Nullable CharSequence str) {
return (str != null && str.length() > 0);
return (str != null && !str.isEmpty()); // as of JDK 15
}

/**
Expand Down Expand Up @@ -858,7 +858,7 @@ public static Locale parseLocale(String localeValue) {
if (!localeValue.contains("_") && !localeValue.contains(" ")) {
validateLocalePart(localeValue);
Locale resolved = Locale.forLanguageTag(localeValue);
if (resolved.getLanguage().length() > 0) {
if (!resolved.getLanguage().isEmpty()) {
return resolved;
}
}
Expand Down Expand Up @@ -1187,7 +1187,7 @@ public static String[] tokenizeToStringArray(
if (trimTokens) {
token = token.trim();
}
if (!ignoreEmptyTokens || token.length() > 0) {
if (!ignoreEmptyTokens || !token.isEmpty()) {
tokens.add(token);
}
}
Expand Down Expand Up @@ -1249,7 +1249,7 @@ public static String[] delimitedListToStringArray(
result.add(deleteAny(str.substring(pos, delPos), charsToDelete));
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.
result.add(deleteAny(str.substring(pos), charsToDelete));
}
Expand Down

0 comments on commit 9516f87

Please sign in to comment.