mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
8256461: AbstractFileSystemProvider.getSunPathForSocketCall for empty Path returns '.'
Reviewed-by: dfuchs, alanb
This commit is contained in:
parent
d30956055b
commit
6948456dbf
5 changed files with 60 additions and 3 deletions
|
@ -46,7 +46,7 @@ import static sun.nio.fs.WindowsConstants.*;
|
|||
class WindowsFileSystemProvider
|
||||
extends AbstractFileSystemProvider
|
||||
{
|
||||
private static final Unsafe unsafe = Unsafe.getUnsafe();
|
||||
private static final byte[] EMPTY_PATH = new byte[0];
|
||||
|
||||
private final WindowsFileSystem theFileSystem;
|
||||
|
||||
|
@ -628,7 +628,7 @@ class WindowsFileSystemProvider
|
|||
public byte[] getSunPathForSocketFile(Path obj) {
|
||||
WindowsPath file = WindowsPath.toWindowsPath(obj);
|
||||
String s = file.toString();
|
||||
return s.getBytes(StandardCharsets.UTF_8);
|
||||
return s.isEmpty() ? EMPTY_PATH : s.getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue