RFR: JDK-8312395: Improve assertions in growableArray [v2]
Thomas Stuefe
stuefe at openjdk.org
Thu Jul 20 09:05:52 UTC 2023
On Thu, 20 Jul 2023 08:47:49 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
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>
> adjust some output and some asserts
Looks good!
looks
> I adjusted the output following your suggestion and also added some output to a few more asserts.
>
> Btw any idea why so much 'this->_len' syntax is used at some places and not just _len or other field names ?
Probably some IDE-code-completion-related artifacts. E.g. typing "this->" in CDT gives me all members, and maybe someone just hit Enter then and took the full completion
-------------
Marked as reviewed by stuefe (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/14946#pullrequestreview-1538797067
PR Comment: https://git.openjdk.org/jdk/pull/14946#issuecomment-1643551305
More information about the hotspot-dev
mailing list