Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4818973

REGRESSION: DateFormat in Korean locale cannot parse valid date

XMLWordPrintable



      Name: nt126004 Date: 02/14/2003


      FULL PRODUCT VERSION :
      java(TM)2 Runtime Environment ,standard edition (build 1.4.0_02-b02)
      Java Hotspot(TM) Client VM (build 1.4.0_02-b02,mixed mode)

      FULL OPERATING SYSTEM VERSION :
      Windows98 [version 4.10.2222]

      A DESCRIPTION OF THE PROBLEM :
      The following program when parsing a date in the form "yyyy-
      mm-dd" throws a parse error with jre1.4 while it works fine
      with jre1.3.1. If getDateInstance() is called with no arguments,
      a ParseException is thrown by both jres.

      Error with jre1.4 says unparseable date "2003-02-13"

      import java.text.*;
      import java.util.*;

      public class Datedemo
      {
         public static void main(String args[])
         {
          
         try{
               String d="2003-02-13";
          
              DateFormat df;

              df=DateFormat.getDateInstance(DateFormat.MEDIUM,Locale.KOREA);
              Date date=df.parse(d);
              System.out.print(date+"");
           }catch(Exception e)
          {
            System.out.println(e.getMessage());
          }

        }


      REGRESSION. Last worked in version 1.3.1

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1.compile and run the program (given under DESCRIPITION)
      with jdk1.3.1
      2.then run program under jre1.4
      3.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      should parse successfully under jre1.4 too just like the
      way it parsed without any problem under jre1.3.1

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      unparseable date="2003-02-13"

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.text.*;
      import java.util.*;

      public class Datedemo
      {
         public static void main(String args[])
         {
          
         try{
               String d="2003-02-13";
          
              DateFormat df;

              df=DateFormat.getDateInstance(DateFormat.MEDIUM,Locale.KOREA);
              Date date=df.parse(d);
              System.out.print(date+"");
           }catch(Exception e)
          {
      e.printStackTrace()
          }

        }
      }
      ---------- END SOURCE ----------

      Release Regression From : 1.3.1
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

      (Review ID: 181296)
      ======================================================================

            sansunw Song An (Inactive)
            nthompsosunw Nathanael Thompson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: