RFR: 4847239: (spec) File.createTempFile() should make it clear that it doesn't create the temporary directory [v2]

Lance Andersen lancea at openjdk.java.net
Thu Jun 24 10:29:29 UTC 2021


On Wed, 23 Jun 2021 23:02:01 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Augment the specification of `java.io.File.createTempFile(String,String,File)` to clarify its behavior with respect to the `File` parameter `directory`.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   4847239: Add test

src/java.base/share/classes/java/io/File.java line 2116:

> 2114:      * abstract pathname is valid and denotes an existing directory, then the
> 2115:      * file will be created in that directory; otherwise, the file will not
> 2116:      * be created and an {@code IOException} will be thrown.  In no case will

I might suggest  reworking the 1st sentence as it is a tad long and we could probably reduce the 'then' usages.

Maybe instead of "In no case..." change to  "Under no circumstances ...."  Should it also indicate an IOException will be thrown if the directory does not exist?

-------------

PR: https://git.openjdk.java.net/jdk/pull/4561


More information about the core-libs-dev mailing list