8276926: Use String.valueOf() when initializing File.separator and File.pathSeparator

Reviewed-by: redestad, jlaskey
This commit is contained in:
Sergey Tsypanov 2021-11-10 12:46:30 +00:00 committed by Claes Redestad
parent a0b84453b0
commit 0f23c6a9fe

View File

@ -220,7 +220,7 @@ public class File
* string for convenience. This string contains a single character, namely
* {@link #separatorChar}.
*/
public static final String separator = "" + separatorChar;
public static final String separator = String.valueOf(separatorChar);
/**
* The system-dependent path-separator character. This field is
@ -239,7 +239,7 @@ public class File
* for convenience. This string contains a single character, namely
* {@link #pathSeparatorChar}.
*/
public static final String pathSeparator = "" + pathSeparatorChar;
public static final String pathSeparator = String.valueOf(pathSeparatorChar);
/* -- Constructors -- */