Open
Conversation
Member
|
单测跑不过,merge from main分支试下 |
Member
|
感谢修复!核心思路是对的——移除 dateFormat == null 的提前返回,确保 ISO8601 等格式标志不被跳过。unixtime/millis 路径直接用 instant.toEpochMilli() 避免无意义的 ZonedDateTime 中转,也是不错的优化。 有几点建议:
无格式配置是 Instant 最常见的使用场景。原来在第 40 行就直接返回了,现在会多走一遍 yyyyMMddhhmmss 检查、创建 ZonedDateTime、检查 ISO8601、获取 formatter,最终才调用 writeInstant(instant)。 建议在 unixtime/millis 检查之后加回一个更精确的快速路径: if (dateFormat == null 这样既不会跳过格式标志,又保留了常见场景的快速路径。
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it?
Close #4003
在 ObjectWriterImplInstant.java 中,当 dateFormat 为 null 时,代码会直接调用 jsonWriter.writeInstant 并返回,导致后续的 ISO8601 格式检查逻辑永远不会执行
Summary of your change
Please indicate you've done the following: