Merge
authormduigou
Tue, 18 Jun 2013 14:11:45 -0700
changeset 18279 6a32863b0186
parent 18277 758564251f75 (current diff)
parent 18278 4b4381313a3c (diff)
child 18280 6c3c0ff49eb5
Merge
--- a/jdk/src/share/classes/java/lang/Integer.java	Tue Jun 18 16:08:46 2013 +0100
+++ b/jdk/src/share/classes/java/lang/Integer.java	Tue Jun 18 14:11:45 2013 -0700
@@ -788,10 +788,14 @@
             String integerCacheHighPropValue =
                 sun.misc.VM.getSavedProperty("java.lang.Integer.IntegerCache.high");
             if (integerCacheHighPropValue != null) {
-                int i = parseInt(integerCacheHighPropValue);
-                i = Math.max(i, 127);
-                // Maximum array size is Integer.MAX_VALUE
-                h = Math.min(i, Integer.MAX_VALUE - (-low) -1);
+                try {
+                    int i = parseInt(integerCacheHighPropValue);
+                    i = Math.max(i, 127);
+                    // Maximum array size is Integer.MAX_VALUE
+                    h = Math.min(i, Integer.MAX_VALUE - (-low) -1);
+                } catch( NumberFormatException nfe) {
+                    // If the property cannot be parsed into an int, ignore it.
+                }
             }
             high = h;