-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Replace ArgumentNullException(nameof()) -> ArgumentNullException.ThrowIfNull() 2 #18792
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
Merged
iSazonov
merged 28 commits into
PowerShell:master
from
CarloToso:throw-new-ArgumentNullException(nameof())-2
Dec 16, 2022
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
5c9d708
changed 10 files
CarloToso 0dc86e7
changed 11 files
CarloToso 6eff253
changed 9 files
CarloToso 47c5609
fix copy-pasting error
CarloToso c9cbbd0
changed 10 files
CarloToso d89a304
changed 8 files
CarloToso 243cdf6
fix GetCommandCommand.cs
CarloToso d49a699
removed space
CarloToso ae3795d
Update src/Microsoft.Management.UI.Internal/ManagementList/Common/Wpf…
CarloToso 6466bfb
Update src/Microsoft.Management.UI.Internal/ManagementList/Common/Wpf…
CarloToso fd5fe0e
remove extra spaces
CarloToso 899b322
comment out - ArgumentOutOfRangeException.ThrowIfZero()
CarloToso 166b05f
ArgumentOutOfRangeException
CarloToso 61d099d
revert ??
CarloToso 1d2b15c
forgot if
CarloToso 8252f13
replace throw new system.ArgumentNullException
CarloToso b834d37
Update src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdlet…
CarloToso febe972
fix test_FileSystemProvider.cs:line 87
CarloToso 33e8fc2
Update with suggestion
CarloToso 5904d7e
revert
CarloToso 192c4ee
Merge branch 'master' into throw-new-ArgumentNullException(nameof())-2
CarloToso 17dae3d
Update src/Microsoft.WSMan.Management/ConfigProvider.cs
CarloToso ecd907a
test_FileSystemProvider.cs
CarloToso 0109312
FileSystemProvider.cs
CarloToso 3347046
Update src/System.Management.Automation/namespaces/FileSystemProvider.cs
iSazonov 60e2307
Update src/System.Management.Automation/utils/BackgroundDispatcher.cs
iSazonov 2933e95
Update src/System.Management.Automation/engine/Utils.cs
iSazonov 3a9d5b2
Apply suggestions from code review
iSazonov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1740,10 +1740,7 @@ internal static class Requires | |
| { | ||
| internal static void NotNull(object value, string paramName) | ||
| { | ||
| if (value == null) | ||
| { | ||
| throw new ArgumentNullException(paramName); | ||
| } | ||
| ArgumentNullException.ThrowIfNull(value, paramName); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In follow PR we could replace all |
||
| } | ||
|
|
||
| internal static void NotNullOrEmpty(string value, string paramName) | ||
|
|
@@ -1756,7 +1753,9 @@ internal static void NotNullOrEmpty(string value, string paramName) | |
|
|
||
| internal static void NotNullOrEmpty(ICollection value, string paramName) | ||
| { | ||
| if (value == null || value.Count == 0) | ||
| ArgumentNullException.ThrowIfNull(value, paramName); | ||
|
|
||
| if (value.Count == 0) | ||
| { | ||
| throw new ArgumentNullException(paramName); | ||
| } | ||
|
|
||
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
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
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
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
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xtqqczze The second parameter appears to be incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iSazonov suggested this change #18792 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is frozen and we should keep its behavior unchanged.