RFR: 8258810: Improve enum traits
Kim Barrett
kim.barrett at oracle.com
Fri Jan 1 09:46:38 UTC 2021
> On Dec 24, 2020, at 3:46 PM, Albert Mingkun Yang <ayang at openjdk.java.net> wrote:
>
> On Tue, 22 Dec 2020 18:45:31 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>
>> Please review these miscellaneous improvements to the enum iteration facility.
>> Thanks to @albertnetymk for discussions.
>> […]
>
> I think `assert(size() > 0)` is more consistent with preceding documentation than `assert_not_empty()` in `first()` and `last()`. Very subjective though; up to you.
I changed assert_not_empty to use `size() > 0`. The old implementation was equivalent
in context, but not immediately obviously so. `assert_not_empty` just gives a meaningful name
to the condition, and avoids a bit of code repetition.
More information about the hotspot-dev
mailing list