Random has its state in an AtomicLong, which should be final so that
no threads see it as uninitialized.
Doug Lea writes:
David Holmes wrote:
>> Hi Doug,
>>
>> This is a link to the java.net forums for mustang.
>>
>> http://forums.java.net/jive/thread.jspa?threadID=2443&tstart=0
>>
Yup. The seed field ought to be declared final.
I bet the reason that it wasn't (when the internal sun.AtomicLong was used, in
1.4) was the need to set in readObject. Which had no solution
until 1.5, but no one noticed (It probably should have been us when
converting to use j.u.c.a.AtomicLong).
Coping requires an ugly unsafe.putObjectVolatile.