RFR: 8255576: (fs) Files.isHidden() throws ArrayIndexOutOfBoundsException (unix) [v2]
Alan Bateman
alanb at openjdk.java.net
Sat Oct 31 17:37:55 UTC 2020
On Sat, 31 Oct 2020 05:17:34 GMT, Christian Stein <cstein at openjdk.org> wrote:
>> test/jdk/java/nio/file/Files/Misc.java line 96:
>>
>>> 94: throw new AssertionError("8255576", exception);
>>> 95: }
>>> 96:
>>
>> Thanks for taking this one. The implementation changes are good.
>>
>> For the test then I don't think we need to catch AIOOB, the test should fail if any exception is thrown. I think think of any scenario where it would be sensible to run the tests when in a hidden directory so we could change this to test that isHidden returns false - do you agree?
>
>> For the test then I don't think we need to catch AIOOB, the test should fail if any exception is thrown.
>
> Okay, I'll change the catch clause to throw on any `RuntimeException` caught. Or is it also fine to omit the try-catch statements and not provide a specific failure message?
>
>> ... scenario where it would be sensible to run the tests when in a hidden directory ...
>
> What about testing that new scenario additionally to the plain one passing an empty `Path`?
>
> That new scenario would include:
> - create a hidden directory in platform-agnostic manner
> - start a test program using this directory as the working directory
> - assert (by checking the output of the test program?) isHidden returned false
Thanks for the update, I think I would put an assertFalse around this because the current directory shouldn't be hidden.
Creating a new VM that runs in a hidden directory is probably a stretch. I don't think it is strictly required here but don't object to reviewing any proposals if you are interested in spending time on it.
-------------
PR: https://git.openjdk.java.net/jdk/pull/952
More information about the nio-dev
mailing list