Skip to content

Commit bb36e34

Browse files
authored
Automatic port of System.Collections exceptions (#4689)
* Automatic port of System.Collections exceptions * Apply suggestions from code review Co-authored-by: carlossanlop <[email protected]>
1 parent 16a2201 commit bb36e34

File tree

8 files changed

+35
-2
lines changed

8 files changed

+35
-2
lines changed

xml/System.Collections.Concurrent/ConcurrentDictionary`2.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,6 +1208,9 @@
12081208
<remarks>To be added.</remarks>
12091209
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
12101210
<related type="Article" href="/dotnet/standard/collections/thread-safe/how-to-add-and-remove-items">How to: Add and Remove Items from a ConcurrentDictionary</related>
1211+
<exception cref="T:System.ArgumentNullException">The <see cref="P:System.Collections.Generic.KeyValuePair`2.Key" /> of <paramref name="keyValuePair" /> is <see langword="null" />.</exception>
1212+
<exception cref="T:System.OverflowException">The <see cref="T:System.Collections.Generic.Dictionary`2" /> contains too many elements.</exception>
1213+
<exception cref="T:System.ArgumentException">An element with the same key already exists in the <see cref="T:System.Collections.Generic.Dictionary`2" />.</exception>
12111214
</Docs>
12121215
</Member>
12131216
<Member MemberName="System.Collections.Generic.ICollection&lt;System.Collections.Generic.KeyValuePair&lt;TKey,TValue&gt;&gt;.Contains">
@@ -1298,6 +1301,16 @@
12981301
<remarks>To be added.</remarks>
12991302
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
13001303
<related type="Article" href="/dotnet/standard/collections/thread-safe/how-to-add-and-remove-items">How to: Add and Remove Items from a ConcurrentDictionary</related>
1304+
<exception cref="T:System.ArgumentNullException">
1305+
<paramref name="array" /> is <see langword="null" />.</exception>
1306+
<exception cref="T:System.ArgumentOutOfRangeException">
1307+
<paramref name="index" /> is less than 0.</exception>
1308+
<exception cref="T:System.ArgumentException">
1309+
<paramref name="index" /> is equal to or greater than the length of the <paramref name="array" />.
1310+
1311+
-or-
1312+
1313+
The number of elements in the source <see cref="T:System.Collections.ICollection" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />.</exception>
13011314
</Docs>
13021315
</Member>
13031316
<Member MemberName="System.Collections.Generic.ICollection&lt;System.Collections.Generic.KeyValuePair&lt;TKey,TValue&gt;&gt;.IsReadOnly">
@@ -1384,6 +1397,7 @@
13841397
<remarks>To be added.</remarks>
13851398
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
13861399
<related type="Article" href="/dotnet/standard/collections/thread-safe/how-to-add-and-remove-items">How to: Add and Remove Items from a ConcurrentDictionary</related>
1400+
<exception cref="T:System.ArgumentNullException">The <see cref="P:System.Collections.Generic.KeyValuePair`2.Key" /> property of <paramref name="keyValuePair" /> is <see langword="null" />.</exception>
13871401
</Docs>
13881402
</Member>
13891403
<Member MemberName="System.Collections.Generic.IDictionary&lt;TKey,TValue&gt;.Add">
@@ -2388,6 +2402,7 @@ Both the specifed key and value must match the entry in the dictionary for it to
23882402
23892403
]]></format>
23902404
</remarks>
2405+
<exception cref="T:System.ArgumentNullException">The <see cref="P:System.Collections.Generic.KeyValuePair`2.Key" /> property of <paramref name="item" /> is <see langword="null" />.</exception>
23912406
</Docs>
23922407
</Member>
23932408
<Member MemberName="TryRemove">

xml/System.Collections.Generic/IReadOnlySet`1.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</Interface>
2525
</Interfaces>
2626
<Docs>
27-
<typeparam name="T">To be added.</typeparam>
27+
<typeparam name="T">The type of elements in the set.</typeparam>
2828
<summary>Provides a readonly abstraction of a set.</summary>
2929
<remarks>To be added.</remarks>
3030
</Docs>

xml/System.Collections.Immutable/ImmutableArray`1.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,6 +2318,7 @@
23182318
23192319
]]></format>
23202320
</remarks>
2321+
<exception cref="T:System.InvalidOperationException">The <see cref="P:System.Collections.Immutable.ImmutableArray`1.IsDefault" /> property returns <see langword="true" />.</exception>
23212322
</Docs>
23222323
</Member>
23232324
<Member MemberName="System.Collections.Generic.IList&lt;T&gt;.Insert">

