Skip to content
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

Fix TimeZoneInfo.Equals and TimeZoneInfo.HasSameRules #88869

Merged
merged 7 commits into from
Jul 16, 2023

Conversation

RenderMichael
Copy link
Contributor

Based on #88641 (comment)

On Linux, different UTC aliases for produce TimeZoneInfos which have all the same rules, but some have _adjustmentRules == null and others _adjustmentRules == []. The corresponding API GetAdjustmentRules() returns an empty array if the underlying value is null:

public AdjustmentRule[] GetAdjustmentRules()
{
if (_adjustmentRules == null)
{
return Array.Empty<AdjustmentRule>();
}

public AdjustmentRule[] GetAdjustmentRules()
{
if (_adjustmentRules == null)
{
return Array.Empty<AdjustmentRule>();
}

Which implies that these two values are equivalent.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Jul 13, 2023
@ghost
Copy link

ghost commented Jul 13, 2023

Tagging subscribers to this area: @dotnet/area-system-datetime
See info in area-owners.md if you want to be subscribed.

Issue Details

Based on #88641 (comment)

On Linux, different UTC aliases for produce TimeZoneInfos which have all the same rules, but some have _adjustmentRules == null and others _adjustmentRules == []. The corresponding API GetAdjustmentRules() returns an empty array if the underlying value is null:

public AdjustmentRule[] GetAdjustmentRules()
{
if (_adjustmentRules == null)
{
return Array.Empty<AdjustmentRule>();
}

public AdjustmentRule[] GetAdjustmentRules()
{
if (_adjustmentRules == null)
{
return Array.Empty<AdjustmentRule>();
}

Which implies that these two values are equivalent.

Author: RenderMichael
Assignees: -
Labels:

community-contribution, area-System.DateTime

Milestone: -

@RenderMichael
Copy link
Contributor Author

Build failure is #88868, PTAL @tarekgh

@ghost ghost added the needs-author-action An issue or pull request that requires more info or actions from the author. label Jul 16, 2023
@tarekgh
Copy link
Member

tarekgh commented Jul 16, 2023

@RenderMichael all failures are known unrelated issues https://github.com/dotnet/runtime/pull/88869/checks?check_run_id=15059873081. Please try to look at the suggestion #88869 (comment).

@ghost ghost removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Jul 16, 2023
@RenderMichael
Copy link
Contributor Author

@tarekgh Glad there's a way to express the test's prerequisites in a less ad-hoc way! Ready for review

@tarekgh tarekgh merged commit 2763624 into dotnet:main Jul 16, 2023
162 of 166 checks passed
@ghost ghost locked as resolved and limited conversation to collaborators Aug 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.DateTime community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants