File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
spring-core/src/main/java/org/springframework/util Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,8 @@ public abstract class StringUtils {
72
72
73
73
private static final String WINDOWS_FOLDER_SEPARATOR = "\\ " ;
74
74
75
+ private static final char WINDOWS_FOLDER_SEPARATOR_CHAR = '\\' ;
76
+
75
77
private static final String DOUBLE_BACKSLASHES = "\\ \\ " ;
76
78
77
79
private static final String TOP_PATH = ".." ;
@@ -712,7 +714,7 @@ public static String cleanPath(String path) {
712
714
713
715
String normalizedPath ;
714
716
// Optimize when there is no backslash
715
- if (path .indexOf ('\\' ) != -1 ) {
717
+ if (path .indexOf (WINDOWS_FOLDER_SEPARATOR_CHAR ) != -1 ) {
716
718
normalizedPath = replace (path , DOUBLE_BACKSLASHES , FOLDER_SEPARATOR );
717
719
normalizedPath = replace (normalizedPath , WINDOWS_FOLDER_SEPARATOR , FOLDER_SEPARATOR );
718
720
}
@@ -722,7 +724,7 @@ public static String cleanPath(String path) {
722
724
String pathToUse = normalizedPath ;
723
725
724
726
// Shortcut if there is no work to do
725
- if (pathToUse .indexOf ('.' ) == -1 ) {
727
+ if (pathToUse .indexOf (EXTENSION_SEPARATOR ) == -1 ) {
726
728
return pathToUse ;
727
729
}
728
730
You can’t perform that action at this time.
0 commit comments