Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
FULL PRODUCT VERSION : java version "1.6.0-rc" Java(TM) SE Runtime Environment (build 1.6.0-rc-b95) Java HotSpot(TM) Server VM (build 1.6.0-rc-b95, mixed mode) ADDITIONAL OS VERSION INFORMATION : Linux xxxxxx 2.6.16 #2 SMP Mon Mar 27 17:30:45 CEST 2006 x86_64 GNU/Linux A DESCRIPTION OF THE PROBLEM : Math.random() and Math.initRNG() uses DCL (double checked locking) on " private static Random randomNumberGenerator". Breaks in a multi processor environment, resulting in a NPE. EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - Init field "private static Random randomNumberGenerator" in static initializer ERROR MESSAGES/STACK TRACES THAT OCCUR : Spurius NullPointerException REPRODUCIBILITY : This bug can be reproduced rarely. CUSTOMER SUBMITTED WORKAROUND : Do not use Math.random
|