RFR: 8201494: Avoid early initialization of java.nio.Bits

Alan Bateman Alan.Bateman at oracle.com
Thu Apr 12 14:58:14 UTC 2018


On 12/04/2018 15:33, Claes Redestad wrote:
> Hi,
>
> we initialize a couple of HeapByteBuffer during System.initPhase1 (due 
> System.out/in), which right now pulls in java.nio.Bits and a few other 
> dependent classes (AtomicLong...). This can be avoided by removing 
> Bits.unsafe() and moving the read of native byte order from Bits to 
> ByteOrder, which all in all seems like a nice cleanup.
>
> Webrev: http://cr.openjdk.java.net/~redestad/8201494/open.00/
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8201494
This looks okay to me, I don't see any issues.

A minor nit is to use the existing style for NATIVE_ORDER (4 space 
indent, not 8).

-Alan


More information about the nio-dev mailing list