RFR 8223593 : Refactor code for reallocating storage

Martin Buchholz martinrb at google.com
Fri May 10 06:58:51 UTC 2019

History: I was responsible for some of these.  I considered refactoring but
did not because
- this was pre-module so no good way to share infrastructure.
- growth algorithm differed slightly between instances (looks like you've
solved this)

I agree this code is errorprone.

I might have more time to review later.

*From: *Ivan Gerasimov <ivan.gerasimov at oracle.com>
*Date: *Wed, May 8, 2019 at 6:50 PM
*To: *core-libs-dev

> Jdk has several places with similar logic:  an array needs to be
> reallocated (by at least some defined amount), taking into account the
> maximum allowed size of arrays.
> There's clearly an opportunity for refactoring, so it is proposed to
> introduce a dedicated utility method for calculating the best new size
> of an array.
> Would you please help review this enhancement?
> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8223593
> WEBREV: http://cr.openjdk.java.net/~igerasim/8223593/00/webrev/
> Mach5 job ran fine.
> Thanks in advance!
> --
> With kind regards,
> Ivan Gerasimov

More information about the core-libs-dev mailing list