Ticket #5934 (closed defect: fixed)

Bug contains 2 commit(s) | SVN Diffs for #5934

 

Opened 1 year ago

Last modified 1 year ago

VVVV (and V) fail to parse in timezone formats

Reported by: mark Assigned to: emmons
Priority: major Milestone: 3.8.1
Component: formatting Version:
Keywords: Cc: deborah
Load: Xref: 5990
Java Version: Operating System:
Project (C/J): all Weeks:
Review: mark

Description

I was writing up the code samples for how to handle parsing with VVVV, and was getting some strange results. Parsing of VVVV has gotten completely and utterly hosed (in ICU4J, maybe also in ICU4C).

The problem is in the code after:

http://bugs.icu-project.org/trac/browser/icu4j/trunk/src/com/ibm/icu/text/SimpleDateFormat.java#L1744

we have the line:

1744 switch (patternCharIndex)

It is supposed to switch based on the character. "V..." produces patternCharIndex == 29

But 29 is missing from the switch statement: all we have is: 1879 case 17: // 'z' - ZONE_OFFSET 1880 case 23: // 'Z' - TIMEZONE_RFC 1881 case 24: // 'v' - TIMEZONE_GENERIC

The addition of one extra line fixes the problem.

case 29: // 'V' - TIMEZONE_SPECIAL

I checked in a new test under trunk, in DateTimeGeneratorTest.java

Attachments

Change History

09/14/07 08:19:26 changed by deborah

  • cc set to deborah.

09/25/07 13:46:28 changed by emmons

  • status changed from new to assigned.
  • revw set to mark.

09/25/07 13:46:36 changed by emmons

  • milestone changed from UNSCH to 4.0.

11/28/07 13:15:47 changed by yoshito

  • xref set to 5990.

11/28/07 13:33:40 changed by yoshito

  • milestone changed from 4.0 to 3.8.1.

Some additional updates in #5990.

01/09/08 11:11:47 changed by mark

  • status changed from assigned to closed.
  • resolution set to fixed.

Add/Change #5934 (VVVV (and V) fail to parse in timezone formats)




Anti spam check: