Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-331

Synchronization of SimpleDateFormat object in DateConverter

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • None
    • None
    • logback-classic
    • None
    • Operating System: All
      Platform: All

    • 117

    Description

      According to the API documentation of SimpleDateFormat, date formats are not synchronized and it is recommended to create separate format instances for each thread.
      However, a possibly simpler (mer efficient) solution would be to synchronize on the SimpleDateFormat object in the convert() method to prevent two threads to access it concurrently.

      Attachments

        1. DateConverter_patch.java
          2 kB
          Anders Hammar
        2. DateFormatPerfTest.java
          5 kB
          Ralph Goers
        3. DoubleCheckedLocking.patch
          2 kB
          Joern Huxhorn

        Activity

          People

            ceki Ceki Gülcü
            andham Anders Hammar
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: