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

Matthias Baesken mbaesken at openjdk.org
Thu Jul 20 12:25:45 UTC 2023


On Thu, 20 Jul 2023 10:27:57 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   adjust some output and some asserts
>
> src/hotspot/share/utilities/growableArray.hpp line 263:
> 
>> 261:   void remove_range(int start, int end) {
>> 262:     assert(0 <= start, "illegal start index %d", start);
>> 263:     assert(start < end && end <= _len, "erase called with invalid range %d, %d", start, end);
> 
> I think you'd want to see `_len` here too - suggestion:
> 
> "erase called with invalid range (%d, %d) for length %d", start, end, _len

Hi David, I agree !

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14946#discussion_r1269383784


More information about the hotspot-dev mailing list