Repository navigation
fix: honor explicit offsets with region time zones - #7975
Open
dongyikuan919 wants to merge 1 commit into
Open
dongyikuan919 wants to merge 1 commit into
dongyikuan919 wants to merge 1 commit into
Conversation
This branch has not been deployed
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?
Refs #7974. An explicit offset in an ISO text value specifies the instant, but Fastjson2 could discard it when a named region was also present. During a daylight-saving overlap, parsing
2024-10-27T02:30:00+01:00[Europe/Paris]returned the earlier+02:00occurrence. TheZ[Europe/London]form also discarded the region.Summary of your change
In both text parser paths, determine the instant from the supplied offset and represent it in the supplied region. This PR covers reading text values that already contain both fields. Write-side preservation and JSONB are still tracked in #7974.
Three regression cases reproduced the old behavior and now pass for String, UTF-16
char[], and UTF-8byte[]inputs. The four affected test classes passed 160 tests through the Mavencorereactor on JDK 17 with zero Checkstyle violations. A separate JDK 8 smoke run verified the three cases through all three input types.Please indicate you've done the following:
中文说明
关联 #7974。ISO 文本同时包含明确偏移和地区时区时,解析使用偏移确定实际时刻,并保留地区时区。本次改动覆盖文本读取,序列化与 JSONB 问题继续由 #7974 跟踪。
新增巴黎、伦敦和纽约的回拨用例,验证 String、char[] 和 byte[] 输入。JDK 17 的 Maven
core相关测试共 160 项通过,Checkstyle 无违规。JDK 8 也单独验证了三个用例。OpenAI Codex assisted with reproduction, implementation, and testing.