Re: ArrayList grow method optimization and documentation improvement

2022-07-10 Thread Periklis Ntanasis
d Eckenfels wrote: > I think it means for the zero case it should not use the else part if it > has not the default sizing, since somebody might have created it with a > specific size. Not sure if it matters much either way. > > > -- > http://bernd.eckenfels.net >

ArrayList grow method optimization and documentation improvement

2022-07-10 Thread Periklis Ntanasis
Hi all, I was reading the ArrayList source code and I think that the "private Object[] grow(int minCapacity)" method does not work as it was intended by the author. Currently the method looks like this ( https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/util/ArrayList.ja