changeset 8239:344772588886

Merge
author briangoetz
date Wed, 17 Apr 2013 00:21:38 -0400
parents d23f3aba300d 7bf0e641cea7
children bd37c6d3f3d0
files
diffstat 5 files changed, 19 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/DoubleSummaryStatistics.java	Wed Apr 17 00:20:50 2013 -0400
+++ b/src/share/classes/java/util/DoubleSummaryStatistics.java	Wed Apr 17 00:21:38 2013 -0400
@@ -104,7 +104,7 @@
      *
      * @return the count of values
      */
-    public long getCount() {
+    public final long getCount() {
         return count;
     }
 
@@ -119,7 +119,7 @@
      *
      * @return the sum of values, or zero if none
      */
-    public double getSum() {
+    public final double getSum() {
         return sum;
     }
 
@@ -133,7 +133,7 @@
      * value was NaN or {@code Double.POSITIVE_INFINITY} if no values were
      * recorded
      */
-    public double getMin() {
+    public final double getMin() {
         return min;
     }
 
@@ -147,7 +147,7 @@
      * value was NaN or {@code Double.NEGATIVE_INFINITY} if no values were
      * recorded
      */
-    public double getMax() {
+    public final double getMax() {
         return max;
     }
 
@@ -162,8 +162,8 @@
      *
      * @return the average of values, or zero if none
      */
-    public double getAverage() {
-        return count > 0 ? sum / count : 0.0d;
+    public final double getAverage() {
+        return getCount() > 0 ? getSum() / getCount() : 0.0d;
     }
 
     /**
--- a/src/share/classes/java/util/IntSummaryStatistics.java	Wed Apr 17 00:20:50 2013 -0400
+++ b/src/share/classes/java/util/IntSummaryStatistics.java	Wed Apr 17 00:21:38 2013 -0400
@@ -105,7 +105,7 @@
      *
      * @return the count of values
      */
-    public long getCount() {
+    public final long getCount() {
         return count;
     }
 
@@ -115,7 +115,7 @@
      *
      * @return the sum of values, or zero if none
      */
-    public long getSum() {
+    public final long getSum() {
         return sum;
     }
 
@@ -125,7 +125,7 @@
      *
      * @return the minimum value, or {@code Integer.MAX_VALUE} if none
      */
-    public int getMin() {
+    public final int getMin() {
         return min;
     }
 
@@ -135,7 +135,7 @@
      *
      * @return the maximum value, or {@code Integer.MIN_VALUE} if none
      */
-    public int getMax() {
+    public final int getMax() {
         return max;
     }
 
@@ -145,8 +145,8 @@
      *
      * @return the average of values, or zero if none
      */
-    public double getAverage() {
-        return count > 0 ? (double) sum / count : 0.0d;
+    public final double getAverage() {
+        return getCount() > 0 ? (double) getSum() / getCount() : 0.0d;
     }
 
     @Override
--- a/src/share/classes/java/util/LongSummaryStatistics.java	Wed Apr 17 00:20:50 2013 -0400
+++ b/src/share/classes/java/util/LongSummaryStatistics.java	Wed Apr 17 00:21:38 2013 -0400
@@ -117,7 +117,7 @@
      *
      * @return the count of values
      */
-    public long getCount() {
+    public final long getCount() {
         return count;
     }
 
@@ -127,7 +127,7 @@
      *
      * @return the sum of values, or zero if none
      */
-    public long getSum() {
+    public final long getSum() {
         return sum;
     }
 
@@ -137,7 +137,7 @@
      *
      * @return the minimum value, or {@code Long.MAX_VALUE} if none
      */
-    public long getMin() {
+    public final long getMin() {
         return min;
     }
 
@@ -147,7 +147,7 @@
      *
      * @return the maximum value, or {@code Long.MIN_VALUE} if none
      */
-    public long getMax() {
+    public final long getMax() {
         return max;
     }
 
@@ -157,8 +157,8 @@
      *
      * @return The average of values, or zero if none
      */
-    public double getAverage() {
-        return count > 0 ? (double) sum / count : 0.0d;
+    public final double getAverage() {
+        return getCount() > 0 ? (double) getSum() / getCount() : 0.0d;
     }
 
     @Override
--- a/src/share/classes/java/util/Map.java	Wed Apr 17 00:20:50 2013 -0400
+++ b/src/share/classes/java/util/Map.java	Wed Apr 17 00:21:38 2013 -0400
@@ -629,7 +629,7 @@
      * @param key key with which the specified value is to be associated
      * @param value value to be associated with the specified key
      * @return the previous value associated with the specified key, or
-     *         {@code 1} if there was no mapping for the key.
+     *         {@code null} if there was no mapping for the key.
      *         (A {@code null} return can also indicate that the map
      *         previously associated {@code null} with the key,
      *         if the implementation supports null values.)
--- a/src/share/classes/sun/tools/java/BinaryConstantPool.java	Wed Apr 17 00:20:50 2013 -0400
+++ b/src/share/classes/sun/tools/java/BinaryConstantPool.java	Wed Apr 17 00:21:38 2013 -0400
@@ -87,16 +87,6 @@
                 // JVM 4.4.2 CONSTANT_*ref_info.class_index & name_and_type_index
                 cpool[i] = new Integer((in.readUnsignedShort() << 16) | in.readUnsignedShort());
                 break;
-                  
-              case CONSTANT_METHODHANDLE:
-                cpool[i] = readBytes(in, 3);
-                break;
-              case CONSTANT_METHODTYPE:
-                cpool[i] = readBytes(in, 2);
-                break;
-              case CONSTANT_INVOKEDYNAMIC:
-                cpool[i] = readBytes(in, 4);
-                break;
 
               case CONSTANT_METHODHANDLE:
                 cpool[i] = readBytes(in, 3);
@@ -114,13 +104,6 @@
             }
         }
     }
-    
-    private byte[] readBytes(DataInputStream in, int cnt) throws IOException {
-        byte[] b = new byte[cnt];
-        int rcnt = in.read(b, 0, cnt);
-        if (rcnt != cnt) throw new EOFException("Expected " + cnt + " bytes, got " + rcnt);
-        return b;
-    }
 
     private byte[] readBytes(DataInputStream in, int cnt) throws IOException {
         byte[] b = new byte[cnt];