ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 46857] New: Thread-unsafe use of DateFormat
Date Sun, 15 Mar 2009 22:20:33 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=46857

           Summary: Thread-unsafe use of DateFormat
           Product: Ant
           Version: 1.7.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: notifications@ant.apache.org
        ReportedBy: ceaemeelote@gmail.com


The class org.apache.tools.ant.util.DateUtils has static field
DATE_HEADER_FORMAT of type DateFormat. This type is unsafe for multithreaded
use (from JavaDoc: "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.")
So either method getDateFromFormat (the only one using DATE_HEADER_FORMAT)
should be synchronized or new synchronized methods for accessing
DATE_HEADER_FORMAT should be written

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message