google / google/styleguide

Suggest adding "private static Function..." to java constants examples

Open
#197 0 comments 0 reactions 0 assignees View on GitHub
lang:java
Dominant language
HTML
Stars
39.6k
Forks
12.9k
Avg merge
42m
Merged PRs (30d)
15

Description

The Java style guide says that `private static final` variables where the value is immutable, are constants and should be in UPPER_CASE.

Read literally, this means that a function would be no exception:

private static final Function REMOVE_NUMBERS = s -> s.replaceAll("\\d","");

If this is the suggested style, I suggest adding it to the examples. The sentence below about most of these being nouns, probably doesn't apply in this case?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.