@ -41,7 +41,6 @@ import java.nio.file.Path;
@@ -41,7 +41,6 @@ import java.nio.file.Path;
import java.util.Collections ;
import java.util.Enumeration ;
import java.util.HashSet ;
import java.util.Iterator ;
import java.util.LinkedHashSet ;
import java.util.Map ;
import java.util.NavigableSet ;
@ -937,14 +936,10 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
@@ -937,14 +936,10 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
}
Set < Resource > result = new LinkedHashSet < > ( 64 ) ;
NavigableSet < String > entriesCache = new TreeSet < > ( ) ;
Iterator < String > entryIterator = jarFile . stream ( ) . map ( JarEntry : : getName ) . sorted ( ) . iterator ( ) ;
while ( entryIterator . hasNext ( ) ) {
String entryPath = entryIterator . next ( ) ;
int entrySeparatorIndex = entryPath . indexOf ( ResourceUtils . JAR_URL_SEPARATOR ) ;
if ( entrySeparatorIndex > = 0 ) {
entryPath = entryPath . substring ( entrySeparatorIndex + ResourceUtils . JAR_URL_SEPARATOR . length ( ) ) ;
}
entriesCache . add ( entryPath ) ;
for ( Enumeration < JarEntry > entries = jarFile . entries ( ) ; entries . hasMoreElements ( ) ; ) {
entriesCache . add ( entries . nextElement ( ) . getName ( ) ) ;
}
for ( String entryPath : entriesCache ) {
if ( entryPath . startsWith ( rootEntryPath ) ) {
String relativePath = entryPath . substring ( rootEntryPath . length ( ) ) ;
if ( getPathMatcher ( ) . match ( subPattern , relativePath ) ) {