Wpf: Possible invalid date when incrementing or decrementing the year on February 29th in a leap year

Created on 6 Feb 2020  路  5Comments  路  Source: dotnet/wpf

https://github.com/dotnet/wpf/blob/b30a16a465c9a0ed7e641a9d55df2f6e5c878a81/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/UnsupportedAutomationProxies/WindowsCalendar.cs#L1791-L1802

MultiScan.exe -p -v -o %temp%\results.sarif UIAutomationClientSideProviders\ms\Internal\UnsupportedAutomationProxies\WindowsCalendar.cs
info: Microsoft.EngSys.CodeScan.MultiScan.Core.MultiScanner[0]
      Detected a Git repository at C:\src\r2\wpf\
dbug: Microsoft.EngSys.CodeScan.MultiScan.Core.MultiScanner[0]
      Scanned UIAutomationClientSideProviders\ms\Internal\UnsupportedAutomationProxies\WindowsCalendar.cs in 5500.2 ms.
warn: Microsoft.EngSys.CodeScan.MultiScan.Core.MultiScanner[0]
      Found in UIAutomationClientSideProviders\ms\Internal\UnsupportedAutomationProxies\WindowsCalendar.cs(1795,56): YearIncrementCSScanner - Possible invalid date when incrementing or decrementing the year on February 29th in a leap year.
info: Microsoft.EngSys.CodeScan.MultiScan.Core.MultiScanner[0]
      Found 1 hits in 1 files.
dbug: Microsoft.EngSys.CodeScan.MultiScan.Core.MultiScanner[0]
      Blame took 77 ms for all files.
info: Microsoft.EngSys.CodeScan.MultiScan.Core.MultiScanner[0]
      Total Run Time: 00:00:06.088
issue-type-bug

Most helpful comment

They might not even be included in the build, in the project file they are commented out.

All 5 comments

@gomathip02, @dotnet/wpf-developers, If this really needs a fix, it needs to happen by EoW (7th Feb, 2020).

/cc @rbhanda

As far as I can tell, WindowsCalendar is only used by WindowsDateTimePicker, which is not used anywhere else in our codebase. None of these are public classes either.

This might be dead code, despite being included in the build.

They might not even be included in the build, in the project file they are commented out.

That's what I get for just looking at line results in a grep.

Closing this since we're not actually using the code. It's been kept around for historical reasons (it was moved over from .NET Framework like this).

Was this page helpful?
0 / 5 - 0 ratings