-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8255078: sun/net/ftp/imp/FtpClient$MLSxParser uses wrong datetime format #776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Welcome back iignatyev! A progress list of the required criteria for merging this PR into |
Webrevs
|
Hi Igor, is this testable - and if so shouldn't there be a test? |
Hi Daniel, it's testable and originally I planned to add a new test, however upon checking the existing mock ftp-servers, I realized that none of them support MLSx commands, and adding that support doesn't seem to be justified for such a trivial fix. With that being said, I can create a test for this if you believe it's necessary. -- Igor |
I took another stab on the test and it turned out to be easier than I originally anticipated. I, however, decided to take a safer approach and don't use FtpServer -- Igor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding a test Igor!
If that passes on all platform then this looks good to me.
@iignatev This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 88 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Thanks, Daniel. /integrate |
@iignatev Since your change was applied there have been 88 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 6545e19. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
} | ||
return null; | ||
} | ||
|
||
private static Date parseRfc3659TimeValue(String s) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this method be synchronized because SimpleDateFormat
is not thread-safe, but instances are stored in the static field dateFormats
?
(Note though that this issue existed before as well)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @Marcono1234, it indeed needs to be synchronized
, I'll take care of fixing that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iignatev if you decide to log a followup a better alternative might be to use DateTimeFormatter
Hi all,
could you please review this small patch?
according to RFC3659, time values in MLSx response have the following format:
MLSxParser
, however, usesSimpleDateFormat("yyyyMMddhhmmss")
(which is wrong b/c it useshh
instead ofHH
and doesn't account for optional.sss
) to parse modify/create facts and ignore any parse exceptions.FtpClient
actually already has and usesSimpleDateFormat
w/ right formats ingetLastModified
where it parses MDTM response, the patch refactors the code to reuse the sameSimpleDateFormat
inMLSxParser
.testing:
test/jdk/sun/net
on{linux,windows,macosx}-x64
Progress
Testing
Failed test task
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/776/head:pull/776
$ git checkout pull/776