Skip to content

Commit 1aea698

Browse files
committed
Merge branch '6.2.x'
2 parents db5505d + 725b02a commit 1aea698

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -813,17 +813,21 @@ protected Set<Resource> doFindPathMatchingJarResources(Resource rootDirResource,
813813
// Clean root entry path to match jar entries format without "!" separators
814814
rootEntryPath = rootEntryPath.replace(ResourceUtils.JAR_URL_SEPARATOR, "/");
815815
// Search sorted entries from first entry with rootEntryPath prefix
816+
boolean rootEntryPathFound = false;
816817
for (String entryPath : entriesCache.tailSet(rootEntryPath, false)) {
817818
if (!entryPath.startsWith(rootEntryPath)) {
818819
// We are beyond the potential matches in the current TreeSet.
819820
break;
820821
}
822+
rootEntryPathFound = true;
821823
String relativePath = entryPath.substring(rootEntryPath.length());
822824
if (getPathMatcher().match(subPattern, relativePath)) {
823825
result.add(rootDirResource.createRelative(relativePath));
824826
}
825827
}
826-
return result;
828+
if (rootEntryPathFound) {
829+
return result;
830+
}
827831
}
828832
}
829833

0 commit comments

Comments
 (0)