Skip to content

Commit c0f1627

Browse files
committed
Merge 1.16 into 1.18
2 parents 61ce2e7 + 2946b3a commit c0f1627

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

common/src/main/java/org/embeddedt/modernfix/resources/CachedResourcePath.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ public CachedResourcePath(String[] prefixElements, CachedResourcePath other) {
6161
* DOES NOT INTERN!
6262
*/
6363
public CachedResourcePath(String[] pathComponents) {
64+
for(String s : pathComponents) {
65+
if(s.length() == 0) {
66+
// reconstruct the whole array skipping blanks. inefficient, but should not be the common case
67+
pathComponents = Arrays.stream(pathComponents).filter(comp -> comp.length() > 0).toArray(String[]::new);
68+
break;
69+
}
70+
}
6471
this.pathComponents = pathComponents;
6572
}
6673

0 commit comments

Comments
 (0)