Skip to content

Commit db9a10b

Browse files
authored
Use String.startsWith() instead of substring() in PatternMatchUtils
Closes gh-26822
1 parent 27bfcbb commit db9a10b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -68,7 +68,7 @@ public static boolean simpleMatch(@Nullable String pattern, @Nullable String str
6868
}
6969

7070
return (str.length() >= firstIndex &&
71-
pattern.substring(0, firstIndex).equals(str.substring(0, firstIndex)) &&
71+
pattern.startsWith(str.substring(0, firstIndex)) &&
7272
simpleMatch(pattern.substring(firstIndex), str.substring(firstIndex)));
7373
}
7474

0 commit comments

Comments
 (0)