Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5660

JsonOutput Date formatting is not threadsafe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.8.8, 2.0.2, 2.1.0-beta-1
    • JSON
    • None

    Description

      JsonOutput is using a static SimpleDateFormat object. This is not a threadsafe use of that class.

      See http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html#synchronization for more details.

      I did create a test case for this, but these are hard cases to test and it looks pretty ugly. I will happily submit it, however, if it helps.

      Attachments

        1. JsonOutput.groovy.diff
          2 kB
          Johnny Wey

        Activity

          People

            guillaume Guillaume Sauthier
            johnnywey Johnny Wey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: