RFR: 8079136: Accessing a nested sublist leads to StackOverflowError
daniel.fuchs at oracle.com
Tue May 5 13:29:50 UTC 2015
On 05/05/15 14:55, Ivan Gerasimov wrote:
> I converted the SubList into an inner class to make the implementations
> for AbstractList.SubList and ArrayList.SubList similar.
> It might be not worth doing so, but I thought it would be easier to
> maintain those classes, if they have similar structure.
There's a subtle difference here - because SubList in ArrayList is
not an ArrayList - so I find it less confusing: that SubList can't
have inner SubList instances :-)
Whereas SubList in AbstractList is itslef an AbstractList, and
therefore if SubList is an AbstractList it can have inner
SubList instances too - which is precisely what you don't want
You might want to wait and see where other reviewer's preferences
More information about the core-libs-dev