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

java.text.SimpleDateFormat is not thread safe.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.6
    • core-libs
    • x86
    • windows_nt



      Name: nl37777 Date: 09/21/98


      Just create a program having lots of threads
      which format dates with:

        dateFormatter.format(new Date());

      When I use the format pattern:

        [dd/MMM/yyyy:HH:mm:ss z]

      I get formatted dates like the following:

        [05/May/1998:14:46:33 PDT]
        [05/May/1998:14:46:34 PDT]
        [0005/May/1998:14:46:34 PDT]
        [05/May/1998:14:46:34 PDT]
        [05/May/1998:14:46:34 PDT]
        [0005/May/1998:14:46:0034 PDT]
        [0005/May/1998:14:46:0034 PDT]
        [05/May/1998:14:46:0034 PDT]
        [0005/May/1998:14:46:0034 PDT]
        [0005/May/1998:14:0046:34 PDT]
        [05/May/1998:14:0046:34 PDT]

      (with lots of extra zeros here and there).
      (Review ID: 29763)
      ======================================================================

            aliusunw Alan Liu (Inactive)
            nlindenbsunw Norbert Lindenberg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: