Skip to content

Commit 0f23c6a

Browse files
stsypanovcl4es
authored andcommitted
8276926: Use String.valueOf() when initializing File.separator and File.pathSeparator
Reviewed-by: redestad, jlaskey
1 parent a0b8445 commit 0f23c6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/java.base/share/classes/java/io/File.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ int getPrefixLength() {
220220
* string for convenience. This string contains a single character, namely
221221
* {@link #separatorChar}.
222222
*/
223-
public static final String separator = "" + separatorChar;
223+
public static final String separator = String.valueOf(separatorChar);
224224

225225
/**
226226
* The system-dependent path-separator character. This field is
@@ -239,7 +239,7 @@ int getPrefixLength() {
239239
* for convenience. This string contains a single character, namely
240240
* {@link #pathSeparatorChar}.
241241
*/
242-
public static final String pathSeparator = "" + pathSeparatorChar;
242+
public static final String pathSeparator = String.valueOf(pathSeparatorChar);
243243

244244

245245
/* -- Constructors -- */

0 commit comments

Comments
 (0)