RFR: 8079136: Accessing a nested sublist leads to StackOverflowError
ivan.gerasimov at oracle.com
Tue May 5 07:17:57 UTC 2015
When creating a sublist with List.subList(), it keeps a reference to its
Then, when accessing (get(), set(), add(), remove(), etc.) the sublist,
it recursively calls the corresponding methods of its parent.
This recursion, when deep enough, can cause StackOverflowError.
The only reason to do things recursively here, is the need to update
modCount and size of all the parents.
So, the proposal is to update these fields in a loop.
A few cleanups were done along the way.
Would you please help review the fix?
More information about the core-libs-dev