RFR: 4847239: (spec) File.createTempFile() should make it clear that it doesn't create the temporary directory [v2]
Brian Burkhalter
bpb at openjdk.java.net
Thu Jun 24 18:43:06 UTC 2021
On Thu, 24 Jun 2021 17:40:55 GMT, Naoto Sato <naoto at openjdk.org> wrote:
>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 4847239: Add test
>
> test/jdk/java/io/File/createTempFile/TargetDirectory.java line 58:
>
>> 56: if (Files.getFileStore(dir).supportsFileAttributeView("posix")) {
>> 57: PosixFileAttributeView view =
>> 58: (PosixFileAttributeView)Files.getFileAttributeView(dir,
>
> Casting seems not needed.
Yes, I think you are correct.
> test/jdk/java/io/File/createTempFile/TargetDirectory.java line 83:
>
>> 81: try {
>> 82: File.createTempFile("readonly", null, target);
>> 83: throw new RuntimeException("Exception not thrown");
>
> Probably replacing the message `Exception not thrown` with a more explanatory one would help, as there are other locations below, which could throw the same message.
I was not sure a message was even needed as one can identify what is happening by the line number in the stack trace. Probably clear messages would be better though.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4561
More information about the core-libs-dev
mailing list