test/compiler/types/correctness/OffTest.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff test/compiler/types/correctness/OffTest.java

test/compiler/types/correctness/OffTest.java

Print this page
rev 7259 : 8044186: Introduce a reproducible random generator
Reviewed-by: iignatyev
Contributed-by: sergei.kovalev@oracle.com

*** 34,46 **** * @run main/timeout=1200 OffTest */ import com.oracle.java.testlibrary.OutputAnalyzer; import com.oracle.java.testlibrary.ProcessTools; ! import scenarios.ProfilingType; ! import java.util.Random; public class OffTest { private static final String[] OPTIONS = { "-Xbootclasspath/a:.", "-XX:+IgnoreUnrecognizedVMOptions", --- 34,46 ---- * @run main/timeout=1200 OffTest */ import com.oracle.java.testlibrary.OutputAnalyzer; import com.oracle.java.testlibrary.ProcessTools; ! import com.oracle.java.testlibrary.Utils; import java.util.Random; + import scenarios.ProfilingType; public class OffTest { private static final String[] OPTIONS = { "-Xbootclasspath/a:.", "-XX:+IgnoreUnrecognizedVMOptions",
*** 61,78 **** private static final int TYPE_PROFILE_LEVEL_BOUND = 3; private static final int DEFAULT_COUNT = 10; private static final int PROFILING_TYPE_INDEX = OPTIONS.length - 1; private static final int TYPE_PROFILE_INDEX = OPTIONS.length - 4; private static final int USE_TYPE_SPECULATION_INDEX = OPTIONS.length - 3; ! private static final Random RNG; ! ! static { ! String str = System.getProperty("seed"); ! long seed = str != null ? Long.parseLong(str) : new Random().nextLong(); ! RNG = new Random(seed); ! System.out.printf("-Dseed=%d%n", seed); ! } public static void main(String[] args) throws Exception { int count = DEFAULT_COUNT; if (args.length > 0) { count = Integer.parseInt(args[0]) ; --- 61,71 ---- private static final int TYPE_PROFILE_LEVEL_BOUND = 3; private static final int DEFAULT_COUNT = 10; private static final int PROFILING_TYPE_INDEX = OPTIONS.length - 1; private static final int TYPE_PROFILE_INDEX = OPTIONS.length - 4; private static final int USE_TYPE_SPECULATION_INDEX = OPTIONS.length - 3; ! private static final Random RNG = Utils.getRandomInstance(); public static void main(String[] args) throws Exception { int count = DEFAULT_COUNT; if (args.length > 0) { count = Integer.parseInt(args[0]) ;
test/compiler/types/correctness/OffTest.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File