Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2774

ICU4J DecimalFormat is thread-safe as of ICU 59

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.5.0
    • Clean Ups
    • None

    Description

      The ICU4J DecimalFormat java docs have this to say about thread safety:

      Starting with ICU 59, instances of DecimalFormat are thread-safe.

      Under the hood, DecimalFormat maintains an immutable formatter object that is rebuilt whenever any of the property setters are called. It is therefore best practice to call property setters only during construction and not when formatting numbers online.

      This wasn't the case when we originally started using DecimalFormat, so we have a number of ThreadLocal[DecimalFormat]'s through our codebase. We should remove these ThreadLocal's–makes the code cleaner and could potentially improve performance by removing any ThreadLocal overhead.

      Attachments

        Activity

          People

            slawrence Steve Lawrence
            slawrence Steve Lawrence
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: