Andrew John Hughes wrote:
> 2008/12/31 Andrew Haley <a...@redhat.com>:
>> Andrew John Hughes wrote:
>>> The standard characters set in SimpleDateFormat should match
>>> the length of the localised characters obtained from our locale
>>> data.
>>>
>>> ChangeLog:
>>>
>>> 2008-12-30  Andrew John Hughes  <gnu_and...@member.fsf.org>
>>>
>>>       * java/text/SimpleDateFormat.java:
>>>       (standardChars): Use standard characters from CLDR.
>>>       (RFC822_TIMEZONE_FIELD): Fixed to match new standard
>>>       characters.
>>>
>>>
>> Surely this
>>
>> +  private static final int RFC822_TIMEZONE_FIELD = 23;
>>
>> is
>>
>>   private static final int RFC822_TIMEZONE_FIELD = standardChars.indexOf("Z")
>>
> 
>         case RFC822_TIMEZONE_FIELD:
>              ^^^^^^^^^^^^^^^^^^^^^
> case expressions must be constant expressions

Oh, yeuch.  This looks to me like a bug waiting to happen.
Might I suggest

static
{
  assert RFC822_TIMEZONE_FIELD == standardChars.indexOf("Z")
}

Andrew.

Reply via email to