RFR: 8299187: Ensure safe publication of name in ByteOrder

David Holmes dholmes at openjdk.org
Wed Dec 21 09:48:48 UTC 2022


On Wed, 21 Dec 2022 09:29:59 GMT, Per Minborg <pminborg at openjdk.org> wrote:

> This PR proposes to declare the field  `ByteOrder.name` `final`. 
> 
> This will ensure the class is thread safe and is using safe publication.

This change is harmless but not strictly necessary. The only construction of ByteOrder instances is within the ByteOrder class as static final fields, hence class initialization semantics ensures they are safely published.

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

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


More information about the nio-dev mailing list