RFR: 8316557: Make fields final in 'sun.util' package
Chen Liang
liach at openjdk.org
Mon Sep 25 10:07:12 UTC 2023
On Mon, 25 Sep 2023 09:53:47 GMT, Glavo <duke at openjdk.org> wrote:
>> UTF8 decoder does not perform any internal state mutation during decoding; in addition, if this field is static final, the decoder's error actions are published when the class is initialized, while publishing in a final field does not guarantee the internal state of the charset is visible to other threads.
>
>> UTF8 decoder does not perform any internal state mutation during decoding;
>
> Are you sure? I think `CharsetDecoder::decode` will modify the `status` field.
right, it does have a `state` field.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15736#discussion_r1335672130
More information about the core-libs-dev
mailing list