[loc-en-dev] Code review request for 6875847: Java Locale Enhancement

Naoto Sato naoto.sato at oracle.com
Fri Aug 27 14:20:36 PDT 2010


Here are my comments for the changes:

General:
- Instead of String.equals(), use of "==" for comparing locale elements 
(language/script/country/variant), as they are all intern'ed.
- Remove JDKIMPL check. Especially the code block for !JDKIMPL that 
won't be executed.

Locale.java
- private Locale(lang,scrpt,ctry,vrnt) constructor is redundant. Its 
implementation can just be moved to Locale(lang,ctry,vrnt) with script = "".
- Do we need two caches, one in BaseLocale and the other in Locale which 
in most cases a duplicate (excl. EMPTY_EXTENSIONS)? Can we get rid of 
the redundancy?
- toLowerCase() can be removed with the replacement of 
AsciiUtils.toLowerString()
- hashCode() comment looks wrong with the change.

ResourceBundle.java
- no need to import ResourceBundle.Control

Extension.java
- Should implement a proper hashCode() and cache the value, as in BaseLocale

InternalLocaleBuilder.java
- No need to define LOCALESEP, as it is a duplicate of BaseLocale.SEP

LocaleSyntaxException.java
- Do we really need this? Can InternalLocaleBuilder just throw 
IllformedLocaleException?

StringTokenIterator.java
- Need GPL2 copyright header

(not in the list)
make/java/java/FILES_java.gmk
- should contain new files.

Naoto


(8/25/10 10:46 AM), Naoto Sato wrote:
> Folks,
>
> Here is the initial webrev for this project against the JDK7 repository.
>
> http://cr.openjdk.java.net/~naoto/6875847/webrev.00/
>
> Please review them and post your comments to this mailing list.
>
> Thanks,
> Naoto



More information about the locale-enhancement-dev mailing list