RFR: 8361587: AssertionError in File.listFiles() when path is empty and -esa is enabled [v2]
Brian Burkhalter
bpb at openjdk.org
Wed Jul 9 18:35:54 UTC 2025
On Wed, 9 Jul 2025 18:16:44 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: Clean up listFiles sub-test per suggestions
>
> test/jdk/java/io/File/EmptyPath.java line 216:
>
>> 214: List<String> ioNames =
>> 215: Arrays.asList(files).stream().map(f -> f.toString()).toList();
>> 216: Set<String> ioSet = new HashSet(ioNames);
>
> You can simplify this by collecting into the set, e.g.
>
> Set<String> ioSet = Arrays.stream(files)
> .map(File::getName)
> .collect(Collectors.toSet());
So changed in 76b4439.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26224#discussion_r2195723230
More information about the core-libs-dev
mailing list