On Tue, 27 Oct 2020 12:48:58 GMT, Chris Hegarty <che...@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 Hi Chris, I've actually thought about `DateTimeFormatter` when I was fixing [8255078](https://bugs.openjdk.java.net/browse/JDK-8255078) / #776, but when I noticed `MDTMformats` and decided to reuse it. anyhow, I have updated `FtpClient` to use `DateTimeFormatter` instead of `SimpleDateFormat`. testing this, I realized that the test added by 8255078 didn't really produce the strings in accordance with RFC 3659; so this PR fixes that as well. Thanks, -- Igor ------------- PR: https://git.openjdk.java.net/jdk/pull/867