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

Reviewed-by: alanb, jwaters
This commit is contained in:
Sergey Tsypanov 2023-02-22 14:08:51 +00:00 committed by Julian Waters
parent 0d5f7439a4
commit 25bfed3b12
2 changed files with 8 additions and 11 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -4103,7 +4103,7 @@ public final class Files {
// 3) the file size is such that all bytes can be indexed by int values
// (this limitation is imposed by ByteBuffer)
if (path.getFileSystem() == FileSystems.getDefault() &&
FileChannelLinesSpliterator.SUPPORTED_CHARSET_NAMES.contains(cs.name())) {
FileChannelLinesSpliterator.SUPPORTED_CHARSETS.contains(cs)) {
FileChannel fc = FileChannel.open(path, StandardOpenOption.READ);
Stream<String> fcls = createFileChannelLinesStream(fc, cs);