From 4fd7975e4c516f9164043a42d9f93af886d29275 Mon Sep 17 00:00:00 2001 From: mchung Date: Wed, 9 Jan 2013 16:58:47 -0800 Subject: [PATCH] 7103957: NegativeArraySizeException while initializing class IntegerCache Reviewed-by: darcy, mchung Contributed-by: brian.burkhalter@oracle.com --- src/share/classes/java/lang/Integer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/share/classes/java/lang/Integer.java b/src/share/classes/java/lang/Integer.java index 3496d039c..af575f0b5 100644 --- a/src/share/classes/java/lang/Integer.java +++ b/src/share/classes/java/lang/Integer.java @@ -772,7 +772,7 @@ public final class Integer extends Number implements Comparable { 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; -- GitLab