Review (Updated) : 4884238 : Constants for Standard Charsets

mark.reinhold at oracle.com mark.reinhold at oracle.com
Wed Apr 27 03:43:41 UTC 2011


(just saw your message; more e-mail delays I suppose)

2011/4/19 17:22 -0700, mike.duigou at oracle.com:
> My sentiment is for StandardCharset.
> 
> I received offlist feedback which would support this. The pattern for
> enum like collections of constants has been to use the singular form;
> java.math.RoundingMode, java.lang.annotation.ElementType,
> javax.lang.model.element.ElementKind, java.lang.management.MemoryType,
> etc.

You're not defining an "enum-like collection of constants"; you're
defining a set of convenient static constant values.  In this way it's
much more similar to java.util.Collections and j.u.Arrays and other
multiply-named classes than it is to singularly-named enum classes.
The only difference is that you're defining static constants rather
than static methods.

> The NIO 2 / JSR 203 classes use the relatively new naming convention of
> "Standard" for platform defined constants.

The uses of "Standard" in JSR 203 are for enums.

> Any strong reason to use the plural form?

See above.

- Mark



More information about the core-libs-dev mailing list