RFR: JDK-8312395: Improve assertions in growableArray [v2]

Matthias Baesken mbaesken at openjdk.org
Thu Jul 20 08:47:49 UTC 2023


> 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

Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:

  adjust some output and some asserts

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/14946/files
  - new: https://git.openjdk.org/jdk/pull/14946/files/16d7fabe..d4e3ba68

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=14946&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=14946&range=00-01

  Stats: 8 lines in 1 file changed: 0 ins; 0 del; 8 mod
  Patch: https://git.openjdk.org/jdk/pull/14946.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/14946/head:pull/14946

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


More information about the hotspot-dev mailing list