RFR: 8302979: (fs) Files usage of SUPPORTED_CHARSETS could be simplified

Julian Waters jwaters at openjdk.org
Wed Feb 22 07:05:31 UTC 2023


On Tue, 21 Feb 2023 11:20:01 GMT, Sergey Tsypanov <stsypanov at openjdk.org> wrote:

> Code of `Files.lines()` could be slightly simplified:
> 
> - use charsets instead of their names
> - use `Set.of()` instead of `HashSet` in `FileChannelLinesSpliterator`

Small nit before sponsoring, perhaps when initializing `SUPPORTED_CHARSETS`, have the charset instances use an indentation of 4 spaces instead of 8

Looks fine to me, doesn't seem like the Set used to store the supported charsets is concerned about having anything added to it, so this should pretty much behave the same as before as Alan said

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

Marked as reviewed by jwaters (Committer).

PR: https://git.openjdk.org/jdk/pull/12688


More information about the nio-dev mailing list