RFR: 8361587: AssertionError in File.listFiles() when path is empty and -esa is enabled [v3]

Brian Burkhalter bpb at openjdk.org
Thu Jul 10 15:26:20 UTC 2025


On Thu, 10 Jul 2025 14:18:31 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8361587: Expand test coverage of File methods
>
> test/jdk/java/io/File/EmptyPath.java line 112:
> 
>> 110:     @Test
>> 111:     public void getAbsoluteFile() {
>> 112:         assertEquals(p.toAbsolutePath(), f.getAbsoluteFile().toPath());
> 
> I think it would be better to have the "actual" be f.getAbsoluteFile(), so the expected will be p.toAbsolutePath().toFile().
> 
> Same comment on the getCanonicalFile test.

So changed in 51e3701 and 2e42c99.

> test/jdk/java/io/File/EmptyPath.java line 229:
> 
>> 227:         child.deleteOnExit();
>> 228: 
>> 229:         assertTrue(Arrays.asList(f.list()).contains(child.getName()));
> 
> I think would be clearer to check that ioSet contains child.getName.

So changed in 51e3701.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26224#discussion_r2198051943
PR Review Comment: https://git.openjdk.org/jdk/pull/26224#discussion_r2198052617


More information about the core-libs-dev mailing list