Elasticsearch: Naming convention for static final variables with mutable internal state

Created on 25 Oct 2018  路  3Comments  路  Source: elastic/elasticsearch

How should we name static final variables with mutable internal state? Does it matter if the internal state is visible to the user?

As an example, we have the names DEPRECATION_LOGGER and deprecationLogger throughout the codebase. We should pick a naming convention, document it, and stick to it throughout the codebase. This topic has cropped up in several discussions (e.g., #34279).

:CorInfrCore

Most helpful comment

I use the rules from the google java style. Not that they are perfect but it is nice to be able to point to them.

All 3 comments

Pinging @elastic/es-core-infra

I use the rules from the google java style. Not that they are perfect but it is nice to be able to point to them.

We discussed this on FixItFriday and agreed that the google java style for this convention is nice.
I've opened https://github.com/elastic/elasticsearch/pull/34887 to address the lowercasing of the static final variable naming for DeprecationLoggers

Was this page helpful?
0 / 5 - 0 ratings