-
Bug
-
Resolution: Fixed
-
P4
-
8, 11, 15, 16
-
b23
-
x86_64
-
generic
-
Verified
A DESCRIPTION OF THE PROBLEM :
First argument of java.nio.file.Paths.get(String first, String... more) method allows null parameter and transforms it to "null" string.
Example code:
java.nio.file.Path path = java.nio.file.Paths.get(null, "a");
System.out.println(path);
System.out.println(path.toAbsolutePath());
Output:
null\a
c:\Program Files\Java\jdk-15\bin\null\a
Looks like a bug for me.
Also JavaDoc for java.nio.file package state "Unless otherwise noted, passing a null argument to a constructor or method of any class or interface in this package will cause a NullPointerException to be thrown.".
FREQUENCY : always
First argument of java.nio.file.Paths.get(String first, String... more) method allows null parameter and transforms it to "null" string.
Example code:
java.nio.file.Path path = java.nio.file.Paths.get(null, "a");
System.out.println(path);
System.out.println(path.toAbsolutePath());
Output:
null\a
c:\Program Files\Java\jdk-15\bin\null\a
Looks like a bug for me.
Also JavaDoc for java.nio.file package state "Unless otherwise noted, passing a null argument to a constructor or method of any class or interface in this package will cause a NullPointerException to be thrown.".
FREQUENCY : always
- csr for
-
JDK-8255997 (fs) NullPointerException not thrown when first argument to Path.of or Paths.get is null
- Closed
- relates to
-
JDK-8255855 appcds/jigsaw/NewModuleFinderTest.java test failed due to unexpected NPE
- Closed