changeset 6347:4c8b37f159f9

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 f0ed9ef84637
children 4176e6cc499e
files src/share/classes/java/lang/Integer.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/lang/Integer.java	Wed Jan 09 08:59:58 2013 -0500
+++ b/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;