Details
-
Enhancement
-
Resolution: Fixed
-
P3
-
9
-
b39
-
Verified
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8084184 | emb-9 | Alan Bateman | P3 | Resolved | Fixed | team |
Description
Unexpected NPE is thrown in cases when null passed as element of options array, for example
Files.newBufferedWriter(myPath, new OpenOption[]{null})
Files.newBufferedWriter(myPath, new OpenOption[]{null, StandardOpenOption.CREATE})
java.nio.file package's spec (http://jre.us.oracle.com/java/re/jdk/9/promoted/all/b35/docs/api/java/nio/file/package-summary.html
) says that
"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.
Additionally, invoking a method with a collection containing a null element will cause a NullPointerException, unless otherwise specified."
As we think it would be great to specify that NPE will be thrown in case of null-elements in array too.
Tested with JDK9b35
Failed JCK tests is under development
Files.newBufferedWriter(myPath, new OpenOption[]{null})
Files.newBufferedWriter(myPath, new OpenOption[]{null, StandardOpenOption.CREATE})
java.nio.file package's spec (http://jre.us.oracle.com/java/re/jdk/9/promoted/all/b35/docs/api/java/nio/file/package-summary.html
) says that
"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.
Additionally, invoking a method with a collection containing a null element will cause a NullPointerException, unless otherwise specified."
As we think it would be great to specify that NPE will be thrown in case of null-elements in array too.
Tested with JDK9b35
Failed JCK tests is under development
Attachments
Issue Links
- backported by
-
JDK-8084184 (fs spec) Package description could be clearer on the cases where NPE is thrown
-
- Resolved
-
- csr of
-
CCC-8062632 (fs spec) Package description could be clearer on the cases where NPE is thrown
-
- Closed
-