7023034: Files.createTempDirectory((Path)null, "temp") does not throw NPE

Rémi Forax forax at univ-mlv.fr
Tue Mar 1 03:06:41 PST 2011

  Le 01/03/2011 11:06, Alan Bateman a écrit :
> A small oversight in the implementation of Files.createTempFile and 
> createTempDirectory. If the temporary directory is specified as null 
> then NPE should be thrown. The webrev with the changes is here:
>  http://cr.openjdk.java.net/~alanb/7023034/webrev/
> Thanks,
> Alan.

Hi Alan,
In the test, you test twice the same thing.

Files.createTempFile("blah", ".tmp", (FileAttribute<?>)null);

should be:

Files.createTempFile("blah", ".tmp", (FileAttribute<?>[])null);

otherwise it's Ok.


More information about the nio-dev mailing list