changeset 7775:5887f3e72b2c

Javadoc corrections from EG and reviewers
author mduigou
date Thu, 28 Mar 2013 18:32:00 -0700
parents b7e72d2a785e
children 9335e621253a
files src/share/classes/java/util/DoubleSummaryStatistics.java src/share/classes/java/util/IntSummaryStatistics.java src/share/classes/java/util/LongSummaryStatistics.java
diffstat 3 files changed, 30 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/DoubleSummaryStatistics.java	Thu Mar 28 16:30:13 2013 -0700
+++ b/src/share/classes/java/util/DoubleSummaryStatistics.java	Thu Mar 28 18:32:00 2013 -0700
@@ -156,12 +156,13 @@
      */
     @Override
     public String toString() {
-        return new StringJoiner(", ", this.getClass().getSimpleName() + "{", "}")
-                .add("count=" + getCount())
-                .add("sum=" + getSum())
-                .add("sumOfSquares=" + getSumOfSquares())
-                .add("min=" + getMin())
-                .add("max=" + getMax())
-                .toString();
+        return String.format(
+            "%s{count=%d, sum=%f, sumOfSquares=%f, min=%f, max=%f}",
+            this.getClass().getSimpleName(),
+            getCount(),
+            getSum(),
+            getSumOfSquares(),
+            getMin(),
+            getMax()).toString();
     }
 }
--- a/src/share/classes/java/util/IntSummaryStatistics.java	Thu Mar 28 16:30:13 2013 -0700
+++ b/src/share/classes/java/util/IntSummaryStatistics.java	Thu Mar 28 18:32:00 2013 -0700
@@ -106,8 +106,8 @@
     }
 
     /**
-     * Returns the sum of the squares of the values recorded, or zero if no values
-     * have been recorded.
+     * Returns the sum of the squares of the values recorded, or zero if no
+     * values have been recorded.
      *
      * @return The sum of the squares of the values, or zero if none
      */
@@ -116,8 +116,8 @@
     }
 
     /**
-     * Returns the minimal value recorded, or {@code Integer.MAX_VALUE} if no values
-     * have been recorded.
+     * Returns the minimal value recorded, or {@code Integer.MAX_VALUE} if no
+     * values have been recorded.
      *
      * @return The minimal value, or {@code Integer.MAX_VALUE} if none
      */
@@ -126,8 +126,8 @@
     }
 
     /**
-     * Returns the maximal value recorded, or {@code Integer.MIN_VALUE} if no values
-     * have been recorded.
+     * Returns the maximal value recorded, or {@code Integer.MIN_VALUE} if no
+     * values have been recorded.
      *
      * @return The maximal value, or {@code Integer.MIN_VALUE} if none
      */
@@ -154,12 +154,13 @@
      * between implementations and versions.
      */
     public String toString() {
-        return new StringJoiner(", ", this.getClass().getSimpleName() + "{", "}")
-                .add("count=" + getCount())
-                .add("sum=" + getSum())
-                .add("sumOfSquares=" + getSumOfSquares())
-                .add("min=" + getMin())
-                .add("max=" + getMax())
-                .toString();
+        return String.format(
+            "%s{count=%d, sum=%d, sumOfSquares=%d, min=%d, max=%d}",
+            this.getClass().getSimpleName(),
+            getCount(),
+            getSum(),
+            getSumOfSquares(),
+            getMin(),
+            getMax()).toString();
     }
 }
--- a/src/share/classes/java/util/LongSummaryStatistics.java	Thu Mar 28 16:30:13 2013 -0700
+++ b/src/share/classes/java/util/LongSummaryStatistics.java	Thu Mar 28 18:32:00 2013 -0700
@@ -148,12 +148,13 @@
      * between implementations and versions.
      */
     public String toString() {
-        return new StringJoiner(", ", this.getClass().getSimpleName() + "{", "}")
-                .add("count=" + getCount())
-                .add("sum=" + getSum())
-                .add("sumOfSquares=" + getSumOfSquares())
-                .add("min=" + getMin())
-                .add("max=" + getMax())
-                .toString();
+        return String.format(
+            "%s{count=%d, sum=%d, sumOfSquares=%d, min=%d, max=%d}",
+            this.getClass().getSimpleName(),
+            getCount(),
+            getSum(),
+            getSumOfSquares(),
+            getMin(),
+            getMax()).toString();
     }
 }