OSDN Git Service

Fix java.util.Random's constructors.
authorElliott Hughes <enh@google.com>
Thu, 25 Mar 2010 06:38:48 +0000 (23:38 -0700)
committerElliott Hughes <enh@google.com>
Thu, 25 Mar 2010 06:38:48 +0000 (23:38 -0700)
commitec7c8c98a4094580224eb9c400249c5c0984cf29
tree26bc5a6edaa403017c9cc56aaa1256612ea382f6
parentf87ab9616697b8bae08c5e8007cbdd0039a1f8ce
Fix java.util.Random's constructors.

Subclasses rely on having their overridden setSeed called by Random's
constructors, and the RI actually documents this behavior. (The
documentation even changed between Java 5 and Java 6 to make it _more_
explicit.)

This patch keeps that part of I6239d93bb46876ef1c4a5e155a6dc1ac6fab4eae
that improved our randomness, but reverts the attempt to fix Random's
uncouth behavior.

Also a regression test so we don't try to fix Random again in future.

Bug: 2502231
Change-Id: Ieea1009145c74eac9475c0cd5066dabad20eb114
libcore/luni/src/main/java/java/util/Random.java
libcore/luni/src/test/java/java/util/AllTests.java
libcore/luni/src/test/java/java/util/RandomTest.java [new file with mode: 0644]