RFR: 8300979: Lazily initialize (byte, char)arr in java.io.DataInputStream [v3]

Per Minborg pminborg at openjdk.org
Wed Mar 22 10:12:29 UTC 2023


On Tue, 21 Mar 2023 16:17:35 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>> 
>>  - Merge branch 'dis-lazy' of https://github.com/minborg/jdk into dis-lazy
>>  - Update src/java.base/share/classes/java/io/DataInputStream.java
>>    
>>    Co-authored-by: Eirik Bjorsnos <eirbjo at gmail.com>
>>  - Merge branch 'master' into dis-lazy
>>  - Remove redundant initilizers
>>  - Lazily initialize (byte, char)arr in java.io.DataInputStream
>
> src/java.base/share/classes/java/io/DataInputStream.java line 64:
> 
>> 62:      * working arrays initialized on demand by readUTF
>> 63:      */
>> 64:     private byte[] bytearr;
> 
> Could the `bytearr` and `chararr` instance variables be removed altogether?

They could but I think that would be under a separate PR. Feel free to raise an issue.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13121#discussion_r1144532801


More information about the core-libs-dev mailing list