Skip to content

Commit fad2068

Browse files
committed
Merge branch '6.2.x'
2 parents 1f2948f + 3a61460 commit fad2068

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
import java.util.Collections;
4242
import java.util.Enumeration;
4343
import java.util.HashSet;
44-
import java.util.Iterator;
4544
import java.util.LinkedHashSet;
4645
import java.util.Map;
4746
import java.util.NavigableSet;
@@ -934,14 +933,10 @@ protected Set<Resource> doFindPathMatchingJarResources(Resource rootDirResource,
934933
}
935934
Set<Resource> result = new LinkedHashSet<>(64);
936935
NavigableSet<String> entriesCache = new TreeSet<>();
937-
Iterator<String> entryIterator = jarFile.stream().map(JarEntry::getName).sorted().iterator();
938-
while (entryIterator.hasNext()) {
939-
String entryPath = entryIterator.next();
940-
int entrySeparatorIndex = entryPath.indexOf(ResourceUtils.JAR_URL_SEPARATOR);
941-
if (entrySeparatorIndex >= 0) {
942-
entryPath = entryPath.substring(entrySeparatorIndex + ResourceUtils.JAR_URL_SEPARATOR.length());
943-
}
944-
entriesCache.add(entryPath);
936+
for (Enumeration<JarEntry> entries = jarFile.entries(); entries.hasMoreElements();) {
937+
entriesCache.add(entries.nextElement().getName());
938+
}
939+
for (String entryPath : entriesCache) {
945940
if (entryPath.startsWith(rootEntryPath)) {
946941
String relativePath = entryPath.substring(rootEntryPath.length());
947942
if (getPathMatcher().match(subPattern, relativePath)) {

0 commit comments

Comments
 (0)