-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Conversation
* Equates null and empty adjustment rules
Tagging subscribers to this area: @dotnet/area-system-datetime Issue DetailsBased on #88641 (comment) On Linux, different UTC aliases for produce TimeZoneInfos which have all the same rules, but some have runtime/src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Unix.cs Lines 140 to 146 in a3c21b9
runtime/src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Win32.cs Lines 81 to 87 in a3c21b9
Which implies that these two values are equivalent.
|
@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). |
@tarekgh Glad there's a way to express the test's prerequisites in a less ad-hoc way! Ready for review |
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 APIGetAdjustmentRules()
returns an empty array if the underlying value is null:runtime/src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Unix.cs
Lines 140 to 146 in a3c21b9
runtime/src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Win32.cs
Lines 81 to 87 in a3c21b9
Which implies that these two values are equivalent.