mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8290300: Use standard String-joining tools where applicable
Reviewed-by: naoto, rriggs, dfuchs
This commit is contained in:
parent
f9004fe443
commit
9a65524e2f
4 changed files with 6 additions and 18 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -704,11 +704,9 @@ class WindowsPath implements Path {
|
|||
if (beginIndex >= endIndex)
|
||||
throw new IllegalArgumentException();
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
StringJoiner sb = new StringJoiner("\\");
|
||||
for (int i = beginIndex; i < endIndex; i++) {
|
||||
sb.append(elementAsString(i));
|
||||
if (i != (endIndex-1))
|
||||
sb.append("\\");
|
||||
sb.add(elementAsString(i));
|
||||
}
|
||||
return new WindowsPath(getFileSystem(), WindowsPathType.RELATIVE, "", sb.toString());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue