changeset 325:ec690a8057ee

Expose SortedMap instead of Map in Runner.run().
author shade
date Sun, 22 Dec 2013 23:16:30 +0400
parents ea37cd23bb90
children c2af91629c91
files jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java	Wed Dec 18 17:30:47 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java	Sun Dec 22 23:16:30 2013 +0400
@@ -61,6 +61,7 @@
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
+import java.util.SortedMap;
 import java.util.SortedSet;
 import java.util.TreeMap;
 import java.util.logging.Level;
@@ -148,7 +149,7 @@
      *
      * @return map of benchmark results
      */
-    public Map<BenchmarkRecord, RunResult> run() throws RunnerException {
+    public SortedMap<BenchmarkRecord, RunResult> run() throws RunnerException {
         SortedSet<BenchmarkRecord> benchmarks = list.find(out, options.getIncludes(), options.getExcludes());
 
         if (benchmarks.isEmpty()) {
@@ -194,7 +195,7 @@
         benchmarks.clear();
         benchmarks.addAll(newBenchmarks);
 
-        Map<BenchmarkRecord, RunResult> results = runBenchmarks(benchmarks);
+        SortedMap<BenchmarkRecord, RunResult> results = runBenchmarks(benchmarks);
 
         out.flush();
         out.close();
@@ -271,7 +272,7 @@
         return result;
     }
 
-    private Map<BenchmarkRecord, RunResult> runBenchmarks(SortedSet<BenchmarkRecord> benchmarks) {
+    private SortedMap<BenchmarkRecord, RunResult> runBenchmarks(SortedSet<BenchmarkRecord> benchmarks) {
         out.startRun();
 
         Multimap<BenchmarkRecord, BenchResult> results = new TreeMultimap<BenchmarkRecord, BenchResult>();
@@ -291,13 +292,13 @@
             }
         }
 
-        Map<BenchmarkRecord, RunResult> runResults = mergeRunResults(results);
+        SortedMap<BenchmarkRecord, RunResult> runResults = mergeRunResults(results);
         out.endRun(runResults);
         return runResults;
     }
 
-    private Map<BenchmarkRecord, RunResult> mergeRunResults(Multimap<BenchmarkRecord, BenchResult> results) {
-        Map<BenchmarkRecord, RunResult> result = new TreeMap<BenchmarkRecord, RunResult>();
+    private SortedMap<BenchmarkRecord, RunResult> mergeRunResults(Multimap<BenchmarkRecord, BenchResult> results) {
+        SortedMap<BenchmarkRecord, RunResult> result = new TreeMap<BenchmarkRecord, RunResult>();
         for (BenchmarkRecord key : results.keys()) {
             Collection<BenchResult> rs = results.get(key);
             result.put(key, new RunResult(rs));