On Mon, 12 Oct 2026 08:30:49 GMT, Johan Sjölen <[email protected]> wrote:
>> src/hotspot/share/services/heapDumper.cpp line 851:
>>
>>> 849:
>>> 850: template<typename FieldStreamType>
>>> 851: static ValueFieldInfo* calc_value_field_info(const
>>> FieldStreamType& field) {
>>
>> Is this `calc_` prefix that informative? `value_field_info` seems fine, as
>> well as `value_klass`. Or, if you're like me, you'll name them `$PREFIX_of`.
>
> Point is: We're not really calculating anything, so seems redundant.
If possible I would like to stay away from using a name that is overloaded with
the corresponding accessor's name.
I think I almost always use `PREFIX_member_name(...)` for these kind of
helpers, but maybe `member_name_of(...)` is a good alternative when it is not
obvious what PREFIX should be. I don't know how well the `_of` alternative
reads when you need more parameters to calculate/extract/get the value you want
to be passed to the initialization?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/33283#discussion_r4246864671