Review (Updated) : 4884238 : Constants for Standard Charsets

Mike Duigou mike.duigou at oracle.com
Wed Apr 20 00:22:02 UTC 2011


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. 

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

java.util.zip.ZipConstants[64] are package private interfaces to define int constants which is against normally recommended practice.

Any strong reason to use the plural form?

Mike

On Apr 19 2011, at 08:00 , mark.reinhold at oracle.com wrote:

> 2011/4/19 4:52 -0700, ulf.zibis at gmx.de:
>> Am 19.04.2011 00:24, schrieb Mike Duigou:
>> Reading 'StandardCharset' one expects _the_ standard charset, but we have a
>> collection of 6 here, so I'm for 'StandardCharsets' similar to
>> e.g. j.u.z.ZipConstants, j.u.z.ZipConstants64, ...
> 
> I agree.  "StandardCharsets" would be a better name.
> 
> - Mark




More information about the core-libs-dev mailing list