Replace ArgumentNullException(nameof()) -> ArgumentNullException.ThrowIfNull() 2#18792
Conversation
src/Microsoft.Management.UI.Internal/ManagementList/Common/WpfHelp.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Management.UI.Internal/ManagementList/Common/WpfHelp.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/DefaultStringConverter.cs
Show resolved
Hide resolved
src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/AllModulesViewModel.cs
Show resolved
Hide resolved
src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/AllModulesViewModel.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/SessionBasedWrapper.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
…Help.cs Co-authored-by: Ilya <darpa@yandex.ru>
…Help.cs Co-authored-by: Ilya <darpa@yandex.ru>
|
We will get ArgumentOutOfRangeException.ThrowIfZero() only with .Net 8.0 in next January. |
|
What can I do about this build error? I'll revert waiting for .Net8.0 |
src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/SessionBasedWrapper.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Show resolved
Hide resolved
…ization/SessionBasedWrapper.cs Co-authored-by: Ilya <darpa@yandex.ru>
src/System.Management.Automation/namespaces/FileSystemProvider.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/namespaces/FileSystemProvider.cs
Outdated
Show resolved
Hide resolved
This comment was marked as spam.
This comment was marked as spam.
src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/DefaultStringConverter.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/AllModulesViewModel.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/utils/perfCounters/CounterSetRegistrarBase.cs
Show resolved
Hide resolved
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
| { | ||
| throw new ArgumentNullException("element"); | ||
| } | ||
| ArgumentNullException.ThrowIfNull(parent, nameof(element)); |
There was a problem hiding this comment.
@xtqqczze The second parameter appears to be incorrect.
There was a problem hiding this comment.
@iSazonov suggested this change #18792 (comment)
There was a problem hiding this comment.
The code is frozen and we should keep its behavior unchanged.
PR Summary
Continues #18784
8 search results for
throw new ArgumentNullException(, I don't think they should be changedPR Context
The new API ArgumentNullException.ThrowIfNull allows you to omit the parameter name, in which case it will use the name of the argument passed in. The passed in argument usually is the parameter to be validated, so that's just the right name to use when calling
ArgumentNullException.ThrowIfNull(argument).