7103957: NegativeArraySizeException while initializing class IntegerCache
Reviewed-by: darcy, mchung
Contributed-by: brian.burkhalter@oracle.com
--- 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;