RFR: 8214278: Cleanup process_completed_threshold and related state

Stefan Johansson stefan.johansson at oracle.com
Tue Nov 27 09:32:14 UTC 2018



On 2018-11-26 22:17, Kim Barrett wrote:
>>>
>>> […]
>>> - not sure if static consts like
>>> _process_completed_buffers_threshold_never should be named like a
>>> member. I think at some point we agreed on (but did not write down) to
>>> use CamelCase for those.
> 
> This came up in Thomas's review of another change of mine recently.  I
> don't have a strong preference.  I'm merely attempting to follow the
> Style Guide:
> 
> Top Ten List:
> 9. #Names Instance variable names start with underscore ...
> 
> Naming:
> - Local names (fields, variables) ... are lower-case.
> - Constant names in upper-case or mixed-case are *tolerated* [emphasis mine], according to historical necessity.
> - Constant names ... must have a distinct appearance from other names in related APIs.
> 
> The first and second suggest the convention I used, e.g. lower case
> with leading underscore.  The third argues against the proposed use of
> mixed-case (with or without leading underscore?).  The last, having
> distinct appearance, seems inconsistent with the others.  (Although
> who really knows, since the terminology in these rules is not standard
> C++ terminology, so it can be hard to be certain what is being
> referred to.)
> 
I totally agree that the style guide doesn't give any real guidance 
here. And as you say, we use every possible interpretation in the code 
base already except maybe Camel_Snake. To me the most important is the 
last bullet, that it should be easy to understand that this is a 
constant. I also think the first point only talks about *instance* 
variables, so not statics.

I don't see this as a blocker for this change, we have different 
preferences and I'm ok with this patch as is.

Thanks,
Stefan

> And of course, examples of all of these mentioned styles (and probably
> more) can be found in our code base.
> 
> Anyone feel like proposing some modifications to the Style Guide?
> 
> 


More information about the hotspot-gc-dev mailing list