Final call Re: RFR: JDK-8230744 Several classes throw OutOfMemoryError without message

Martin Buchholz martinrb at google.com
Wed Jun 10 17:10:38 UTC 2020


On Wed, Jun 10, 2020 at 9:35 AM Jim Laskey <james.laskey at oracle.com> wrote:

> > ---
> > It looks like
> > newCap > oldCap
> > is always true, so we should delete the test?
> >                 if (newCap > oldCap && queue == array)
> > ---
>
> If oldCap == MAX_ARRAY_SIZE wouldn't newCap == oldCap

newLength's contract is to return a value at least larger by
minGrowth, or throw.

I looked around for tests for newLength, but couldn't find any.
We should add those.
In particular, check that e.g.
newLength(MAX_ARRAY_LENGTH, 1, 42) == Integer.MAX_VALUE
newLength(Integer.MAX_VALUE, 1, 42) => OOME


More information about the core-libs-dev mailing list