RFR: 8153334: Replace BufferedInputStreams use of AtomicReferenceFieldUpdater with Unsafe

Claes Redestad claes.redestad at oracle.com
Sun Apr 3 20:39:26 UTC 2016

On 04/03/2016 04:55 PM, Alan Bateman wrote:
> On 03/04/2016 13:19, Claes Redestad wrote:
>> Hi Remi,
>> On 2016-04-03 13:57, Remi Forax wrote:
>>> Hi Claes,
>>> the patch is fine for me with the minor nitpick that the static 
>>> final containing Unsafe should be called UNSAFE and not just U.
>> sure, I copied the setup/naming convention from ConcurrentHashMap, 
>> but UNSAFE does make it stand out better.
>>> do you know why BufferedInputStream is loaded in first place during 
>>> the startup of the VM ?
>> given the output of -Xlog:classload I think it's first used by 
>> java.lang.System for what becomes System.in.
> Yes, initPhase1 (or what used to be initializeSystemClass) will be the 
> first usage.
> I skimmed the webrev, looks okay to me. I think I would import 
> jdk.internal.misc.Unsafe rather than using the fully qualified class 
> name twice. That will also avoid the line break.
> -Alan

Thanks for looking at this, Alan!

Cleaned things up here: 


More information about the core-libs-dev mailing list