RFR: 8337674: ZGC: Consistent style for naming private static constants

Stefan Karlsson stefank at openjdk.org
Thu Sep 12 14:16:05 UTC 2024


On Thu, 12 Sep 2024 13:55:34 GMT, Joel Sikström <duke at openjdk.org> wrote:

> There are various styles for naming private static constants in ZGC. Some have a leading underscore, some begin with a lowercase letter and some start with an uppercase letter. The convention we feel is most appropriate, which also aligns with the hotspot style guide, is to have mixed-case with the first letter of each word capitalized when naming private static constants. There are also some occurrences of writing `const static` instead of the more commonly used `static const`, which should be made consistent to have the static keyword appear first.
> 
> The lines changed have been identified by running:
> `rg "static const .* [[:lower:]].* =" src/hotspot/share/gc/z src/hotspot/*/*/gc/z`
> `rg "static const .* _.* =" src/hotspot/share/gc/z src/hotspot/*/*/gc/z`
> `rg "const static" src/hotspot/share/gc/z src/hotspot/*/*/gc/z`
> 
> The occurrences of `const static valid_max_address_offset_bits` have been converted to `static const` from `const static` but have not been renamed to mixed-case as the occurrences are not exposed outside their function(s).
> 
> Tested with tiers 1-3.

Looks good.

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

Marked as reviewed by stefank (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/20968#pullrequestreview-2300456671


More information about the hotspot-dev mailing list