3 ms·
Not since Sun->Oracle totally changed the bug reporting system, sorry. It was long ago. In the ArrayList case, IIRC (it was years ago) the issue was the now-n
by SeanLuke 14y ago
Not since Sun->Oracle totally changed the bug reporting system, sorry. It was long ago.
In the ArrayList case, IIRC (it was years ago) the issue was the now-notorious RangeCheck function. For example, get(index) does this:
RangeCheck(index);
return elementData[index];
get() could be inlined, but because RangeCheck threw an exception if the index was >= size, RangeCheck was not inlined. But if you did this:
if (index >= size)
RangeCheck(index);
return elementData[index];
... you could bypass it and calls to get() would involve inlined code unless the exception was triggered. Same went for set and add. Recent versions of HotSpot have mooted this now.