RFR [10]: 8185362: Replace use of AtomicReferenceFieldUpdater from BufferedInputStream with Unsafe

Aleksey Shipilev shade at redhat.com
Mon Aug 21 10:29:52 UTC 2017

On 08/21/2017 12:20 PM, Claes Redestad wrote:
> Webrev: http://cr.openjdk.java.net/~redestad/8185362/jdk.00/

*) Should be static *final*, otherwise you miss constant folding for Unsafe accesses:

  66     private static long BUF_OFFSET = U.objectFieldOffset(BufferedInputStream.class, "buf");

*) While you are at it, maybe switch to proper Java style here, e.g. "volatile byte[] buf"?

  73     protected volatile byte buf[];


More information about the core-libs-dev mailing list