RFR 7103957: NegativeArraySizeException while initializing class IntegerCache

Brian Burkhalter brian.burkhalter at oracle.com
Wed Jan 9 22:19:24 UTC 2013


Is there someone willing to sponsor this fix?

Thanks,

Brian

On Jan 9, 2013, at 12:48 PM, Joe Darcy wrote:

> Looks fine; approved.
> 
> Cheers,
> 
> -Joe
> 
> On 1/9/2013 11:58 AM, Brian Burkhalter wrote:
>> Please review at your convenience.
>> 
>> Issue
>> https://jbs.oracle.com/bugs/browse/JDK-7103957
>> 
>> The problem and suggested fix provided in the issue description are accurate: the array is one element too large.
>> 
>> Diff
>> --- a/src/share/classes/java/lang/Integer.java	Tue Nov 13 20:02:39 2012 -0800
>> +++ b/src/share/classes/java/lang/Integer.java	Wed Jan 09 11:45:28 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;
>> 
>> Testing
>> All java/lang tests passed on default array of platforms.
>> 
>> Thanks,
>> 
>> Brian
> 




More information about the core-libs-dev mailing list