Integrated: 8337674: ZGC: Consistent style for naming private static constants
Joel Sikström
duke at openjdk.org
Thu Sep 19 08:50:40 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.
This pull request has now been integrated.
Changeset: 8908812d
Author: Joel Sikström <joel.sikstrom at oracle.com>
Committer: Hamlin Li <mli at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/8908812d0a64f25f0d033d44725a69348789b223
Stats: 62 lines in 24 files changed: 0 ins; 0 del; 62 mod
8337674: ZGC: Consistent style for naming private static constants
Reviewed-by: stefank, aboldtch, mli
-------------
PR: https://git.openjdk.org/jdk/pull/20968
More information about the hotspot-dev
mailing list