RFR: 8079136: Accessing a nested sublist leads to StackOverflowError

Martin Buchholz martinrb at google.com
Thu May 7 22:26:25 UTC 2015

On Thu, May 7, 2015 at 12:23 PM, Doug Lea <dl at cs.oswego.edu> wrote:
> It would be possible (and easy) to create a specialization for the
> java.util.Arrays.ArrayList class (i.e., the kind returned by
> Arrays.asList(a).subList), which would also fix the SOE problem
> in this particular case.

It seems it would be a fairly clean win to no longer have Arrays.ArrayList
subclass AbstractList, getting rid of modCount (no structural modifications
are possible!), at the cost of more copying.  Maybe it could subclass
AbstractCollection instead?

More information about the core-libs-dev mailing list