[loc-en-dev] Comments on the locale enhancement proposal
Masayoshi Okutsu
Masayoshi.Okutsu at Sun.COM
Mon Feb 2 19:11:54 PST 2009
On 2/3/2009 7:42 AM, Yoshito Umaoka wrote:
> Okutsu-san, I'd like to confirm your statement below.
>
> Masayoshi Okutsu wrote:
>> Comments inline.
>>
>> On 1/21/2009 5:26 AM, Doug Felt wrote:
>>> Comments inline.
>>>
>>> On Tue, Jan 20, 2009 at 12:25 AM, Masayoshi Okutsu
>>> <Masayoshi.Okutsu at sun.com <mailto:Masayoshi.Okutsu at sun.com>> wrote:
>>>
>>>
>>>
>>> My proposal is:
>>>
>>> * the existing interfaces should be kept fully compatible in
>>> both binaries and source code.
>>>
>>> Can you define more precisely what you mean? Do you mean no API
>>> additions to the Locale class?
>>
>> No semantic or behavior changes to the existing methods. I saw the
>> toString() behavior change in the 6.1 Script table and the semantic
>> changes to the Locale constructors. We should just describe the
>> current behavior where it's necessary.
>>
>> It's OK to add new methods to Locale.
>>
>
> Let's assume an instance of Locale is created from language tag
> "zh-Hans-CN". The proposal suggest Locale#toString() to return
> "zh_Hans_CN". Do you think this behavior is problematic? Are you
> suggesting to add a new method, for exmaple, Locale#getID() to return
> "zh_Hans_CN", but not to put the script "Hans" and extra separator "_"
> in the result of #toString()?
I think returning "zh_Hans_CN" may cause a problem. Let's think about
the following scenario.
(1) Application A and B communicate through RMI (i.e., serialization).
(2) A is script-aware, while B may be or may not.
(3) B uses 3rd party class library L which isn't script-aware.
Suppose both A and B are running in JDK 7, and that A sends a Locale
from "zh-Hans-CN" to B. B passes the given Locale to L. In this case, L
might be confused with "zh_Hans_CN" from toString().
We could say, "Don't do that." But if someone complains it's an
incompatible change in JDK 7, we will need to give up the new behavior
of toString(). If the complaint comes after the JDK 7 release, it will
be a tragedy...
Thanks,
Masayoshi
More information about the locale-enhancement-dev
mailing list