xml/System.Collections.Immutable/ImmutableDictionary`2.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,10 @@
863863
<param name="value">The object to use as the value of the element to add.</param>
864864
<summary>Adds an element with the provided key and value to the immutable dictionary.</summary>
865865
<remarks>To be added.</remarks>
866+
<exception cref="T:System.ArgumentNullException">
867+
<paramref name="key" /> is <see langword="null" />.</exception>
868+
<exception cref="T:System.ArgumentException">An element with the same key already exists in the <see cref="T:System.Collections.Generic.IDictionary`2" />.</exception>
869+
<exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.IDictionary`2" /> is read-only.</exception>
866870
</Docs>
867871
</Member>
868872
<Member MemberName="System.Collections.Generic.IDictionary&lt;TKey,TValue&gt;.Item">
@@ -965,6 +969,9 @@
965969
<returns>
966970
<see langword="true" /> if the element is successfully removed; otherwise, <see langword="false" />. This method also returns <see langword="false" /> if <paramref name="key" /> was not found in the original generic dictionary.</returns>
967971
<remarks>To be added.</remarks>
972+
<exception cref="T:System.ArgumentNullException">
973+
<paramref name="key" /> is <see langword="null" />.</exception>
974+
<exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.IDictionary`2" /> is read-only.</exception>
968975
</Docs>
969976
</Member>
970977
<Member MemberName="System.Collections.Generic.IDictionary&lt;TKey,TValue&gt;.Values">

xml/System.Collections.Immutable/ImmutableList`1.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1882,7 +1882,7 @@
18821882
18831883
]]></format>
18841884
</remarks>
1885-
<exception cref="T:System.NotImplementedException" />
1885+
<exception cref="T:System.NotSupportedException">Always thrown.</exception>
18861886
</Docs>
18871887
</Member>
18881888
<Member MemberName="System.Collections.Generic.ICollection&lt;T&gt;.Clear">
@@ -1997,6 +1997,7 @@
19971997
19981998
]]></format>
19991999
</remarks>
2000+
<exception cref="T:System.NotSupportedException">Always thrown.</exception>
20002001
</Docs>
20012002
</Member>
20022003
<Member MemberName="System.Collections.Generic.IEnumerable&lt;T&gt;.GetEnumerator">

xml/System.Collections.Immutable/ImmutableQueue`1.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@
488488
489489
]]></format>
490490
</remarks>
491+
<exception cref="T:System.InvalidOperationException">Thrown when the queue is empty.</exception>
491492
</Docs>
492493
</Member>
493494
<Member MemberName="System.Collections.Immutable.IImmutableQueue&lt;T&gt;.Enqueue">

xml/System.Collections.Immutable/ImmutableSortedDictionary`2.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,10 @@
843843
<param name="value">The object to use as the value of the element to add.</param>
844844
<summary>Adds an element with the provided key and value to the generic dictionary.</summary>
845845
<remarks>To be added.</remarks>
846+
<exception cref="T:System.ArgumentNullException">
847+
<paramref name="key" /> is <see langword="null" />.</exception>
848+
<exception cref="T:System.ArgumentException">An element with the same key already exists in the <see cref="T:System.Collections.Generic.IDictionary`2" />.</exception>
849+
<exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.IDictionary`2" /> is read-only.</exception>
846850
</Docs>
847851
</Member>
848852
<Member MemberName="System.Collections.Generic.IDictionary&lt;TKey,TValue&gt;.Item">
@@ -945,6 +949,9 @@
945949
<returns>
946950
<see langword="true" /> if the element is successfully removed; otherwise, <see langword="false" />. This method also returns <see langword="false" /> if <paramref name="key" /> was not found in the original generic dictionary.</returns>
947951
<remarks>To be added.</remarks>
952+
<exception cref="T:System.ArgumentNullException">
953+
<paramref name="key" /> is <see langword="null" />.</exception>
954+
<exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.IDictionary`2" /> is read-only.</exception>
948955
</Docs>
949956
</Member>
950957
<Member MemberName="System.Collections.Generic.IDictionary&lt;TKey,TValue&gt;.Values">

xml/System.Collections.Immutable/ImmutableStack`1.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@
485485
486486
]]></format>
487487
</remarks>
488+
<exception cref="T:System.InvalidOperationException">The stack is empty.</exception>
488489
</Docs>
489490
</Member>
490491
<Member MemberName="System.Collections.Immutable.IImmutableStack&lt;T&gt;.Push">

0 commit comments

Comments
 (0)