changeset 1132:895e0d39a824

7901303: Profiler methods should not be called in a random order Summary: stick them in the LinkedHashSet.
author shade
date Fri, 13 Feb 2015 16:55:17 +0300
parents f4bcdb5ff6c4
children 6275d42f1bc3
files jmh-core/src/main/java/org/openjdk/jmh/runner/options/CommandLineOptions.java jmh-core/src/main/java/org/openjdk/jmh/runner/options/OptionsBuilder.java
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/options/CommandLineOptions.java	Fri Feb 13 15:57:47 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/options/CommandLineOptions.java	Fri Feb 13 16:55:17 2015 +0300
@@ -42,6 +42,7 @@
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
@@ -66,7 +67,7 @@
     private final Optional<Boolean> gcEachIteration;
     private final Optional<VerboseMode> verbose;
     private final Optional<Boolean> failOnError;
-    private final Set<Class<? extends Profiler>> profilers = new HashSet<Class<? extends Profiler>>();
+    private final Set<Class<? extends Profiler>> profilers = new LinkedHashSet<Class<? extends Profiler>>();
     private final Optional<TimeUnit> timeUnit;
     private final Optional<Integer> opsPerInvocation;
     private final List<String> regexps = new ArrayList<String>();
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/options/OptionsBuilder.java	Fri Feb 13 15:57:47 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/options/OptionsBuilder.java	Fri Feb 13 16:55:17 2015 +0300
@@ -36,7 +36,7 @@
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.EnumSet;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
@@ -181,7 +181,7 @@
 
     // ---------------------------------------------------------------------------
 
-    private Set<Class<? extends Profiler>> profilers = new HashSet<Class<? extends Profiler>>();
+    private Set<Class<? extends Profiler>> profilers = new LinkedHashSet<Class<? extends Profiler>>();
 
     @Override
     public ChainedOptionsBuilder addProfiler(Class<? extends Profiler> prof) {