Constants for standard charsets -- CR #4884238
Ulf Zibis
Ulf.Zibis at gmx.de
Tue Apr 12 19:49:03 UTC 2011
Am 12.04.2011 21:10, schrieb Ulf Zibis:
>
> > This change has been previously proposed but the constants were to be defined in Charset which
> was deemed to have too high a static initialization cost. Using a separate class, Charsets, means
> that the cost for initialization is only borne by those who use the class--there's virtually no
> incremental cost to platform initialization.
>
> I can't agree with that, because you statically invoke e.g. Charset.forName("US-ASCII"), which
> causes the expensive initialization of the Charset class.
>
Additionally I think we should not add another new class for such lousy content, we have so much.
Or contrary, there are more methods which should be better located in Charsets than in Charset, but
now it's too late for this:
availableCharsets()
defaultCharset()
forName(String charsetName) (then better: get(String charsetName) or retrieve(String charsetName))
isSupported(String charsetName)
-Ulf
More information about the core-libs-dev
mailing list