Details
-
Type:
Enhancement
-
Status: Open
-
Priority:
P4
-
Resolution: Unresolved
-
Affects Version/s: 13, 14
-
Fix Version/s: None
-
Component/s: core-libs
-
Labels:
-
Subcomponent:
-
CPU:x86_64
-
OS:windows_10
Description
ADDITIONAL SYSTEM INFORMATION :
Windows 10
A DESCRIPTION OF THE PROBLEM :
sun.nio.fs.WindowsPathParser cannot correctly check the URI at the beginning of "\\.\".
When I forced sun.nio.fs.WindowsPathParser#isInvalidPathChar to return false, the target file was successfully generated.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
invoke: Files.createFile(Paths.get("\\\\.\\D:\\prn.xml"));
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
no exception
ACTUAL -
Exception in thread "main" java.nio.file.InvalidPathException: Illegal character [:] in path at index 5: \\.\D:\prn.xml
at java.base/sun.nio.fs.WindowsPathParser.nextSlash(WindowsPathParser.java:212)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:116)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:229)
at java.base/java.nio.file.Path.of(Path.java:147)
at java.base/java.nio.file.Paths.get(Paths.java:69)
---------- BEGIN SOURCE ----------
Files.createFile(Paths.get("\\\\.\\D:\\prn.xml"));
---------- END SOURCE ----------
FREQUENCY : always
Windows 10
A DESCRIPTION OF THE PROBLEM :
sun.nio.fs.WindowsPathParser cannot correctly check the URI at the beginning of "\\.\".
When I forced sun.nio.fs.WindowsPathParser#isInvalidPathChar to return false, the target file was successfully generated.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
invoke: Files.createFile(Paths.get("\\\\.\\D:\\prn.xml"));
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
no exception
ACTUAL -
Exception in thread "main" java.nio.file.InvalidPathException: Illegal character [:] in path at index 5: \\.\D:\prn.xml
at java.base/sun.nio.fs.WindowsPathParser.nextSlash(WindowsPathParser.java:212)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:116)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:229)
at java.base/java.nio.file.Path.of(Path.java:147)
at java.base/java.nio.file.Paths.get(Paths.java:69)
---------- BEGIN SOURCE ----------
Files.createFile(Paths.get("\\\\.\\D:\\prn.xml"));
---------- END SOURCE ----------
FREQUENCY : always