From 18c2fa114e6ee9ad909096c27ba12633158ba671 Mon Sep 17 00:00:00 2001 From: Santiago Fernandez Madero Date: Fri, 31 May 2019 14:31:55 -0700 Subject: [PATCH] Revert "Added Range Manipulation APIs to Collection and ObservableCollection (dotnet/corefx#35772)" (dotnet/corefx#38115) * Revert "Added Range Manipulation APIs to Collection and ObservableCollection (dotnet/corefx#35772)" This reverts commit dotnet/corefx@b705522753f09d501762cca6c45d6bd031c112d7. * Baseline API Compat errors * Fix baseline vs netstandard Commit migrated from https://github.com/dotnet/corefx/commit/d2506266dffcf6d83af11d192fa87435048614cb --- .../ObjectModel/ObservableCollection.cs | 159 +------ ...rvableCollection_MethodTests.netcoreapp.cs | 269 ----------- .../ObservableCollection_MethodsTest.cs | 2 +- ...n_SkipCollectionChangedTests.netcoreapp.cs | 126 ------ .../tests/System.ObjectModel.Tests.csproj | 2 - .../System.Runtime/ref/System.Runtime.cs | 7 - .../src/MatchingRefApiCompatBaseline.txt | 7 + .../tests/System.Runtime.Tests.csproj | 3 +- .../ObjectModel/CollectionTests.cs | 13 +- .../ObjectModel/CollectionTests.netcoreapp.cs | 424 ------------------ ...patBaseline.netcoreapp.netstandardOnly.txt | 79 +--- 11 files changed, 34 insertions(+), 1057 deletions(-) delete mode 100644 src/libraries/System.ObjectModel/tests/ObservableCollection/ObservableCollection_MethodTests.netcoreapp.cs delete mode 100644 src/libraries/System.ObjectModel/tests/ObservableCollection/ObservableCollection_SkipCollectionChangedTests.netcoreapp.cs delete mode 100644 src/libraries/System.Runtime/tests/System/Collections/ObjectModel/CollectionTests.netcoreapp.cs diff --git a/src/libraries/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs b/src/libraries/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs index 7dac6ec2f3f7e..f74a2c8c7befb 100644 --- a/src/libraries/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs +++ b/src/libraries/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs @@ -27,9 +27,6 @@ public class ObservableCollection : Collection, INotifyCollectionChanged, [NonSerialized] private int _blockReentrancyCount; - [NonSerialized] - private bool _skipRaisingEvents; - /// /// Initializes a new instance of ObservableCollection that is empty and has default initial capacity. /// @@ -124,95 +121,9 @@ protected override void RemoveItem(int index) base.RemoveItem(index); - if (!_skipRaisingEvents) - { - OnCountPropertyChanged(); - OnIndexerPropertyChanged(); - OnCollectionChanged(NotifyCollectionChangedAction.Remove, removedItem, index); - } - } - - /// - /// Called by base class Collection<T> when a count of items is removed from the list; - /// raises a CollectionChanged event to any listeners. - /// - protected override void RemoveItemsRange(int index, int count) - { - CheckReentrancy(); - - T[] removedItems = null; - - bool ignore = _skipRaisingEvents; - if (!ignore) - { - _skipRaisingEvents = true; - - if (count > 0) - { - removedItems = new T[count]; - for (int i = 0; i < count; i++) - { - removedItems[i] = this[index + i]; - } - } - } - - try - { - base.RemoveItemsRange(index, count); - } - finally - { - if (!ignore) - { - _skipRaisingEvents = false; - } - } - - if (count > 0 && !_skipRaisingEvents) - { - OnCountPropertyChanged(); - OnIndexerPropertyChanged(); - OnCollectionChanged(NotifyCollectionChangedAction.Remove, removedItems, index); - } - } - - /// - /// Called by base class Collection<T> when a collection of items is added to list; - /// raises a CollectionChanged event to any listeners. - /// - protected override void ReplaceItemsRange(int index, int count, IEnumerable collection) - { - CheckReentrancy(); - - _skipRaisingEvents = true; - - T[] itemsToReplace = new T[count - index]; - for (int i = index; i < count; i++) - { - itemsToReplace[i] = this[i]; - } - - try - { - base.ReplaceItemsRange(index, count, collection); - } - finally - { - _skipRaisingEvents = false; - } - - if (!_skipRaisingEvents) - { - IList newItems = collection is IList list ? list : new List(collection); - - if (newItems.Count > 0) - { - OnCountPropertyChanged(); - OnIndexerPropertyChanged(); - OnCollectionChanged(NotifyCollectionChangedAction.Replace, itemsToReplace, newItems, index); - } - } + OnCountPropertyChanged(); + OnIndexerPropertyChanged(); + OnCollectionChanged(NotifyCollectionChangedAction.Remove, removedItem, index); } /// @@ -224,51 +135,9 @@ protected override void InsertItem(int index, T item) CheckReentrancy(); base.InsertItem(index, item); - if (!_skipRaisingEvents) - { - OnCountPropertyChanged(); - OnIndexerPropertyChanged(); - OnCollectionChanged(NotifyCollectionChangedAction.Add, item, index); - } - } - - /// - /// Called by base class Collection<T> when a collection of items is added to list; - /// raises a CollectionChanged event to any listeners. - /// - protected override void InsertItemsRange(int index, IEnumerable collection) - { - CheckReentrancy(); - - bool ignore = _skipRaisingEvents; - if (!ignore) - { - _skipRaisingEvents = true; - } - - try - { - base.InsertItemsRange(index, collection); - } - finally - { - if (!ignore) - { - _skipRaisingEvents = false; - } - } - - if (!_skipRaisingEvents) - { - IList newItems = collection is IList list ? list : new List(collection); - - if (newItems.Count > 0) - { - OnCountPropertyChanged(); - OnIndexerPropertyChanged(); - OnCollectionChanged(NotifyCollectionChangedAction.Add, newItems, index); - } - } + OnCountPropertyChanged(); + OnIndexerPropertyChanged(); + OnCollectionChanged(NotifyCollectionChangedAction.Add, item, index); } /// @@ -396,14 +265,6 @@ private void OnCollectionChanged(NotifyCollectionChangedAction action, object it OnCollectionChanged(new NotifyCollectionChangedEventArgs(action, item, index)); } - /// - /// Helper to raise CollectionChanged event to any listeners - /// - private void OnCollectionChanged(NotifyCollectionChangedAction action, IList items, int index) - { - OnCollectionChanged(new NotifyCollectionChangedEventArgs(action, items, index)); - } - /// /// Helper to raise CollectionChanged event to any listeners /// @@ -420,14 +281,6 @@ private void OnCollectionChanged(NotifyCollectionChangedAction action, object ol OnCollectionChanged(new NotifyCollectionChangedEventArgs(action, newItem, oldItem, index)); } - /// - /// Helper to raise CollectionChanged event to any listeners - /// - private void OnCollectionChanged(NotifyCollectionChangedAction action, IList oldItems, IList newItems, int index) - { - OnCollectionChanged(new NotifyCollectionChangedEventArgs(action, newItems, oldItems, index)); - } - /// /// Helper to raise CollectionChanged event with action == Reset to any listeners /// diff --git a/src/libraries/System.ObjectModel/tests/ObservableCollection/ObservableCollection_MethodTests.netcoreapp.cs b/src/libraries/System.ObjectModel/tests/ObservableCollection/ObservableCollection_MethodTests.netcoreapp.cs deleted file mode 100644 index f15d3c3c463f9..0000000000000 --- a/src/libraries/System.ObjectModel/tests/ObservableCollection/ObservableCollection_MethodTests.netcoreapp.cs +++ /dev/null @@ -1,269 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Linq; -using Xunit; - -namespace System.Collections.ObjectModel.Tests -{ - public partial class ObservableCollection_MethodTests - { - [Fact] - public static void InsertRange_NotifyCollectionChanged_Beginning_Test() - { - int[] dataToInsert = new int[] { 1, 2, 3, 4, 5 }; - int[] initialData = new int[] { 10, 11, 12, 13 }; - int eventCounter = 0; - ObservableCollection collection = new ObservableCollection(initialData); - collection.CollectionChanged += (o, e) => eventCounter++; - - collection.InsertRange(0, dataToInsert); - - Assert.Equal(dataToInsert.Length + initialData.Length, collection.Count); - Assert.Equal(1, eventCounter); - - int[] collectionAssertion = collection.ToArray(); - Assert.Equal(dataToInsert, collectionAssertion.AsSpan(0, 5).ToArray()); - Assert.Equal(initialData, collectionAssertion.AsSpan(5).ToArray()); - } - - [Fact] - public static void InsertRange_NotifyCollectionChanged_Middle_Test() - { - int[] dataToInsert = new int[] { 1, 2, 3, 4, 5 }; - int[] initialData = new int[] { 10, 11, 12, 13 }; - int eventCounter = 0; - ObservableCollection collection = new ObservableCollection(initialData); - collection.CollectionChanged += (o, e) => eventCounter++; - - collection.InsertRange(2, dataToInsert); - - Assert.Equal(dataToInsert.Length + initialData.Length, collection.Count); - Assert.Equal(1, eventCounter); - - int[] collectionAssertion = collection.ToArray(); - Assert.Equal(initialData.AsSpan(0, 2).ToArray(), collectionAssertion.AsSpan(0, 2).ToArray()); - Assert.Equal(dataToInsert, collectionAssertion.AsSpan(2, 5).ToArray()); - Assert.Equal(initialData.AsSpan(2, 2).ToArray(), collectionAssertion.AsSpan(7, 2).ToArray()); - } - - [Fact] - public static void InsertRange_NotifyCollectionChanged_End_Test() - { - int[] dataToInsert = new int[] { 1, 2, 3, 4, 5 }; - int[] initialData = new int[] { 10, 11, 12, 13 }; - int eventCounter = 0; - ObservableCollection collection = new ObservableCollection(initialData); - collection.CollectionChanged += (o, e) => eventCounter++; - - collection.InsertRange(4, dataToInsert); - - Assert.Equal(dataToInsert.Length + initialData.Length, collection.Count); - Assert.Equal(1, eventCounter); - - int[] collectionAssertion = collection.ToArray(); - Assert.Equal(initialData, collectionAssertion.AsSpan(0, 4).ToArray()); - Assert.Equal(dataToInsert, collectionAssertion.AsSpan(4).ToArray()); - } - - [Fact] - public static void AddRange_NotifyCollectionChanged_Test() - { - int[] dataToInsert = new int[] { 1, 2, 3, 4, 5 }; - int[] initialData = new int[] { 10, 11, 12, 13 }; - int eventCounter = 0; - ObservableCollection collection = new ObservableCollection(initialData); - collection.CollectionChanged += (o, e) => eventCounter++; - - collection.AddRange(dataToInsert); - - Assert.Equal(dataToInsert.Length + initialData.Length, collection.Count); - Assert.Equal(1, eventCounter); - - int[] collectionAssertion = collection.ToArray(); - Assert.Equal(initialData, collectionAssertion.AsSpan(0, 4).ToArray()); - Assert.Equal(dataToInsert, collectionAssertion.AsSpan(4).ToArray()); - } - - [Fact] - public static void AddRange_NotifyCollectionChanged_EventArgs_Test() - { - int[] dataToAdd = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 }; - int[] actualDataAdded = new int[0]; - ObservableCollection collection = new ObservableCollection(); - collection.CollectionChanged += (o, e) => actualDataAdded = e.NewItems.Cast().ToArray(); - - collection.AddRange(dataToAdd); - - Assert.Equal(dataToAdd, actualDataAdded); - } - - [Fact] - public static void InsertRange_NotifyCollectionChanged_EventArgs_Test() - { - int[] dataToAdd = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 }; - int[] actualDataAdded = new int[0]; - ObservableCollection collection = new ObservableCollection(); - collection.CollectionChanged += (o, e) => actualDataAdded = e.NewItems.Cast().ToArray(); - - collection.InsertRange(0, dataToAdd); - - Assert.Equal(dataToAdd, actualDataAdded); - } - - [Fact] - public static void InsertRange_NotifyCollectionChanged_EventArgs_Middle_Test() - { - int[] dataToAdd = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 }; - int[] actualDataAdded = new int[0]; - ObservableCollection collection = new ObservableCollection(); - for (int i = 0; i < 4; i++) - { - collection.Add(i); - } - - collection.CollectionChanged += (o, e) => actualDataAdded = e.NewItems.Cast().ToArray(); - collection.InsertRange(2, dataToAdd); - - Assert.Equal(dataToAdd, actualDataAdded); - } - - [Fact] - public static void InsertRange_NotifyCollectionChanged_EventArgs_End_Test() - { - int[] dataToAdd = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 }; - int[] actualDataAdded = new int[0]; - ObservableCollection collection = new ObservableCollection(); - for (int i = 0; i < 4; i++) - { - collection.Add(i); - } - - collection.CollectionChanged += (o, e) => actualDataAdded = e.NewItems.Cast().ToArray(); - collection.InsertRange(4, dataToAdd); - - Assert.Equal(dataToAdd, actualDataAdded); - } - - [Fact] - public static void RemoveRange_NotifyCollectionChanged_FirstTwo_Test() - { - int[] initialData = new int[] { 10, 11, 12, 13 }; - int itemsToRemove = 2; - int eventCounter = 0; - ObservableCollection collection = new ObservableCollection(initialData); - collection.CollectionChanged += (o, e) => eventCounter++; - - collection.RemoveRange(0, itemsToRemove); - - Assert.Equal(initialData.Length - itemsToRemove, collection.Count); - Assert.Equal(1, eventCounter); - Assert.Equal(initialData.AsSpan(2).ToArray(), collection.ToArray()); - } - - [Fact] - public static void RemoveRange_NotifyCollectionChanged_MiddleTwo_Test() - { - int[] initialData = new int[] { 10, 11, 12, 13 }; - int itemsToRemove = 2; - int eventCounter = 0; - ObservableCollection collection = new ObservableCollection(initialData); - collection.CollectionChanged += (o, e) => eventCounter++; - - collection.RemoveRange(1, itemsToRemove); - - Assert.Equal(initialData.Length - itemsToRemove, collection.Count); - Assert.Equal(1, eventCounter); - Assert.Equal(initialData[0], collection[0]); - Assert.Equal(initialData[3], collection[1]); - } - - [Fact] - public static void RemoveRange_NotifyCollectionChanged_LastTwo_Test() - { - int[] initialData = new int[] { 10, 11, 12, 13 }; - int itemsToRemove = 2; - int eventCounter = 0; - ObservableCollection collection = new ObservableCollection(initialData); - collection.CollectionChanged += (o, e) => eventCounter++; - - collection.RemoveRange(2, itemsToRemove); - - Assert.Equal(initialData.Length - itemsToRemove, collection.Count); - Assert.Equal(1, eventCounter); - Assert.Equal(initialData.AsSpan(0, 2).ToArray(), collection.ToArray()); - } - - [Fact] - public static void RemoveRange_NotifyCollectionChanged_IntMaxValueOverflow_Test() - { - int count = 500; - ObservableCollection collection = new ObservableCollection(); - for (int i = 0; i < count; i++) - { - collection.Add(i); - } - - Assert.Throws(() => collection.RemoveRange(collection.Count - 2, int.MaxValue)); - } - - [Fact] - public static void RemoveRange_NotifyCollectionChanged_EventArgs_IndexOfZero_Test() - { - int[] initialData = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 }; - int[] actualDataRemoved = new int[0]; - int numberOfItemsToRemove = 4; - ObservableCollection collection = new ObservableCollection(); - foreach (int item in initialData) - { - collection.Add(item); - } - - collection.CollectionChanged += (o, e) => actualDataRemoved = e.OldItems.Cast().ToArray(); - collection.RemoveRange(0, numberOfItemsToRemove); - - Assert.Equal(initialData.Length - numberOfItemsToRemove, collection.Count); - Assert.Equal(initialData.AsSpan(0, numberOfItemsToRemove).ToArray(), actualDataRemoved); - } - - [Fact] - public static void RemoveRange_NotifyCollectionChanged_EventArgs_IndexMiddle_Test() - { - int[] initialData = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 }; - int[] actualDataRemoved = new int[0]; - int numberOfItemsToRemove = 4; - int startIndex = 3; - ObservableCollection collection = new ObservableCollection(); - foreach (int item in initialData) - { - collection.Add(item); - } - - collection.CollectionChanged += (o, e) => actualDataRemoved = e.OldItems.Cast().ToArray(); - collection.RemoveRange(startIndex, numberOfItemsToRemove); - - Assert.Equal(initialData.Length - numberOfItemsToRemove, collection.Count); - Assert.Equal(initialData.AsSpan(startIndex, numberOfItemsToRemove).ToArray(), actualDataRemoved); - } - - [Fact] - public static void ReplaceRange_NotifyCollectionChanged_Test() - { - int[] initialData = new int[] { 10, 11, 12, 13 }; - int[] dataToReplace = new int[] { 3, 8 }; - int eventCounter = 0; - ObservableCollection collection = new ObservableCollection(initialData); - collection.CollectionChanged += (o, e) => eventCounter++; - - collection.ReplaceRange(0, 2, dataToReplace); - - Assert.Equal(initialData.Length, collection.Count); - Assert.Equal(1, eventCounter); - - int[] collectionAssertion = collection.ToArray(); - Assert.Equal(dataToReplace, collectionAssertion.AsSpan(0, 2).ToArray()); - Assert.Equal(initialData.AsSpan(2, 2).ToArray(), collectionAssertion.AsSpan(2, 2).ToArray()); - } - } -} diff --git a/src/libraries/System.ObjectModel/tests/ObservableCollection/ObservableCollection_MethodsTest.cs b/src/libraries/System.ObjectModel/tests/ObservableCollection/ObservableCollection_MethodsTest.cs index bb291a98a3e4e..6f03a97cc1902 100644 --- a/src/libraries/System.ObjectModel/tests/ObservableCollection/ObservableCollection_MethodsTest.cs +++ b/src/libraries/System.ObjectModel/tests/ObservableCollection/ObservableCollection_MethodsTest.cs @@ -14,7 +14,7 @@ namespace System.Collections.ObjectModel.Tests /// that the CollectionChanged events and eventargs are fired and populated /// properly. /// - public partial class PublicMethodsTest + public static class PublicMethodsTest { /// /// Tests that is possible to Add an item to the collection. diff --git a/src/libraries/System.ObjectModel/tests/ObservableCollection/ObservableCollection_SkipCollectionChangedTests.netcoreapp.cs b/src/libraries/System.ObjectModel/tests/ObservableCollection/ObservableCollection_SkipCollectionChangedTests.netcoreapp.cs deleted file mode 100644 index 9a9b1c6f2120e..0000000000000 --- a/src/libraries/System.ObjectModel/tests/ObservableCollection/ObservableCollection_SkipCollectionChangedTests.netcoreapp.cs +++ /dev/null @@ -1,126 +0,0 @@ -using System.Collections.Generic; -using System.Collections.ObjectModel; -using Xunit; - -namespace System.ObjectModel.Tests.ObservableCollection -{ - public class ObservableCollection_SkipCollectionChangedTests - { - [Fact] - public void SkipCollectionChanged_AddRange_Test() - { - int collectionChangedCounter = 0; - NonNullObservableCollection collection = new NonNullObservableCollection(); - collection.Add("1"); - collection.Add("2"); - collection.Add("3"); - collection.CollectionChanged += (s, e) => collectionChangedCounter++; - - Assert.Throws(() => collection.AddRange(new string[1])); - Assert.Equal(0, collectionChangedCounter); - - collection.Add("4"); - Assert.Equal(1, collectionChangedCounter); - } - - [Fact] - public void SkipCollectionChanged_InsertRange_Test() - { - int collectionChangedCounter = 0; - NonNullObservableCollection collection = new NonNullObservableCollection(); - collection.Add("1"); - collection.Add("2"); - collection.Add("3"); - collection.CollectionChanged += (s, e) => collectionChangedCounter++; - - Assert.Throws(() => collection.InsertRange(0, new string[1])); - Assert.Equal(0, collectionChangedCounter); - - collection.Add("4"); - Assert.Equal(1, collectionChangedCounter); - } - - [Fact] - public void SkipCollectionChanged_RemoveRange_Test() - { - int collectionChangedCounter = 0; - NonNullObservableCollection collection = new NonNullObservableCollection(); - collection.Add("1"); - collection.Add("2"); - collection.Add("3"); - collection.CollectionChanged += (s, e) => collectionChangedCounter++; - - collection.RemoveRange(0, 2); - Assert.Equal(1, collectionChangedCounter); - - collection.Add("1"); - Assert.Equal(2, collectionChangedCounter); - } - - [Fact] - public void SkipCollectionChanged_RemoveRange_NoEventsRaised_Test() - { - int collectionChangedCounter = 0; - NonNullObservableCollection collection = new NonNullObservableCollection(); - collection.Add("1"); - collection.Add("2"); - collection.Add("3"); - collection.CollectionChanged += (s, e) => collectionChangedCounter++; - - collection.RemoveRange(0, 0); - - Assert.Equal(0, collectionChangedCounter); - } - - [Fact] - public void SkipCollectionChanged_ReplaceRange_Test() - { - int collectionChangedCounter = 0; - NonNullObservableCollection collection = new NonNullObservableCollection(); - collection.Add("1"); - collection.Add("2"); - collection.Add("3"); - collection.CollectionChanged += (s, e) => collectionChangedCounter++; - - Assert.Throws(() => collection.ReplaceRange(0, 2, new string[1])); - Assert.Equal(0, collectionChangedCounter); - - collection.Add("1"); - Assert.Equal(1, collectionChangedCounter); - } - - [Fact] - public void SkipCollectionChanged_ReplaceRange_Empty_Test() - { - int collectionChangedCounter = 0; - NonNullObservableCollection collection = new NonNullObservableCollection(); - collection.Add("1"); - collection.Add("2"); - collection.Add("3"); - collection.CollectionChanged += (s, e) => collectionChangedCounter++; - - collection.ReplaceRange(0, 0, new string[0]); - Assert.Equal(0, collectionChangedCounter); - - collection.Add("1"); - Assert.Equal(1, collectionChangedCounter); - } - - public class NonNullObservableCollection : ObservableCollection - { - - public NonNullObservableCollection() : base() { } - public NonNullObservableCollection(List list) : base(list) { } - - protected override void InsertItem(int index, T item) - { - if (item == null) - { - throw new ArgumentNullException(); - } - - base.InsertItem(index, item); - } - } - } -} diff --git a/src/libraries/System.ObjectModel/tests/System.ObjectModel.Tests.csproj b/src/libraries/System.ObjectModel/tests/System.ObjectModel.Tests.csproj index 931f85a0fe816..1bde73923e5af 100644 --- a/src/libraries/System.ObjectModel/tests/System.ObjectModel.Tests.csproj +++ b/src/libraries/System.ObjectModel/tests/System.ObjectModel.Tests.csproj @@ -44,8 +44,6 @@ - - diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index ca4141cc1a44b..cda44ff604ceb 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -4034,7 +4034,6 @@ public Collection(System.Collections.Generic.IList list) { } bool System.Collections.IList.IsReadOnly { get { throw null; } } object System.Collections.IList.this[int index] { get { throw null; } set { } } public void Add(T item) { } - public void AddRange(System.Collections.Generic.IEnumerable collection) { } public void Clear() { } protected virtual void ClearItems() { } public bool Contains(T item) { throw null; } @@ -4043,15 +4042,9 @@ public void CopyTo(T[] array, int index) { } public int IndexOf(T item) { throw null; } public void Insert(int index, T item) { } protected virtual void InsertItem(int index, T item) { } - protected virtual void InsertItemsRange(int index, System.Collections.Generic.IEnumerable collection) { } - public void InsertRange(int index, System.Collections.Generic.IEnumerable collection) { } public bool Remove(T item) { throw null; } public void RemoveAt(int index) { } protected virtual void RemoveItem(int index) { } - protected virtual void RemoveItemsRange(int index, int count) { } - public void RemoveRange(int index, int count) { } - protected virtual void ReplaceItemsRange(int index, int count, System.Collections.Generic.IEnumerable collection) { } - public void ReplaceRange(int index, int count, System.Collections.Generic.IEnumerable collection) { } protected virtual void SetItem(int index, T item) { } void System.Collections.ICollection.CopyTo(System.Array array, int index) { } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } diff --git a/src/libraries/System.Runtime/src/MatchingRefApiCompatBaseline.txt b/src/libraries/System.Runtime/src/MatchingRefApiCompatBaseline.txt index aa7c74c7f725d..1781594c71d33 100644 --- a/src/libraries/System.Runtime/src/MatchingRefApiCompatBaseline.txt +++ b/src/libraries/System.Runtime/src/MatchingRefApiCompatBaseline.txt @@ -7,6 +7,13 @@ MembersMustExist : Member 'System.AppContext.remove_ProcessExit(System.EventHand MembersMustExist : Member 'System.AppContext.remove_UnhandledException(System.UnhandledExceptionEventHandler)' does not exist in the reference but it does exist in the implementation. MembersMustExist : Member 'System.AppContext.SetData(System.String, System.Object)' does not exist in the reference but it does exist in the implementation. MembersMustExist : Member 'System.WeakReference..ctor()' does not exist in the reference but it does exist in the implementation. +MembersMustExist : Member 'System.Collections.ObjectModel.Collection.AddRange(System.Collections.Generic.IEnumerable)' does not exist in the reference but it does exist in the implementation. +MembersMustExist : Member 'System.Collections.ObjectModel.Collection.InsertItemsRange(System.Int32, System.Collections.Generic.IEnumerable)' does not exist in the reference but it does exist in the implementation. +MembersMustExist : Member 'System.Collections.ObjectModel.Collection.InsertRange(System.Int32, System.Collections.Generic.IEnumerable)' does not exist in the reference but it does exist in the implementation. +MembersMustExist : Member 'System.Collections.ObjectModel.Collection.RemoveItemsRange(System.Int32, System.Int32)' does not exist in the reference but it does exist in the implementation. +MembersMustExist : Member 'System.Collections.ObjectModel.Collection.RemoveRange(System.Int32, System.Int32)' does not exist in the reference but it does exist in the implementation. +MembersMustExist : Member 'System.Collections.ObjectModel.Collection.ReplaceItemsRange(System.Int32, System.Int32, System.Collections.Generic.IEnumerable)' does not exist in the reference but it does exist in the implementation. +MembersMustExist : Member 'System.Collections.ObjectModel.Collection.ReplaceRange(System.Int32, System.Int32, System.Collections.Generic.IEnumerable)' does not exist in the reference but it does exist in the implementation. MembersMustExist : Member 'System.Reflection.Module.GetModuleHandleImpl()' does not exist in the reference but it does exist in the implementation. CannotRemoveBaseTypeOrInterface : Type 'System.Runtime.Serialization.DeserializationBlockedException' does not inherit from base type 'System.Runtime.Serialization.SerializationException' in the reference but it does in the implementation. MembersMustExist : Member 'System.Runtime.Serialization.SerializationInfo.DeserializationInProgress.get()' does not exist in the reference but it does exist in the implementation. diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj b/src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj index bc3b39a3f250a..40937ac18fb8e 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj @@ -72,7 +72,6 @@ - @@ -156,6 +155,7 @@ + @@ -234,7 +234,6 @@ - diff --git a/src/libraries/System.Runtime/tests/System/Collections/ObjectModel/CollectionTests.cs b/src/libraries/System.Runtime/tests/System/Collections/ObjectModel/CollectionTests.cs index 0961f2b8812f8..4e1fb2f82eb02 100644 --- a/src/libraries/System.Runtime/tests/System/Collections/ObjectModel/CollectionTests.cs +++ b/src/libraries/System.Runtime/tests/System/Collections/ObjectModel/CollectionTests.cs @@ -1,13 +1,22 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; +using System.Collections; using System.Collections.Generic; +using System.Collections.ObjectModel; using Xunit; namespace System.Collections.ObjectModel.Tests { - public partial class CollectionTests : CollectionTestBase + /// + /// Since is just a wrapper base class around an , + /// we just verify that the underlying list is what we expect, validate that the calls which + /// we expect are forwarded to the underlying list, and verify that the exceptions we expect + /// are thrown. + /// + public class CollectionTests : CollectionTestBase { private static readonly Collection s_empty = new Collection(); diff --git a/src/libraries/System.Runtime/tests/System/Collections/ObjectModel/CollectionTests.netcoreapp.cs b/src/libraries/System.Runtime/tests/System/Collections/ObjectModel/CollectionTests.netcoreapp.cs deleted file mode 100644 index 940af67736262..0000000000000 --- a/src/libraries/System.Runtime/tests/System/Collections/ObjectModel/CollectionTests.netcoreapp.cs +++ /dev/null @@ -1,424 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Collections.Generic; -using System.Linq; -using Xunit; - -namespace System.Collections.ObjectModel.Tests -{ - /// - /// Since is just a wrapper base class around an , - /// we just verify that the underlying list is what we expect, validate that the calls which - /// we expect are forwarded to the underlying list, and verify that the exceptions we expect - /// are thrown. - /// - public partial class CollectionTests : CollectionTestBase - { - [Fact] - public void Collection_AddRange_ToEmpty_Test() - { - int[] expected = new[] { 1, 2, 3, 4 }; - Collection collection = new Collection(); - - collection.AddRange(expected); - - Assert.NotNull(collection); - Assert.Equal(expected.Length, collection.Count); - Assert.Equal(expected, collection.ToArray()); - } - - [Fact] - public void Collection_AddRange_ToExisting_Test() - { - int[] initial = new int[] { 1, 2, 3, 4 }; - int[] dataToInsert = new int[] { 5, 6, 7, 8 }; - Collection collection = new Collection(); - for (int i = 0; i < initial.Length; i++) - collection.Add(initial[i]); - - collection.AddRange(dataToInsert); - - Assert.NotNull(collection); - Assert.Equal(initial.Length + dataToInsert.Length, collection.Count); - - int[] collectionAssertion = collection.ToArray(); - Assert.Equal(initial, collectionAssertion.AsSpan(0, 4).ToArray()); - Assert.Equal(dataToInsert, collectionAssertion.AsSpan(4, 4).ToArray()); - } - - [Fact] - public void Collection_AddRange_Empty_Test() - { - int[] expected = new int[0]; - Collection collection = new Collection(); - - collection.AddRange(expected); - - Assert.NotNull(collection); - Assert.Equal(expected.Length, collection.Count); - } - - [Fact] - public void Collection_AddRange_Null_Test() - { - Collection collection = new Collection(); - Exception ex = Assert.Throws(() => collection.AddRange(null)); - } - - [Fact] - public void Collection_AddRange_ReadOnly_Test() - { - int[] expected = new int[] { 1, 2, 3, 4 }; - int[] baseCollection = new int[] { 5, 6, 7, 8 }; - Collection collection = new Collection(baseCollection); - - Exception ex = Assert.Throws(() => collection.AddRange(expected)); - } - - [Fact] - public void Collection_InsertRange_Beginning_Test() - { - int[] expected = new int[] { 1, 2, 3, 4, 5 }; - int[] originalCollection = new int[] { 10, 11, 12, 13 }; - List baseCollection = new List(originalCollection); - - int expectedLength = expected.Length + originalCollection.Length; - Collection collection = new Collection(baseCollection); - - collection.InsertRange(0, expected); - - Assert.NotNull(collection); - Assert.Equal(expectedLength, collection.Count); - - int[] collectionAssertion = collection.ToArray(); - Assert.Equal(expected, collectionAssertion.AsSpan(0, 5).ToArray()); - Assert.Equal(originalCollection, collectionAssertion.AsSpan(5, 4).ToArray()); - } - - [Fact] - public void Collection_InsertRange_End_Test() - { - int[] expected = new int[] { 1, 2, 3, 4, 5 }; - int[] originalCollection = new int[] { 10, 11, 12, 13 }; - List baseCollection = new List(originalCollection); - - int expectedLength = expected.Length + originalCollection.Length; - Collection collection = new Collection(baseCollection); - - collection.InsertRange(expected.Length - 1, expected); - - Assert.NotNull(collection); - Assert.Equal(expectedLength, collection.Count); - - int[] collectionAssertion = collection.ToArray(); - Assert.Equal(originalCollection, collectionAssertion.AsSpan(0, 4).ToArray()); - Assert.Equal(expected, collectionAssertion.AsSpan(4, 5).ToArray()); - } - - [Fact] - public void Collection_InsertRange_Middle_Test() - { - int[] expected = new int[] { 1, 2, 3, 4, 5 }; - int[] originalCollection = new int[] { 10, 11, 12, 13 }; - List baseCollection = new List(originalCollection); - - int expectedLength = expected.Length + originalCollection.Length; - Collection collection = new Collection(baseCollection); - - collection.InsertRange(2, expected); - - Assert.NotNull(collection); - Assert.Equal(expectedLength, collection.Count); - - int[] collectionAssertion = collection.ToArray(); - Assert.Equal(originalCollection.AsSpan(0, 2).ToArray(), collectionAssertion.AsSpan(0, 2).ToArray()); - Assert.Equal(expected, collectionAssertion.AsSpan(2, 5).ToArray()); - Assert.Equal(originalCollection.AsSpan(2, 2).ToArray(), collectionAssertion.AsSpan(7, 2).ToArray()); - } - - [Fact] - public void Collection_InsertRange_Empty_Test() - { - List baseCollection = new List(new[] { 10, 11, 12, 13 }); - Collection collection = new Collection(baseCollection); - - collection.InsertRange(0, new int[0]); - - Assert.NotNull(collection); - Assert.Equal(baseCollection.Count, collection.Count); - Assert.Equal(baseCollection, collection.ToArray()); - } - - [Fact] - public void Collection_InsertRange_Null_Test() - { - Collection collection = new Collection(); - Exception ex = Assert.Throws(() => collection.InsertRange(0, null)); - } - - [Fact] - public void Collection_InsertRange_ReadOnly_Test() - { - int[] expected = new int[] { 1, 2, 3, 4 }; - int[] baseCollection = new int[] { 5, 6, 7, 8 }; - Collection collection = new Collection(baseCollection); - - Exception ex = Assert.Throws(() => collection.InsertRange(0, expected)); - } - - [Fact] - public void Collection_InsertRange_IndexLessThan0_Test() - { - int[] expected = new int[] { 1, 2, 3, 4 }; - Collection collection = new Collection(); - Exception ex = Assert.Throws(() => collection.InsertRange(-1, expected)); - } - - [Fact] - public void Collection_InsertRange_IndexGreaterThanCount_Test() - { - int[] expected = new int[] { 1, 2, 3, 4 }; - Collection collection = new Collection(); - Exception ex = Assert.Throws(() => collection.InsertRange(10, expected)); - } - - [Fact] - public void Collection_RemoveRange_Overflow_Test() - { - Collection collection = new Collection(); - collection.Add(1); - collection.Add(2); - collection.Add(3); - - Assert.Throws(() => collection.RemoveRange(0, 4)); - } - - [Fact] - public void Collection_RemoveRange_IntMaxValueOverflow_Test() - { - var count = 500; - Collection collection = new Collection(); - for (int i = 0; i < count; i++) - { - collection.Add(i); - } - - Assert.Throws(() => collection.RemoveRange(collection.Count - 2, int.MaxValue)); - } - - [Fact] - public void Collection_RemoveRange_CountIsZero_Test() - { - int[] expected = new int[] { 1, 2, 3, 4, 5 }; - Collection collection = new Collection(); - for (int i = 0; i < expected.Length; i++) - { - collection.Add(expected[i]); - } - - collection.RemoveRange(0, 0); - - Assert.NotNull(collection); - Assert.Equal(expected.Length, collection.Count); - Assert.Equal(expected, collection.ToArray()); - } - - [Fact] - public void Collection_RemoveRange_CountIsLessThanZero_Test() - { - Collection collection = new Collection(); - collection.Add(1); - collection.Add(2); - - Assert.Throws(() => collection.RemoveRange(0, -1)); - } - - [Fact] - public void Collection_RemoveRange_All_Test() - { - Collection collection = new Collection(); - collection.Add(1); - collection.Add(2); - collection.Add(3); - - collection.RemoveRange(0, 3); - - Assert.NotNull(collection); - Assert.Equal(0, collection.Count); - } - - [Fact] - public void Collection_RemoveRange_FirstTwoItems_Test() - { - Collection collection = new Collection(); - collection.Add(1); - collection.Add(2); - collection.Add(3); - - collection.RemoveRange(0, 2); - - Assert.NotNull(collection); - Assert.Equal(1, collection.Count); - Assert.Equal(3, collection[0]); - } - - [Fact] - public void Collection_RemoveRange_LastTwoItems_Test() - { - Collection collection = new Collection(); - collection.Add(1); - collection.Add(2); - collection.Add(3); - - collection.RemoveRange(1, 2); - - Assert.NotNull(collection); - Assert.Equal(1, collection.Count); - Assert.Equal(1, collection[0]); - } - - [Fact] - public void Collection_RemoveRange_ZeroItems_Test() - { - Collection collection = new Collection(); - collection.Add(1); - collection.Add(2); - collection.Add(3); - - collection.RemoveRange(0, 0); - - Assert.NotNull(collection); - Assert.Equal(3, collection.Count); - Assert.Equal(1, collection[0]); - Assert.Equal(2, collection[1]); - Assert.Equal(3, collection[2]); - } - - [Fact] - public void Collection_RemoveRange_IndexLessThanZero_Test() - { - Collection collection = new Collection(); - collection.Add(1); - collection.Add(2); - collection.Add(3); - - AssertExtensions.Throws("index", () => collection.RemoveRange(-1, 3)); - } - - [Fact] - public void Collection_RemoveRange_IndexGreaterThanCollection_Test() - { - Collection collection = new Collection(); - collection.Add(1); - collection.Add(2); - collection.Add(3); - - AssertExtensions.Throws("index", () => collection.RemoveRange(4, 3)); - } - - [Fact] - public void Collection_RemoveRange_ReadOnly_Test() - { - Collection collection = new Collection(new int[] { 1, 2, 3 }); - - Assert.Throws(() => collection.RemoveRange(0, 2)); - } - - [Fact] - public void Collection_ReplaceRange_FirstTwo_Test() - { - int[] initial = new int[] { 1, 2, 3, 4 }; - int[] replace = new int[] { 5, 6, 7, 8 }; - Collection collection = new Collection(); - foreach (var item in initial) - collection.Add(item); - - collection.ReplaceRange(0, 2, replace); - - Assert.NotNull(collection); - Assert.Equal(initial.Length + 2, collection.Count); - - int[] collectionAssertion = collection.ToArray(); - Assert.Equal(replace, collectionAssertion.AsSpan(0, 4).ToArray()); - Assert.Equal(initial.AsSpan(2, 2).ToArray(), collectionAssertion.AsSpan(4, 2).ToArray()); - } - - [Fact] - public void Collection_ReplaceRange_LastTwo_Test() - { - int[] initial = new int[] { 1, 2, 3, 4 }; - int[] replace = new int[] { 5, 6, 7, 8 }; - Collection collection = new Collection(); - foreach (var item in initial) - collection.Add(item); - - collection.ReplaceRange(2, 2, replace); - - Assert.NotNull(collection); - Assert.Equal(initial.Length + 2, collection.Count); - - int[] collectionAssertion = collection.ToArray(); - Assert.Equal(initial.AsSpan(0, 2).ToArray(), collectionAssertion.AsSpan(0, 2).ToArray()); - Assert.Equal(replace.AsSpan(0, 4).ToArray(), collectionAssertion.AsSpan(2, 4).ToArray()); - } - - [Fact] - public void Collection_ReplaceRange_MiddleTwo_Test() - { - int[] initial = new int[] { 1, 2, 3, 4 }; - int[] replace = new int[] { 5, 6, 7, 8 }; - Collection collection = new Collection(); - foreach (var item in initial) - collection.Add(item); - - collection.ReplaceRange(1, 2, replace); - - Assert.NotNull(collection); - Assert.Equal(initial.Length + 2, collection.Count); - - Assert.Equal(initial[0], collection[0]); - Assert.Equal(replace, collection.ToArray().AsSpan(1, 4).ToArray()); - Assert.Equal(initial[3], collection[5]); - } - - [Fact] - public void Collection_ReplaceRange_NullCollection_Test() - { - Collection collection = new Collection(); - collection.Add(1); - collection.Add(2); - - Assert.Throws(() => collection.ReplaceRange(0, 2, null)); - } - - [Fact] - public void Collection_ReplaceRange_ReadOnly_Test() - { - Collection collection = new Collection(new int[] { 1, 2, 3 }); - Assert.Throws(() => collection.ReplaceRange(0, 2, new int[] { 4, 5 })); - } - - [Fact] - public void Collection_ReplaceRange_IndexLessThanZero_Test() - { - Collection collection = new Collection(); - collection.Add(1); - collection.Add(2); - - AssertExtensions.Throws("index", () => collection.ReplaceRange(-2, 2, new int[] { 1, 2 })); - } - - [Fact] - public void Collection_ReplaceRange_IndexGreaterThanCount_Test() - { - Collection collection = new Collection(); - collection.Add(1); - collection.Add(2); - - AssertExtensions.Throws("index", () => collection.ReplaceRange(4, 2, new int[] { 1, 2 })); - } - } -} diff --git a/src/libraries/shims/ApiCompatBaseline.netcoreapp.netstandardOnly.txt b/src/libraries/shims/ApiCompatBaseline.netcoreapp.netstandardOnly.txt index e9bfcd79b73f7..49cbbe47e1731 100644 --- a/src/libraries/shims/ApiCompatBaseline.netcoreapp.netstandardOnly.txt +++ b/src/libraries/shims/ApiCompatBaseline.netcoreapp.netstandardOnly.txt @@ -1,9 +1,14 @@ Compat issues with assembly netstandard: +MembersMustExist : Member 'System.Collections.ObjectModel.Collection.AddRange(System.Collections.Generic.IEnumerable)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Collections.ObjectModel.Collection.InsertItemsRange(System.Int32, System.Collections.Generic.IEnumerable)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Collections.ObjectModel.Collection.InsertRange(System.Int32, System.Collections.Generic.IEnumerable)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Collections.ObjectModel.Collection.RemoveItemsRange(System.Int32, System.Int32)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Collections.ObjectModel.Collection.RemoveRange(System.Int32, System.Int32)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Collections.ObjectModel.Collection.ReplaceItemsRange(System.Int32, System.Int32, System.Collections.Generic.IEnumerable)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Collections.ObjectModel.Collection.ReplaceRange(System.Int32, System.Int32, System.Collections.Generic.IEnumerable)' does not exist in the implementation but it does exist in the contract. CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultEventAttribute' exists on 'System.ComponentModel.BackgroundWorker' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Diagnostics.SwitchLevelAttribute' exists on 'System.Diagnostics.BooleanSwitch' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultEventAttribute' exists on 'System.Diagnostics.Process' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultPropertyAttribute' exists on 'System.Diagnostics.Process' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Diagnostics.SwitchLevelAttribute' exists on 'System.Diagnostics.TraceSwitch' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultEventAttribute' exists on 'System.IO.FileSystemWatcher' in the contract but not the implementation. MembersMustExist : Member 'System.Reflection.Emit.AssemblyBuilder.SetEntryPoint(System.Reflection.MethodInfo)' does not exist in the implementation but it does exist in the contract. MembersMustExist : Member 'System.Reflection.Emit.ConstructorBuilder.GetModule()' does not exist in the implementation but it does exist in the contract. @@ -19,9 +24,6 @@ TypesMustExist : Type 'System.Reflection.Emit.ExceptionHandler' does not exist i MembersMustExist : Member 'System.Reflection.Emit.FieldBuilder.GetToken()' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.Reflection.Emit.FieldToken' does not exist in the implementation but it does exist in the contract. CannotRemoveBaseTypeOrInterface : Type 'System.Reflection.Emit.GenericTypeParameterBuilder' does not inherit from base type 'System.Reflection.TypeInfo' in the implementation but it does in the contract. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Reflection.Emit.Label' in the contract but not the implementation. -CannotRemoveBaseTypeOrInterface : Type 'System.Reflection.Emit.Label' does not implement interface 'System.IEquatable' in the implementation but it does in the contract. -TypeCannotChangeClassification : Type 'System.Reflection.Emit.Label' is marked as readonly in the contract so it must also be marked readonly in the implementation. MembersMustExist : Member 'System.Reflection.Emit.MethodBuilder.CreateMethodBody(System.Byte[], System.Int32)' does not exist in the implementation but it does exist in the contract. MembersMustExist : Member 'System.Reflection.Emit.MethodBuilder.GetModule()' does not exist in the implementation but it does exist in the contract. MembersMustExist : Member 'System.Reflection.Emit.MethodBuilder.GetToken()' does not exist in the implementation but it does exist in the contract. @@ -41,9 +43,6 @@ MembersMustExist : Member 'System.Reflection.Emit.ModuleBuilder.GetTypeToken(Sys MembersMustExist : Member 'System.Reflection.Emit.ModuleBuilder.GetTypeToken(System.Type)' does not exist in the implementation but it does exist in the contract. MembersMustExist : Member 'System.Reflection.Emit.ModuleBuilder.IsTransient()' does not exist in the implementation but it does exist in the contract. MembersMustExist : Member 'System.Reflection.Emit.ModuleBuilder.SetUserEntryPoint(System.Reflection.MethodInfo)' does not exist in the implementation but it does exist in the contract. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Reflection.Emit.OpCode' in the contract but not the implementation. -CannotRemoveBaseTypeOrInterface : Type 'System.Reflection.Emit.OpCode' does not implement interface 'System.IEquatable' in the implementation but it does in the contract. -TypeCannotChangeClassification : Type 'System.Reflection.Emit.OpCode' is marked as readonly in the contract so it must also be marked readonly in the implementation. MembersMustExist : Member 'System.Reflection.Emit.ParameterBuilder.GetToken()' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.Reflection.Emit.ParameterToken' does not exist in the implementation but it does exist in the contract. MembersMustExist : Member 'System.Reflection.Emit.PropertyBuilder.PropertyToken.get()' does not exist in the implementation but it does exist in the contract. @@ -58,66 +57,4 @@ TypesMustExist : Type 'System.Reflection.Emit.TypeToken' does not exist in the i CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Runtime.InteropServices.ManagedToNativeComInteropStubAttribute' changed from '[AttributeUsageAttribute(AttributeTargets.Method, Inherited=false)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Method, Inherited=false, AllowMultiple=false)]' in the implementation. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Xml.Serialization.XmlAnyAttributeAttribute' changed from '[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple=false)]' in the implementation. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Xml.Serialization.XmlNamespaceDeclarationsAttribute' changed from '[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple=false)]' in the implementation. -MembersMustExist : Member 'System.Range.GetOffsetAndLength(System.Int32)' does not exist in the implementation but it does exist in the contract. -TypesMustExist : Type 'System.Range.OffsetAndLength' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Memory.Item.get(System.Range)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Memory.Slice(System.Index)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Memory.Slice(System.Range)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.ReadOnlyMemory.Item.get(System.Range)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.ReadOnlyMemory.Slice(System.Index)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.ReadOnlyMemory.Slice(System.Range)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.ReadOnlySpan.Item.get(System.Index)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.ReadOnlySpan.Item.get(System.Range)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.ReadOnlySpan.Slice(System.Index)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.ReadOnlySpan.Slice(System.Range)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Span.Item.get(System.Index)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Span.Item.get(System.Range)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Span.Slice(System.Index)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Span.Slice(System.Range)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.String.Chars.get(System.Index)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.String.Chars.get(System.Range)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.String.Substring(System.Index)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.String.Substring(System.Range)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Utf8String.Slice(System.Int32, System.Int32)' does not exist in the implementation but it does exist in the contract. -CannotSealType : Type 'System.ComponentModel.BaseNumberConverter' is effectively (has a private constructor) sealed in the implementation but not sealed in the contract. -MembersMustExist : Member 'System.ComponentModel.BaseNumberConverter..ctor()' does not exist in the implementation but it does exist in the contract. -CannotMakeMemberNonVirtual : Member 'System.ComponentModel.BaseNumberConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext, System.Type)' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.ComponentModel.BaseNumberConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext, System.Type)' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.ComponentModel.BaseNumberConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext, System.Globalization.CultureInfo, System.Object)' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.ComponentModel.BaseNumberConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext, System.Globalization.CultureInfo, System.Object, System.Type)' is non-virtual in the implementation but is virtual in the contract. -MembersMustExist : Member 'System.Threading.Tasks.TaskExtensions.ConfigureAwait(System.IAsyncDisposable, System.Boolean)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Threading.Tasks.TaskExtensions.ConfigureAwait(System.Collections.Generic.IAsyncEnumerable, System.Boolean)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Threading.Tasks.TaskExtensions.WithCancellation(System.Collections.Generic.IAsyncEnumerable, System.Threading.CancellationToken)' does not exist in the implementation but it does exist in the contract. -CannotSealType : Type 'System.Xml.Schema.XmlSchemaDatatype' is effectively (has a private constructor) sealed in the implementation but not sealed in the contract. -MembersMustExist : Member 'System.Xml.Schema.XmlSchemaDatatype..ctor()' does not exist in the implementation but it does exist in the contract. -CannotMakeMemberNonVirtual : Member 'System.Xml.Schema.XmlSchemaDatatype.TokenizedType' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Xml.Schema.XmlSchemaDatatype.TypeCode' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Xml.Schema.XmlSchemaDatatype.ValueType' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Xml.Schema.XmlSchemaDatatype.Variety' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Xml.Schema.XmlSchemaDatatype.ChangeType(System.Object, System.Type)' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Xml.Schema.XmlSchemaDatatype.ChangeType(System.Object, System.Type, System.Xml.IXmlNamespaceResolver)' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Xml.Schema.XmlSchemaDatatype.IsDerivedFrom(System.Xml.Schema.XmlSchemaDatatype)' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Xml.Schema.XmlSchemaDatatype.ParseValue(System.String, System.Xml.XmlNameTable, System.Xml.IXmlNamespaceResolver)' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Xml.Schema.XmlSchemaDatatype.TokenizedType.get()' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Xml.Schema.XmlSchemaDatatype.TypeCode.get()' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Xml.Schema.XmlSchemaDatatype.ValueType.get()' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Xml.Schema.XmlSchemaDatatype.Variety.get()' is non-virtual in the implementation but is virtual in the contract. -CannotSealType : Type 'System.Xml.Schema.XmlSchemaGroupBase' is effectively (has a private constructor) sealed in the implementation but not sealed in the contract. -MembersMustExist : Member 'System.Xml.Schema.XmlSchemaGroupBase..ctor()' does not exist in the implementation but it does exist in the contract. -CannotMakeMemberNonVirtual : Member 'System.Xml.Schema.XmlSchemaGroupBase.Items' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Xml.Schema.XmlSchemaGroupBase.Items.get()' is non-virtual in the implementation but is virtual in the contract. -CannotSealType : Type 'System.Data.Constraint' is effectively (has a private constructor) sealed in the implementation but not sealed in the contract. -MembersMustExist : Member 'System.Data.Constraint..ctor()' does not exist in the implementation but it does exist in the contract. -CannotMakeMemberNonVirtual : Member 'System.Data.Constraint.ConstraintName' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Data.Constraint.Table' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Data.Constraint._DataSet' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Data.Constraint.ConstraintName.get()' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Data.Constraint.ConstraintName.set(System.String)' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Data.Constraint.Table.get()' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Data.Constraint.ToString()' is non-virtual in the implementation but is virtual in the contract. -CannotMakeMemberNonVirtual : Member 'System.Data.Constraint._DataSet.get()' is non-virtual in the implementation but is virtual in the contract. -CannotSealType : Type 'System.Linq.EnumerableExecutor' is effectively (has a private constructor) sealed in the implementation but not sealed in the contract. -MembersMustExist : Member 'System.Linq.EnumerableExecutor..ctor()' does not exist in the implementation but it does exist in the contract. -CannotSealType : Type 'System.Linq.EnumerableQuery' is effectively (has a private constructor) sealed in the implementation but not sealed in the contract. -MembersMustExist : Member 'System.Linq.EnumerableQuery..ctor()' does not exist in the implementation but it does exist in the contract. -Total Issues: 121 +Total Issues: 58 \ No newline at end of file