File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
main/java/org/springframework/util
test/java/org/springframework/util Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2019 the original author or authors.
2
+ * Copyright 2002-2020 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -701,6 +701,10 @@ else if (TOP_PATH.equals(element)) {
701
701
}
702
702
}
703
703
704
+ // All path elements stayed the same - shortcut
705
+ if (pathArray .length == pathElements .size ()) {
706
+ return prefix + pathToUse ;
707
+ }
704
708
// Remaining top paths need to be retained.
705
709
for (int i = 0 ; i < tops ; i ++) {
706
710
pathElements .add (0 , TOP_PATH );
Original file line number Diff line number Diff line change @@ -399,6 +399,7 @@ void cleanPath() {
399
399
assertThat (StringUtils .cleanPath ("file:../" )).isEqualTo ("file:../" );
400
400
assertThat (StringUtils .cleanPath ("file:./../" )).isEqualTo ("file:../" );
401
401
assertThat (StringUtils .cleanPath ("file:.././" )).isEqualTo ("file:../" );
402
+ assertThat (StringUtils .cleanPath ("file:/mypath/spring.factories" )).isEqualTo ("file:/mypath/spring.factories" );
402
403
assertThat (StringUtils .cleanPath ("file:///c:/some/../path/the%20file.txt" )).isEqualTo ("file:///c:/path/the%20file.txt" );
403
404
}
404
405
You can’t perform that action at this time.
0 commit comments