ICEfaces
  1. ICEfaces
  2. ICE-9543

DateFormat utility is not thread safe

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3, EE-3.3.0.GA
    • Fix Version/s: EE-3.3.0.GA_P01, 4.0.BETA, 4.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Any
    • Assignee Priority:
      P1
    • Salesforce Case Reference:

      Description

      In the org.icefaces.impl.util.Util class, we provide a static DateFormat for formatting and parsing dates for HTTP headers:

          public static final DateFormat HTTP_DATE =
                  new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.ENGLISH);

      This utility is used throughout our code (components, ACE, framework). However, according to the JavaDoc for DateFormat:

      "Date formats are not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently, it must be synchronized externally."

      We should change our technique to provide thread-safe acquisition and use of the formatter.

        Issue Links

          Activity

            People

            • Assignee:
              Mircea Toma
              Reporter:
              Deryk Sinotte
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: