RFR: 8255405: sun/net/ftp/imp/FtpClient uses SimpleDateFormat in not thread-safe manner [v3]
Chris Hegarty
chegar at openjdk.java.net
Wed Oct 28 17:11:57 UTC 2020
On Wed, 28 Oct 2020 15:25:06 GMT, Igor Ignatyev <iignatyev at openjdk.org> wrote:
>> Hi all,
>>
>> could you please review this small and trivial fix?
>>
>> `sun/net/ftp/imp/FtpClient::dateFormats` is an array of `SimpleDateFormat` which are shared among all instances of `FtpClient`. the fact that `SimpleDateFormat` isn't thread-safe renders`FtpClient` to be non-thread-safe as well. the patch makes the only usage of `dateFormats` array, `parseRfc3659TimeValue` method, `synchronized`.
>>
>> the problem was reported in #776
>>
>> Thanks,
>> -- Igor
>
> Igor Ignatyev has updated the pull request incrementally with two additional commits since the last revision:
>
> - use UTC TZ for RFC3659_DATETIME_FORMAT
> - run TestFtpTimeValue with different user.timezone
Marked as reviewed by chegar (Reviewer).
-------------
PR: https://git.openjdk.java.net/jdk/pull/867
More information about the net-dev
mailing list