This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Updated Exception Handling for Collection<T> #23290
Merged
stephentoub
merged 5 commits into
dotnet:master
from
HoeflingSoftware:collection_exceptions
Mar 22, 2019
Merged
Updated Exception Handling for Collection<T> #23290
stephentoub
merged 5 commits into
dotnet:master
from
HoeflingSoftware:collection_exceptions
Mar 22, 2019
Conversation
This file contains 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
…er name is collection
…'t explicitly reference a list
jkotas
reviewed
Mar 16, 2019
src/System.Private.CoreLib/shared/System/Collections/ObjectModel/Collection.cs
Show resolved
Hide resolved
jkotas
approved these changes
Mar 17, 2019
stephentoub
reviewed
Mar 18, 2019
src/System.Private.CoreLib/shared/System/Collections/ObjectModel/Collection.cs
Outdated
Show resolved
Hide resolved
stephentoub
approved these changes
Mar 18, 2019
safern
reviewed
Mar 18, 2019
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.
other than @stephentoub's comment, LGTM
…ge_IndexException() when the ExceptionArgument was 'Index'
stephentoub
approved these changes
Mar 22, 2019
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.
Thanks.
Dotnet-GitSync-Bot
pushed a commit
to Dotnet-GitSync-Bot/corefx
that referenced
this pull request
Mar 22, 2019
* Updated Argument Helper param from list->collection since the parameter name is collection * Updated exception message to use an out of range exception that doesn't explicitly reference a list * Simplified if statements that verify if the index is out of range * Updated if logic to be simplified using (uint) * Updated exception handling to throw ThrowHelper.ThrowArgumentOutOfRange_IndexException() when the ExceptionArgument was 'Index' Signed-off-by: dotnet-bot <[email protected]>
Dotnet-GitSync-Bot
pushed a commit
to Dotnet-GitSync-Bot/corert
that referenced
this pull request
Mar 22, 2019
* Updated Argument Helper param from list->collection since the parameter name is collection * Updated exception message to use an out of range exception that doesn't explicitly reference a list * Simplified if statements that verify if the index is out of range * Updated if logic to be simplified using (uint) * Updated exception handling to throw ThrowHelper.ThrowArgumentOutOfRange_IndexException() when the ExceptionArgument was 'Index' Signed-off-by: dotnet-bot <[email protected]>
jkotas
pushed a commit
to dotnet/corert
that referenced
this pull request
Mar 22, 2019
* Updated Argument Helper param from list->collection since the parameter name is collection * Updated exception message to use an out of range exception that doesn't explicitly reference a list * Simplified if statements that verify if the index is out of range * Updated if logic to be simplified using (uint) * Updated exception handling to throw ThrowHelper.ThrowArgumentOutOfRange_IndexException() when the ExceptionArgument was 'Index' Signed-off-by: dotnet-bot <[email protected]>
jkotas
pushed a commit
to dotnet/corefx
that referenced
this pull request
Mar 22, 2019
* Updated Argument Helper param from list->collection since the parameter name is collection * Updated exception message to use an out of range exception that doesn't explicitly reference a list * Simplified if statements that verify if the index is out of range * Updated if logic to be simplified using (uint) * Updated exception handling to throw ThrowHelper.ThrowArgumentOutOfRange_IndexException() when the ExceptionArgument was 'Index' Signed-off-by: dotnet-bot <[email protected]>
Dotnet-GitSync-Bot
pushed a commit
to Dotnet-GitSync-Bot/mono
that referenced
this pull request
Mar 22, 2019
* Updated Argument Helper param from list->collection since the parameter name is collection * Updated exception message to use an out of range exception that doesn't explicitly reference a list * Simplified if statements that verify if the index is out of range * Updated if logic to be simplified using (uint) * Updated exception handling to throw ThrowHelper.ThrowArgumentOutOfRange_IndexException() when the ExceptionArgument was 'Index' Signed-off-by: dotnet-bot <[email protected]>
marek-safar
pushed a commit
to mono/mono
that referenced
this pull request
Mar 22, 2019
* Updated Argument Helper param from list->collection since the parameter name is collection * Updated exception message to use an out of range exception that doesn't explicitly reference a list * Simplified if statements that verify if the index is out of range * Updated if logic to be simplified using (uint) * Updated exception handling to throw ThrowHelper.ThrowArgumentOutOfRange_IndexException() when the ExceptionArgument was 'Index' Signed-off-by: dotnet-bot <[email protected]>
picenka21
pushed a commit
to picenka21/runtime
that referenced
this pull request
Feb 18, 2022
* Updated Argument Helper param from list->collection since the parameter name is collection * Updated exception message to use an out of range exception that doesn't explicitly reference a list * Simplified if statements that verify if the index is out of range * Updated if logic to be simplified using (uint) * Updated exception handling to throw ThrowHelper.ThrowArgumentOutOfRange_IndexException() when the ExceptionArgument was 'Index' Commit migrated from dotnet/coreclr@01adae8
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Part of #23166
This change addresses follow-up concerns on how we are throwing different exceptions in the Collection class for add range APIs which are used ObservableCollection as well.
@stephentoub highlighted several follow up concerns which I believe I have covered in this PR and in the comment here.
#23166 (comment)
#23166 (comment)
#23166 (comment)
#23166 (comment)
#23166 (comment)
I don't think is appropriate to adjust the parameters or code as recommended. As
List.cs
uses the exact same exception and we wrote our code to follow the same standard asList.cs
which is what we have been doing while we work through this change. @stephentoub if this is not correct, please advise on direction.coreclr/src/System.Private.CoreLib/shared/System/Collections/Generic/List.cs
Lines 927 to 928 in b93891a
cc: @ahsonkhan, @safern, @justinvp