Doing it the way they did lets you reuse the array without re-allocating its backing storage. If you wanted to reallocate the array, you could have done it yourself, since the representation of ArrayList
mostly consists of its backing storage.
If they released the array as a whole, there would be very little difference between calling clear()
and re-assigning the ArrayList
itself. Now they give you an option to choose between reusing the array or replacing it with a brand-new one.