On Sat, 15 Apr 2023 05:43:09 GMT, Alan Bateman <[email protected]> wrote:
>> Lance Andersen has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> re-arrage assertEquals params
>
> test/jdk/jdk/nio/zipfs/ZipFSDirectoryExceptionMessageTest.java line 96:
>
>> 94: var file = zipfs.getPath(DIRECTORY_NAME);
>> 95: var x = assertThrows(FileSystemException.class, () ->
>> Files.newInputStream(file));
>> 96: assertEquals(DIR_EXCEPTION_MESSAGE, x.getMessage());
>
> FYI, test doesn't need to depend the exception message. Checking
> FileSystemException::getOtherFile returns null would be a more robust way of
> checking that it didn't provide a second file by mistake, e.g.
>
> try {
> Files.newInputStream(DIRECTORY_NAME);
> fail();
> } catch (FileSystemException e) {
> assertNull(e.getOtherFile());
> } catch (IOException ioe) {
> // allowed
> }
added validation for other file being null but also kept the existing
validation of the message
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13482#discussion_r1167471233