From c489234cc2f3eb70b218005168c5fc6dce4c592a Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 14 Nov 2023 14:39:20 +0100 Subject: [PATCH] Polish contribution See gh-31598 See gh-31603 (cherry picked from commit e71117dcdf8c713b0a364d896ea2221183eac64b) --- .../io/support/PathMatchingResourcePatternResolver.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 6f8371f4a76..1bb7e3f15c4 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -429,8 +429,8 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol String filePath = new File(path).getAbsolutePath(); int prefixIndex = filePath.indexOf(':'); if (prefixIndex == 1) { - // Possibly "c:" drive prefix on Windows, to be upper-cased for proper duplicate detection - // to resolve find duplicate jar resource on windows + // Possibly a drive prefix on Windows (for example, "c:"), so we prepend a slash + // and convert the drive letter to uppercase for consistent duplicate detection. filePath = "/" + StringUtils.capitalize(filePath); } // # can appear in directories/filenames, java.net.URL should not treat it as a fragment