47 lines
1.8 KiB
Diff
47 lines
1.8 KiB
Diff
diff --git a/jdk/src/share/classes/java/lang/Long.java b/jdk/src/share/classes/java/lang/Long.java
|
|
index 58c2cc3ba..7b6e14a97 100644
|
|
--- a/jdk/src/share/classes/java/lang/Long.java
|
|
+++ b/jdk/src/share/classes/java/lang/Long.java
|
|
@@ -812,12 +812,11 @@ public final class Long extends Number implements Comparable<Long> {
|
|
static final Long cache[];
|
|
|
|
static {
|
|
-
|
|
+ int h = 127;
|
|
String longCacheHighPropValue =
|
|
sun.misc.VM.getSavedProperty("java.lang.Long.LongCache.high");
|
|
if (longCacheHighPropValue != null) {
|
|
// high value may be configured by property
|
|
- int h = 0;
|
|
try {
|
|
int i = Integer.parseInt(longCacheHighPropValue);
|
|
i = Math.max(i, 127);
|
|
@@ -826,21 +825,13 @@ public final class Long extends Number implements Comparable<Long> {
|
|
} catch( NumberFormatException nfe) {
|
|
// If the property cannot be parsed into an int, ignore it.
|
|
}
|
|
- high = h;
|
|
- low = -h - 1;
|
|
- cache = new Long[(high - low) + 1];
|
|
- int j = low;
|
|
- for(int k = 0; k < cache.length; k++)
|
|
- cache[k] = new Long(j++);
|
|
-
|
|
- } else {
|
|
- low = -128;
|
|
- high = 127;
|
|
- cache = new Long[(high - low) + 1];
|
|
- int j = low;
|
|
- for(int k = 0; k < cache.length; k++)
|
|
- cache[k] = new Long(j++);
|
|
}
|
|
+ high = h;
|
|
+ low = -h - 1;
|
|
+ cache = new Long[(high - low) + 1];
|
|
+ int j = low;
|
|
+ for(int k = 0; k < cache.length; k++)
|
|
+ cache[k] = new Long(j++);
|
|
}
|
|
}
|
|
|