changeset 137:0cea178f3eb4

Fixing the formatter regression: should not print double result on measurement iterations.
author shade
date Fri, 23 Aug 2013 12:18:50 +0400
parents 7ba43108f829
children f357993710a8
files jmh-core/src/main/java/org/openjdk/jmh/output/format/PrettyPrintFormat.java
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/output/format/PrettyPrintFormat.java	Fri Aug 23 12:16:15 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/output/format/PrettyPrintFormat.java	Fri Aug 23 12:18:50 2013 +0400
@@ -54,11 +54,11 @@
 
     @Override
     public void iterationResult(BenchmarkRecord name, int iteration, IterationType type, int thread, IterationResult result, Collection<ProfilerResult> profiles) {
-        out.println(String.format("%s", result.toPrintable()));
+        out.print(String.format("%s", result.toPrintable()));
 
+        // also print out profiler information
         if (type == IterationType.MEASUREMENT) {
             boolean firstProfiler = true;
-            out.print(String.format("%s", result.toPrintable()));
             for (ProfilerResult profRes : profiles) {
                 if (profRes.hasData()) {
                     if (firstProfiler) {
@@ -73,8 +73,9 @@
                     out.print(String.format("%12s |\n", ""));
                 }
             }
-            out.println("");
         }
+
+        out.println("");
         out.flush();
     }