Integrated: JDK-8312395: Improve assertions in growableArray

Matthias Baesken mbaesken at openjdk.org
Thu Jul 20 15:10:08 UTC 2023


On Thu, 20 Jul 2023 07:43:51 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> There are a number of assertions in growableArray , for example to check for a valid index to access/remove elements.
> Those assertions can be improved, e.g. by showing the bad index value used in case of failure.
> 
> Example for an assertion in the 'at(index i)' access method 
> old assertion looks like
> assert(0 <= i && i < _len) failed: illegal index
> 
> new assertion looks like
> assert(0 <= i && i < _len) failed: illegal index -559030609, 1 accessible elements

This pull request has now been integrated.

Changeset: b772e67e
Author:    Matthias Baesken <mbaesken at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/b772e67e2929afd9f9d6a4b08713e41f891667c0
Stats:     12 lines in 1 file changed: 0 ins; 0 del; 12 mod

8312395: Improve assertions in growableArray

Reviewed-by: dholmes, stuefe

-------------

PR: https://git.openjdk.org/jdk/pull/14946


More information about the hotspot-dev mailing list