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 11/*
2- * Copyright 2002-2019 the original author or authors.
2+ * Copyright 2002-2020 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -701,6 +701,10 @@ else if (TOP_PATH.equals(element)) {
701701 }
702702 }
703703
704+ // All path elements stayed the same - shortcut
705+ if (pathArray .length == pathElements .size ()) {
706+ return prefix + pathToUse ;
707+ }
704708 // Remaining top paths need to be retained.
705709 for (int i = 0 ; i < tops ; i ++) {
706710 pathElements .add (0 , TOP_PATH );
Original file line number Diff line number Diff line change @@ -399,6 +399,7 @@ void cleanPath() {
399399 assertThat (StringUtils .cleanPath ("file:../" )).isEqualTo ("file:../" );
400400 assertThat (StringUtils .cleanPath ("file:./../" )).isEqualTo ("file:../" );
401401 assertThat (StringUtils .cleanPath ("file:.././" )).isEqualTo ("file:../" );
402+ assertThat (StringUtils .cleanPath ("file:/mypath/spring.factories" )).isEqualTo ("file:/mypath/spring.factories" );
402403 assertThat (StringUtils .cleanPath ("file:///c:/some/../path/the%20file.txt" )).isEqualTo ("file:///c:/path/the%20file.txt" );
403404 }
404405
You can’t perform that action at this time.
0 commit comments