changeset 981:2756664a5c82

runners: omit error from simple result toString, if the error is undefined.
author shade
date Mon, 25 Aug 2014 15:19:23 +0400
parents fea2e0888ac5
children f3a68bbd0f15
files jmh-core/src/main/java/org/openjdk/jmh/results/Result.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/results/Result.java	Fri Aug 22 17:32:38 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/results/Result.java	Mon Aug 25 15:19:23 2014 +0400
@@ -125,7 +125,7 @@
                 return statistics.getMeanErrorAt(0.999);
             case SUM:
             case MAX:
-                return 0.0;
+                return Double.NaN;
             default:
                 throw new IllegalStateException("Unknown aggregation policy: " + policy);
         }
@@ -176,7 +176,7 @@
      */
     @Override
     public String toString() {
-        if (getStatistics().getN() > 2) {
+        if (!Double.isNaN(getScoreError())) {
             return String.format("%.3f \u00B1(99.9%%) %.3f %s", getScore(), getScoreError(), getScoreUnit());
         } else {
             return String.format("%.3f %s", getScore(), getScoreUnit());