Imported Upstream version 6.0.0.172

Former-commit-id: f3cc9b82f3e5bd8f0fd3ebc098f789556b44e9cd
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-04-12 14:10:50 +00:00
parent 8016999e4d
commit 64ac736ec5
32155 changed files with 3981439 additions and 75368 deletions

View File

@ -37,6 +37,10 @@ using System.Collections;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
#if NETCORE
using Internal.Runtime.CompilerServices;
#endif
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.ConstrainedExecution;
@ -106,7 +110,7 @@ namespace System
internal bool InternalArray__ICollection_Contains<T> (T item)
{
if (this.Rank > 1)
throw new RankException (Locale.GetText ("Only single dimension arrays are supported."));
throw new RankException ("Only single dimension arrays are supported.");
int length = this.Length;
for (int i = 0; i < length; i++) {
@ -161,7 +165,7 @@ namespace System
internal int InternalArray__IndexOf<T> (T item)
{
if (this.Rank > 1)
throw new RankException (Locale.GetText ("Only single dimension arrays are supported."));
throw new RankException ("Only single dimension arrays are supported.");
int length = this.Length;
for (int i = 0; i < length; i++) {
@ -364,8 +368,7 @@ namespace System
var lb = GetLowerBound (0);
if (index < lb || index > GetUpperBound (0))
throw new IndexOutOfRangeException (Locale.GetText (
"Index has to be between upper and lower bound of the array."));
throw new IndexOutOfRangeException ("Index has to be between upper and lower bound of the array.");
if (GetType ().GetElementType ().IsPointer)
throw new NotSupportedException ("Type is not supported.");
@ -392,8 +395,7 @@ namespace System
var lb = GetLowerBound (0);
if (index < lb || index > GetUpperBound (0))
throw new IndexOutOfRangeException (Locale.GetText (
"Index has to be >= lower bound and <= upper bound of the array."));
throw new IndexOutOfRangeException ("Index has to be >= lower bound and <= upper bound of the array.");
if (GetType ().GetElementType ().IsPointer)
throw new NotSupportedException ("Type is not supported.");
@ -490,18 +492,16 @@ namespace System
throw new NotSupportedException ("Array type can not be an open generic type");
if (lengths.Length < 1)
throw new ArgumentException (Locale.GetText ("Arrays must contain >= 1 elements."));
throw new ArgumentException ("Arrays must contain >= 1 elements.");
if (lengths.Length != lowerBounds.Length)
throw new ArgumentException (Locale.GetText ("Arrays must be of same size."));
throw new ArgumentException ("Arrays must be of same size.");
for (int j = 0; j < lowerBounds.Length; j ++) {
if (lengths [j] < 0)
throw new ArgumentOutOfRangeException ("lengths", Locale.GetText (
"Each value has to be >= 0."));
throw new ArgumentOutOfRangeException ("lengths", "Each value has to be >= 0.");
if ((long)lowerBounds [j] + (long)lengths [j] > (long)Int32.MaxValue)
throw new ArgumentOutOfRangeException ("lengths", Locale.GetText (
"Length + bound must not exceed Int32.MaxValue."));
throw new ArgumentOutOfRangeException ("lengths", "Length + bound must not exceed Int32.MaxValue.");
}
if (lengths.Length > 255)
@ -558,19 +558,16 @@ namespace System
throw new ArgumentNullException ("destinationArray");
if (length < 0)
throw new ArgumentOutOfRangeException ("length", Locale.GetText (
"Value has to be >= 0."));;
throw new ArgumentOutOfRangeException ("length", "Value has to be >= 0.");
if (sourceArray.Rank != destinationArray.Rank)
throw new RankException(SR.Rank_MultiDimNotSupported);
if (sourceIndex < 0)
throw new ArgumentOutOfRangeException ("sourceIndex", Locale.GetText (
"Value has to be >= 0."));;
throw new ArgumentOutOfRangeException ("sourceIndex", "Value has to be >= 0.");
if (destinationIndex < 0)
throw new ArgumentOutOfRangeException ("destinationIndex", Locale.GetText (
"Value has to be >= 0."));;
throw new ArgumentOutOfRangeException ("destinationIndex", "Value has to be >= 0.");
if (FastCopy (sourceArray, sourceIndex, destinationArray, destinationIndex, length))
return;
@ -670,12 +667,20 @@ namespace System
static int IndexOfImpl<T>(T[] array, T value, int startIndex, int count)
{
#if NETCORE
throw new NotImplementedException ();
#else
return EqualityComparer<T>.Default.IndexOf (array, value, startIndex, count);
#endif
}
static int LastIndexOfImpl<T>(T[] array, T value, int startIndex, int count)
{
#if NETCORE
throw new NotImplementedException ();
#else
return EqualityComparer<T>.Default.LastIndexOf (array, value, startIndex, count);
#endif
}
static void SortImpl (Array keys, Array items, int index, int length, IComparer comparer)