RFR: 8255405: sun/net/ftp/imp/FtpClient uses SimpleDateFormat in not thread-safe manner
Chris Hegarty
chegar at openjdk.java.net
Tue Oct 27 12:51:20 UTC 2020
On Mon, 26 Oct 2020 16:51:25 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
@iignatev Please evaluate using DateTimeFormatter, as suggested by @dfuch in https://bugs.openjdk.java.net/browse/JDK-8255405?focusedCommentId=14376774&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14376774
-------------
PR: https://git.openjdk.java.net/jdk/pull/867
More information about the net-dev
mailing list