RFR 7103957: NegativeArraySizeException while initializing class IntegerCache

Mandy Chung mandy.chung at oracle.com
Thu Jan 10 00:45:10 UTC 2013


I can sponsor this fix.

Mandy

On 1/9/2013 2:19 PM, Brian Burkhalter wrote:
> 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