From 2df8ea94e0c74015e14e738709422cc3a56e65f7 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 31 Jan 2025 22:26:14 +0100 Subject: [PATCH] Clean root entry path to match jar entries format in cache Closes gh-34348 --- .../core/io/support/PathMatchingResourcePatternResolver.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java b/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java index a6899040fdf2..0728257ddb35 100644 --- a/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java +++ b/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java @@ -813,6 +813,8 @@ protected Set doFindPathMatchingJarResources(Resource rootDirResource, NavigableSet entriesCache = this.jarEntriesCache.get(jarFileUrl); if (entriesCache != null) { Set result = new LinkedHashSet<>(64); + // Clean root entry path to match jar entries format without "!" separators + rootEntryPath = rootEntryPath.replace(ResourceUtils.JAR_URL_SEPARATOR, "/"); // Search sorted entries from first entry with rootEntryPath prefix for (String entryPath : entriesCache.tailSet(rootEntryPath, false)) { if (!entryPath.startsWith(rootEntryPath)) {