RFR: 8358533: Improve performance of java.io.Reader.readAllLines [v3]

Brian Burkhalter bpb at openjdk.org
Tue Jun 24 18:55:35 UTC 2025


On Wed, 18 Jun 2025 02:25:03 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8358533: Init StringBuilder to size zero; use StringBuilder.isEmpty()
>
> src/java.base/share/classes/java/io/Reader.java line 453:
> 
>> 451:         char[] cb = new char[TRANSFER_BUFFER_SIZE];
>> 452:         int pos = 0;
>> 453:         List<String> lines = new ArrayList<String>();
> 
> Suggestion:
> 
>         List<String> lines = new ArrayList<>();

So changed in [d5abfa4](https://github.com/openjdk/jdk/pull/25863/commits/d5abfa450cb3fcd604560833038735e41952bce9).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25863#discussion_r2164683062


More information about the core-libs-dev mailing list