java.text.SimpleDateFormat is not thread safe.

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 1.1.6
    • Component/s: 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)
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: