Skip to content

Commit 8904de2

Browse files
committed
Drive letter case alignment in addClassPathManifestEntries
Issue: SPR-16117 (cherry picked from commit a2f5e12)
1 parent 4208ec0 commit 8904de2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,11 @@ protected void addClassPathManifestEntries(Set<Resource> result) {
421421
javaClassPathProperty, System.getProperty("path.separator"))) {
422422
try {
423423
String filePath = new File(path).getAbsolutePath();
424+
int prefixIndex = filePath.indexOf(':');
425+
if (prefixIndex == 1) {
426+
// Possibly "c:" drive prefix on Windows, to be upper-cased for proper duplicate detection
427+
filePath = filePath.substring(0, 1).toUpperCase() + filePath.substring(1);
428+
}
424429
UrlResource jarResource = new UrlResource(ResourceUtils.JAR_URL_PREFIX +
425430
ResourceUtils.FILE_URL_PREFIX + filePath + ResourceUtils.JAR_URL_SEPARATOR);
426431
// Potentially overlapping with URLClassLoader.getURLs() result above!

0 commit comments

Comments
 (0)