JDK-6271215 : Remove static reference to Random in java.util.Collections
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-05-16
  • Updated: 2021-03-03
  • Resolved: 2005-06-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b39Fixed
Related Reports
Relates :  
Description
java.util.Collections contains a static java.util.Random reference initialized in Collections' static initializer which causes a significant amount of other initialization code to be run, including sun.misc.AtomicLong's static initializer and some reflection code. Because this Random object is used only in fairly esoteric situations (for java.util.Collections.shuffle(List), this Random object should be initialized lazily. There is no performance improvement to be gained with this change, only a simplification of the bootstrapping sequence of the core libraries.

###@###.### 2005-05-16 22:30:16 GMT
###@###.### 2005-05-16 22:32:36 GMT

Comments
EVALUATION This has been fixed by initializing the Random object more lazily. Note that this does not allow the test case in 6270512 to run, but should allow some other changes to the bootstrapping sequence to run successfully. ###@###.### 2005-05-16 23:21:23 GMT
16-05-2005