Skip to content

fix: skip whitespace after non-comma in readLocalDate for UTF8 reader - #4005

Merged
wenshao merged 5 commits into
alibaba:mainfrom
mengnankkkk:hotfix/fix-4004
Mar 14, 2026
Merged

wenshao merged 5 commits into
alibaba:mainfrom
mengnankkkk:hotfix/fix-4004

Conversation

@mengnankkkk

Copy link
Copy Markdown
Contributor

What this PR does / why we need it?

Close #4004

Summary of your change

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

@wenshao

wenshao commented Mar 10, 2026

Copy link
Copy Markdown
Member

单测跑不过,merge from main分支试下

@wenshao

wenshao commented Mar 10, 2026

Copy link
Copy Markdown
Member

fix: fix localdata 含义模糊,且 "localdata" 拼写错误(应为 "LocalDate")。建议改为:
fix: skip whitespace after non-comma in readLocalDate for UTF8 reader

@wenshao

wenshao commented Mar 10, 2026 •

Copy link
Copy Markdown
Member

同文件第 6178 行有完全相同的 if (comma = (ch == ',')) { ... } 模式(处理带时间的日期字符串),也缺少 else 分支。如果这里的修复是正确的,那第 6178 行大概率也需要同样的修复。建议作者检查并一并修复。

此外,文件中其他多处使用此模式的位置(如第 5852、5949 等行)也没有 else 分支。需要系统性地审查是否所有这些位置都存在相同问题。

@wenshao

wenshao commented Mar 10, 2026

Copy link
Copy Markdown
Member

测试覆盖了三种场景:

  • "2025-01-02" — 标准日期
  • "2025-01-02", — 带尾逗号(trailing comma,宽松解析)
  • "2025-01-02 00:00:00" — 带时间

这些测试合理。但建议补充:

  • 日期后紧跟 } 且有空白的场景:{"birthday": "2025-01-02" }(这才是此 bug 的核心触发场景)
  • 多字段对象中日期不在最后的场景
  • JSONReaderASCII 或 JSONReaderUTF16 是否有相同问题

@mengnankkkk mengnankkkk changed the title fix: fix localdata fix: skip whitespace after non-comma in readLocalDate for UTF8 reader Mar 11, 2026
@wenshao
wenshao merged commit 7bceed2 into alibaba:main Mar 14, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] parseObject illegal fieldName with LocalDate

2 participants