changeset 15016:ade8c8076c59

7103957: NegativeArraySizeException while initializing class IntegerCache Reviewed-by: darcy, mchung Contributed-by: brian.burkhalter@oracle.com
author mchung
date Wed, 09 Jan 2013 16:58:47 -0800
parents 1ff7af181393
children f06faf784dde
files jdk/src/share/classes/java/lang/Integer.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/share/classes/java/lang/Integer.java	Wed Jan 09 08:59:58 2013 -0500
+++ b/jdk/src/share/classes/java/lang/Integer.java	Wed Jan 09 16:58:47 2013 -0800
@@ -772,7 +772,7 @@
                 int i = parseInt(integerCacheHighPropValue);
                 i = Math.max(i, 127);
                 // Maximum array size is Integer.MAX_VALUE
-                h = Math.min(i, Integer.MAX_VALUE - (-low));
+                h = Math.min(i, Integer.MAX_VALUE - (-low) -1);
             }
             high = h;