From 8ebd0d46e5315ce91f70b540e23f5ed96b70050c Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Thu, 12 Nov 2020 08:00:18 -0800 Subject: [PATCH] Validate ref/src parameter names (#43838) Ensure our reference assembly parameter names match implementation. Align all current mismatches. --- .../src/System/Attribute.CoreCLR.cs | 18 +++++++------- src/libraries/Directory.Build.props | 1 + .../ref/Microsoft.VisualBasic.Core.cs | 2 +- .../src/ApiCompatBaseline.txt | 11 +++++++++ .../src/MatchingRefApiCompatBaseline.txt | 12 ++++++++++ .../System.Collections/ref/System.Collections.cs | 2 +- .../ref/System.Numerics.Vectors.cs | 28 +++++++++++----------- .../src/System/IO/StreamWriter.cs | 6 ++--- src/libraries/System.Runtime/ref/System.Runtime.cs | 20 ++++++++-------- ...System.Security.Cryptography.Pkcs.netcoreapp.cs | 4 ++-- .../Cryptography/Pkcs/Rfc3161TimestampRequest.cs | 4 ++-- .../Cryptography/Pkcs/Rfc3161TimestampToken.cs | 8 +++---- .../Cryptography/Pkcs/Rfc3161TimestampTokenInfo.cs | 8 +++---- .../ref/System.Security.Permissions.cs | 4 ++-- .../src/System/Data/Common/DBDataPermission.cs | 10 ++++---- 15 files changed, 81 insertions(+), 57 deletions(-) create mode 100644 src/libraries/Microsoft.VisualBasic.Core/src/ApiCompatBaseline.txt diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Attribute.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Attribute.CoreCLR.cs index 7a44e3c..e7ca19e 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Attribute.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Attribute.CoreCLR.cs @@ -430,27 +430,27 @@ namespace System #region Public Statics #region MemberInfo - public static Attribute[] GetCustomAttributes(MemberInfo element, Type type) + public static Attribute[] GetCustomAttributes(MemberInfo element, Type attributeType) { - return GetCustomAttributes(element, type, true); + return GetCustomAttributes(element, attributeType, true); } - public static Attribute[] GetCustomAttributes(MemberInfo element, Type type, bool inherit) + public static Attribute[] GetCustomAttributes(MemberInfo element, Type attributeType, bool inherit) { if (element == null) throw new ArgumentNullException(nameof(element)); - if (type == null) - throw new ArgumentNullException(nameof(type)); + if (attributeType == null) + throw new ArgumentNullException(nameof(attributeType)); - if (!type.IsSubclassOf(typeof(Attribute)) && type != typeof(Attribute)) + if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute)) throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass); return element.MemberType switch { - MemberTypes.Property => InternalGetCustomAttributes((PropertyInfo)element, type, inherit), - MemberTypes.Event => InternalGetCustomAttributes((EventInfo)element, type, inherit), - _ => (element.GetCustomAttributes(type, inherit) as Attribute[])!, + MemberTypes.Property => InternalGetCustomAttributes((PropertyInfo)element, attributeType, inherit), + MemberTypes.Event => InternalGetCustomAttributes((EventInfo)element, attributeType, inherit), + _ => (element.GetCustomAttributes(attributeType, inherit) as Attribute[])!, }; } diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props index b48551a..493d5d4 100644 --- a/src/libraries/Directory.Build.props +++ b/src/libraries/Directory.Build.props @@ -84,6 +84,7 @@ $(IsSourceProject) $(IsSourceProject) + true $(RepositoryEngineeringDir)DefaultGenApiDocIds.txt,$(RepositoryEngineeringDir)ApiCompatExcludeAttributes.txt diff --git a/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs b/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs index ff0c35f..e1f95bc 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs @@ -606,7 +606,7 @@ namespace Microsoft.VisualBasic public static string FormatNumber(object? Expression, int NumDigitsAfterDecimal = -1, Microsoft.VisualBasic.TriState IncludeLeadingDigit = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState UseParensForNegativeNumbers = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState GroupDigits = Microsoft.VisualBasic.TriState.UseDefault) { throw null; } public static string FormatPercent(object? Expression, int NumDigitsAfterDecimal = -1, Microsoft.VisualBasic.TriState IncludeLeadingDigit = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState UseParensForNegativeNumbers = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState GroupDigits = Microsoft.VisualBasic.TriState.UseDefault) { throw null; } public static char GetChar(string str, int Index) { throw null; } - public static int InStr(int StartPos, string? String1, string? String2, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } + public static int InStr(int Start, string? String1, string? String2, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } public static int InStr(string? String1, string? String2, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } public static int InStrRev(string? StringCheck, string? StringMatch, int Start = -1, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } public static string? Join(object?[] SourceArray, string? Delimiter = " ") { throw null; } diff --git a/src/libraries/Microsoft.VisualBasic.Core/src/ApiCompatBaseline.txt b/src/libraries/Microsoft.VisualBasic.Core/src/ApiCompatBaseline.txt new file mode 100644 index 0000000..1f68939 --- /dev/null +++ b/src/libraries/Microsoft.VisualBasic.Core/src/ApiCompatBaseline.txt @@ -0,0 +1,11 @@ +# C# doesn't permit setting the parameter name of the setter. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.ComClassAttribute.InterfaceShadows.set(System.Boolean)' is 'AutoPropertyValue' in the implementation but 'value' in the contract. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.DateAndTime.DateString.set(System.String)' is 'Value' in the implementation but 'value' in the contract. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.DateAndTime.TimeOfDay.set(System.DateTime)' is 'Value' in the implementation but 'value' in the contract. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.DateAndTime.TimeString.set(System.String)' is 'Value' in the implementation but 'value' in the contract. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.DateAndTime.Today.set(System.DateTime)' is 'Value' in the implementation but 'value' in the contract. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.ErrObject.Description.set(System.String)' is 'Value' in the implementation but 'value' in the contract. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.ErrObject.HelpContext.set(System.Int32)' is 'Value' in the implementation but 'value' in the contract. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.ErrObject.HelpFile.set(System.String)' is 'Value' in the implementation but 'value' in the contract. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.ErrObject.Number.set(System.Int32)' is 'Value' in the implementation but 'value' in the contract. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.ErrObject.Source.set(System.String)' is 'Value' in the implementation but 'value' in the contract. diff --git a/src/libraries/Microsoft.VisualBasic.Core/src/MatchingRefApiCompatBaseline.txt b/src/libraries/Microsoft.VisualBasic.Core/src/MatchingRefApiCompatBaseline.txt index 510cc69..9e14950 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/src/MatchingRefApiCompatBaseline.txt +++ b/src/libraries/Microsoft.VisualBasic.Core/src/MatchingRefApiCompatBaseline.txt @@ -21,3 +21,15 @@ TypesMustExist : Type 'Microsoft.VisualBasic.CompilerServices.SiteDelegate4' doe TypesMustExist : Type 'Microsoft.VisualBasic.CompilerServices.SiteDelegate5' does not exist in the reference but it does exist in the implementation. TypesMustExist : Type 'Microsoft.VisualBasic.CompilerServices.SiteDelegate6' does not exist in the reference but it does exist in the implementation. TypesMustExist : Type 'Microsoft.VisualBasic.CompilerServices.SiteDelegate7' does not exist in the reference but it does exist in the implementation. + +# C# doesn't permit setting the parameter name of the setter. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.ComClassAttribute.InterfaceShadows.set(System.Boolean)' is 'value' in the reference but 'AutoPropertyValue' in the implementation. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.DateAndTime.DateString.set(System.String)' is 'value' in the reference but 'Value' in the implementation. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.DateAndTime.TimeOfDay.set(System.DateTime)' is 'value' in the reference but 'Value' in the implementation. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.DateAndTime.TimeString.set(System.String)' is 'value' in the reference but 'Value' in the implementation. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.DateAndTime.Today.set(System.DateTime)' is 'value' in the reference but 'Value' in the implementation. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.ErrObject.Description.set(System.String)' is 'value' in the reference but 'Value' in the implementation. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.ErrObject.HelpContext.set(System.Int32)' is 'value' in the reference but 'Value' in the implementation. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.ErrObject.HelpFile.set(System.String)' is 'value' in the reference but 'Value' in the implementation. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.ErrObject.Number.set(System.Int32)' is 'value' in the reference but 'Value' in the implementation. +ParameterNamesCannotChange : Parameter name on member 'Microsoft.VisualBasic.ErrObject.Source.set(System.String)' is 'value' in the reference but 'Value' in the implementation. diff --git a/src/libraries/System.Collections/ref/System.Collections.cs b/src/libraries/System.Collections/ref/System.Collections.cs index 334a67a..405eea4 100644 --- a/src/libraries/System.Collections/ref/System.Collections.cs +++ b/src/libraries/System.Collections/ref/System.Collections.cs @@ -568,7 +568,7 @@ namespace System.Collections.Generic void System.Collections.Generic.ICollection>.CopyTo(System.Collections.Generic.KeyValuePair[] array, int arrayIndex) { } bool System.Collections.Generic.ICollection>.Remove(System.Collections.Generic.KeyValuePair keyValuePair) { throw null; } System.Collections.Generic.IEnumerator> System.Collections.Generic.IEnumerable>.GetEnumerator() { throw null; } - void System.Collections.ICollection.CopyTo(System.Array array, int arrayIndex) { } + void System.Collections.ICollection.CopyTo(System.Array array, int index) { } void System.Collections.IDictionary.Add(object key, object? value) { } bool System.Collections.IDictionary.Contains(object key) { throw null; } System.Collections.IDictionaryEnumerator System.Collections.IDictionary.GetEnumerator() { throw null; } diff --git a/src/libraries/System.Numerics.Vectors/ref/System.Numerics.Vectors.cs b/src/libraries/System.Numerics.Vectors/ref/System.Numerics.Vectors.cs index ea873ba..7e293b8 100644 --- a/src/libraries/System.Numerics.Vectors/ref/System.Numerics.Vectors.cs +++ b/src/libraries/System.Numerics.Vectors/ref/System.Numerics.Vectors.cs @@ -269,32 +269,32 @@ namespace System.Numerics public static System.Numerics.Vector Multiply(System.Numerics.Vector left, System.Numerics.Vector right) where T : struct { throw null; } public static System.Numerics.Vector Multiply(System.Numerics.Vector left, T right) where T : struct { throw null; } public static System.Numerics.Vector Multiply(T left, System.Numerics.Vector right) where T : struct { throw null; } - public static System.Numerics.Vector Narrow(System.Numerics.Vector source1, System.Numerics.Vector source2) { throw null; } + public static System.Numerics.Vector Narrow(System.Numerics.Vector low, System.Numerics.Vector high) { throw null; } [System.CLSCompliantAttribute(false)] - public static System.Numerics.Vector Narrow(System.Numerics.Vector source1, System.Numerics.Vector source2) { throw null; } - public static System.Numerics.Vector Narrow(System.Numerics.Vector source1, System.Numerics.Vector source2) { throw null; } - public static System.Numerics.Vector Narrow(System.Numerics.Vector source1, System.Numerics.Vector source2) { throw null; } + public static System.Numerics.Vector Narrow(System.Numerics.Vector low, System.Numerics.Vector high) { throw null; } + public static System.Numerics.Vector Narrow(System.Numerics.Vector low, System.Numerics.Vector high) { throw null; } + public static System.Numerics.Vector Narrow(System.Numerics.Vector low, System.Numerics.Vector high) { throw null; } [System.CLSCompliantAttribute(false)] - public static System.Numerics.Vector Narrow(System.Numerics.Vector source1, System.Numerics.Vector source2) { throw null; } + public static System.Numerics.Vector Narrow(System.Numerics.Vector low, System.Numerics.Vector high) { throw null; } [System.CLSCompliantAttribute(false)] - public static System.Numerics.Vector Narrow(System.Numerics.Vector source1, System.Numerics.Vector source2) { throw null; } + public static System.Numerics.Vector Narrow(System.Numerics.Vector low, System.Numerics.Vector high) { throw null; } [System.CLSCompliantAttribute(false)] - public static System.Numerics.Vector Narrow(System.Numerics.Vector source1, System.Numerics.Vector source2) { throw null; } + public static System.Numerics.Vector Narrow(System.Numerics.Vector low, System.Numerics.Vector high) { throw null; } public static System.Numerics.Vector Negate(System.Numerics.Vector value) where T : struct { throw null; } public static System.Numerics.Vector OnesComplement(System.Numerics.Vector value) where T : struct { throw null; } public static System.Numerics.Vector SquareRoot(System.Numerics.Vector value) where T : struct { throw null; } public static System.Numerics.Vector Subtract(System.Numerics.Vector left, System.Numerics.Vector right) where T : struct { throw null; } [System.CLSCompliantAttribute(false)] - public static void Widen(System.Numerics.Vector source, out System.Numerics.Vector dest1, out System.Numerics.Vector dest2) { throw null; } - public static void Widen(System.Numerics.Vector source, out System.Numerics.Vector dest1, out System.Numerics.Vector dest2) { throw null; } - public static void Widen(System.Numerics.Vector source, out System.Numerics.Vector dest1, out System.Numerics.Vector dest2) { throw null; } + public static void Widen(System.Numerics.Vector source, out System.Numerics.Vector low, out System.Numerics.Vector high) { throw null; } + public static void Widen(System.Numerics.Vector source, out System.Numerics.Vector low, out System.Numerics.Vector high) { throw null; } + public static void Widen(System.Numerics.Vector source, out System.Numerics.Vector low, out System.Numerics.Vector high) { throw null; } [System.CLSCompliantAttribute(false)] - public static void Widen(System.Numerics.Vector source, out System.Numerics.Vector dest1, out System.Numerics.Vector dest2) { throw null; } - public static void Widen(System.Numerics.Vector source, out System.Numerics.Vector dest1, out System.Numerics.Vector dest2) { throw null; } + public static void Widen(System.Numerics.Vector source, out System.Numerics.Vector low, out System.Numerics.Vector high) { throw null; } + public static void Widen(System.Numerics.Vector source, out System.Numerics.Vector low, out System.Numerics.Vector high) { throw null; } [System.CLSCompliantAttribute(false)] - public static void Widen(System.Numerics.Vector source, out System.Numerics.Vector dest1, out System.Numerics.Vector dest2) { throw null; } + public static void Widen(System.Numerics.Vector source, out System.Numerics.Vector low, out System.Numerics.Vector high) { throw null; } [System.CLSCompliantAttribute(false)] - public static void Widen(System.Numerics.Vector source, out System.Numerics.Vector dest1, out System.Numerics.Vector dest2) { throw null; } + public static void Widen(System.Numerics.Vector source, out System.Numerics.Vector low, out System.Numerics.Vector high) { throw null; } public static System.Numerics.Vector Xor(System.Numerics.Vector left, System.Numerics.Vector right) where T : struct { throw null; } } public partial struct Vector2 : System.IEquatable, System.IFormattable diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/StreamWriter.cs b/src/libraries/System.Private.CoreLib/src/System/IO/StreamWriter.cs index ed71b29..7b1004b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/StreamWriter.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/StreamWriter.cs @@ -471,18 +471,18 @@ namespace System.IO } [MethodImpl(MethodImplOptions.NoInlining)] // prevent WriteSpan from bloating call sites - public override void WriteLine(ReadOnlySpan value) + public override void WriteLine(ReadOnlySpan buffer) { if (GetType() == typeof(StreamWriter)) { CheckAsyncTaskInProgress(); - WriteSpan(value, appendNewLine: true); + WriteSpan(buffer, appendNewLine: true); } else { // If a derived class may have overridden existing WriteLine behavior, // we need to make sure we use it. - base.WriteLine(value); + base.WriteLine(buffer); } } diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index 6b7c12d..6267fdb 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -497,8 +497,8 @@ namespace System public static System.Attribute[] GetCustomAttributes(System.Reflection.Assembly element, System.Type attributeType, bool inherit) { throw null; } public static System.Attribute[] GetCustomAttributes(System.Reflection.MemberInfo element) { throw null; } public static System.Attribute[] GetCustomAttributes(System.Reflection.MemberInfo element, bool inherit) { throw null; } - public static System.Attribute[] GetCustomAttributes(System.Reflection.MemberInfo element, System.Type type) { throw null; } - public static System.Attribute[] GetCustomAttributes(System.Reflection.MemberInfo element, System.Type type, bool inherit) { throw null; } + public static System.Attribute[] GetCustomAttributes(System.Reflection.MemberInfo element, System.Type attributeType) { throw null; } + public static System.Attribute[] GetCustomAttributes(System.Reflection.MemberInfo element, System.Type attributeType, bool inherit) { throw null; } public static System.Attribute[] GetCustomAttributes(System.Reflection.Module element) { throw null; } public static System.Attribute[] GetCustomAttributes(System.Reflection.Module element, bool inherit) { throw null; } public static System.Attribute[] GetCustomAttributes(System.Reflection.Module element, System.Type attributeType) { throw null; } @@ -7091,8 +7091,8 @@ namespace System.IO public virtual string Name { get { throw null; } } public override long Position { get { throw null; } set { } } public virtual Microsoft.Win32.SafeHandles.SafeFileHandle SafeFileHandle { get { throw null; } } - public override System.IAsyncResult BeginRead(byte[] buffer, int offset, int numBytes, System.AsyncCallback? callback, object? state) { throw null; } - public override System.IAsyncResult BeginWrite(byte[] buffer, int offset, int numBytes, System.AsyncCallback? callback, object? state) { throw null; } + public override System.IAsyncResult BeginRead(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; } + public override System.IAsyncResult BeginWrite(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; } public override System.Threading.Tasks.Task CopyToAsync(System.IO.Stream destination, int bufferSize, System.Threading.CancellationToken cancellationToken) { throw null; } protected override void Dispose(bool disposing) { } public override System.Threading.Tasks.ValueTask DisposeAsync() { throw null; } @@ -7162,18 +7162,18 @@ namespace System.IO public override System.Threading.Tasks.Task FlushAsync(System.Threading.CancellationToken cancellationToken) { throw null; } public virtual byte[] GetBuffer() { throw null; } public override int Read(byte[] buffer, int offset, int count) { throw null; } - public override int Read(System.Span destination) { throw null; } + public override int Read(System.Span buffer) { throw null; } public override System.Threading.Tasks.Task ReadAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; } - public override System.Threading.Tasks.ValueTask ReadAsync(System.Memory destination, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask ReadAsync(System.Memory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public override int ReadByte() { throw null; } public override long Seek(long offset, System.IO.SeekOrigin loc) { throw null; } public override void SetLength(long value) { } public virtual byte[] ToArray() { throw null; } public virtual bool TryGetBuffer(out System.ArraySegment buffer) { throw null; } public override void Write(byte[] buffer, int offset, int count) { } - public override void Write(System.ReadOnlySpan source) { } + public override void Write(System.ReadOnlySpan buffer) { } public override System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; } - public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory source, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public override void WriteByte(byte value) { } public virtual void WriteTo(System.IO.Stream stream) { } } @@ -7545,14 +7545,14 @@ namespace System.IO protected unsafe void Initialize(byte* pointer, long length, long capacity, System.IO.FileAccess access) { } protected void Initialize(System.Runtime.InteropServices.SafeBuffer buffer, long offset, long length, System.IO.FileAccess access) { } public override int Read(byte[] buffer, int offset, int count) { throw null; } - public override int Read(System.Span destination) { throw null; } + public override int Read(System.Span buffer) { throw null; } public override System.Threading.Tasks.Task ReadAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; } public override System.Threading.Tasks.ValueTask ReadAsync(System.Memory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public override int ReadByte() { throw null; } public override long Seek(long offset, System.IO.SeekOrigin loc) { throw null; } public override void SetLength(long value) { } public override void Write(byte[] buffer, int offset, int count) { } - public override void Write(System.ReadOnlySpan source) { } + public override void Write(System.ReadOnlySpan buffer) { } public override System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; } public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public override void WriteByte(byte value) { } diff --git a/src/libraries/System.Security.Cryptography.Pkcs/ref/System.Security.Cryptography.Pkcs.netcoreapp.cs b/src/libraries/System.Security.Cryptography.Pkcs/ref/System.Security.Cryptography.Pkcs.netcoreapp.cs index 925be44..6de5865 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/ref/System.Security.Cryptography.Pkcs.netcoreapp.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/ref/System.Security.Cryptography.Pkcs.netcoreapp.cs @@ -207,8 +207,8 @@ namespace System.Security.Cryptography.Pkcs { public System.Security.Cryptography.Oid SignatureAlgorithm { get { throw null; } } public byte[] GetSignature() { throw null; } - public void AddUnsignedAttribute(System.Security.Cryptography.AsnEncodedData asnEncodedData) { } - public void RemoveUnsignedAttribute(System.Security.Cryptography.AsnEncodedData asnEncodedData) { } + public void AddUnsignedAttribute(System.Security.Cryptography.AsnEncodedData unsignedAttribute) { } + public void RemoveUnsignedAttribute(System.Security.Cryptography.AsnEncodedData unsignedAttribute) { } } public sealed partial class SubjectIdentifier { diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampRequest.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampRequest.cs index 68f2265..0a66a52 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampRequest.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampRequest.cs @@ -58,9 +58,9 @@ namespace System.Security.Cryptography.Pkcs return coll; } - public Rfc3161TimestampToken ProcessResponse(ReadOnlyMemory source, out int bytesConsumed) + public Rfc3161TimestampToken ProcessResponse(ReadOnlyMemory responseBytes, out int bytesConsumed) { - if (ProcessResponse(source, out Rfc3161TimestampToken? token, out Rfc3161RequestResponseStatus status, out int localBytesRead, shouldThrow: true)) + if (ProcessResponse(responseBytes, out Rfc3161TimestampToken? token, out Rfc3161RequestResponseStatus status, out int localBytesRead, shouldThrow: true)) { Debug.Assert(status == Rfc3161RequestResponseStatus.Accepted); bytesConsumed = localBytesRead; diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampToken.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampToken.cs index dde7077..e1f461d 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampToken.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampToken.cs @@ -288,19 +288,19 @@ namespace System.Security.Cryptography.Pkcs } } - public static bool TryDecode(ReadOnlyMemory source, [NotNullWhen(true)] out Rfc3161TimestampToken? token, out int bytesConsumed) + public static bool TryDecode(ReadOnlyMemory encodedBytes, [NotNullWhen(true)] out Rfc3161TimestampToken? token, out int bytesConsumed) { bytesConsumed = 0; token = null; try { - AsnValueReader reader = new AsnValueReader(source.Span, AsnEncodingRules.BER); + AsnValueReader reader = new AsnValueReader(encodedBytes.Span, AsnEncodingRules.BER); int bytesActuallyRead = reader.PeekEncodedValue().Length; ContentInfoAsn.Decode( ref reader, - source, + encodedBytes, out ContentInfoAsn contentInfo); // https://tools.ietf.org/html/rfc3161#section-2.4.2 @@ -317,7 +317,7 @@ namespace System.Security.Cryptography.Pkcs } SignedCms cms = new SignedCms(); - cms.Decode(source.Span); + cms.Decode(encodedBytes.Span); // The fields of type EncapsulatedContentInfo of the SignedData // construct have the following meanings: diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampTokenInfo.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampTokenInfo.cs index b5f87e5..5f29d71 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampTokenInfo.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampTokenInfo.cs @@ -29,7 +29,7 @@ namespace System.Security.Cryptography.Pkcs long? accuracyInMicroseconds = null, bool isOrdering = false, ReadOnlyMemory? nonce = null, - ReadOnlyMemory? tsaName = null, + ReadOnlyMemory? timestampAuthorityName = null, X509ExtensionCollection? extensions = null) { _encodedBytes = Encode( @@ -41,7 +41,7 @@ namespace System.Security.Cryptography.Pkcs isOrdering, accuracyInMicroseconds, nonce, - tsaName, + timestampAuthorityName, extensions); if (!TryDecode(_encodedBytes, true, out _parsedData, out _, out _)) @@ -134,11 +134,11 @@ namespace System.Security.Cryptography.Pkcs } public static bool TryDecode( - ReadOnlyMemory source, + ReadOnlyMemory encodedBytes, [NotNullWhen(true)] out Rfc3161TimestampTokenInfo? timestampTokenInfo, out int bytesConsumed) { - if (TryDecode(source, false, out Rfc3161TstInfo tstInfo, out bytesConsumed, out byte[]? copiedBytes)) + if (TryDecode(encodedBytes, false, out Rfc3161TstInfo tstInfo, out bytesConsumed, out byte[]? copiedBytes)) { timestampTokenInfo = new Rfc3161TimestampTokenInfo(copiedBytes!, tstInfo); return true; diff --git a/src/libraries/System.Security.Permissions/ref/System.Security.Permissions.cs b/src/libraries/System.Security.Permissions/ref/System.Security.Permissions.cs index 0ef3beb..88e6cd4 100644 --- a/src/libraries/System.Security.Permissions/ref/System.Security.Permissions.cs +++ b/src/libraries/System.Security.Permissions/ref/System.Security.Permissions.cs @@ -1327,7 +1327,7 @@ namespace System.Security.Permissions public PrincipalPermission(string name, string role, bool isAuthenticated) { } public System.Security.IPermission Copy() { throw null; } public void Demand() { } - public override bool Equals(object o) { throw null; } + public override bool Equals(object obj) { throw null; } public void FromXml(System.Security.SecurityElement elem) { } public override int GetHashCode() { throw null; } public System.Security.IPermission Intersect(System.Security.IPermission target) { throw null; } @@ -2323,7 +2323,7 @@ namespace System.Security.Policy public string Url { get { throw null; } set { } } public bool Check(System.Security.Policy.Evidence evidence) { throw null; } public System.Security.Policy.IMembershipCondition Copy() { throw null; } - public override bool Equals(object o) { throw null; } + public override bool Equals(object obj) { throw null; } public void FromXml(System.Security.SecurityElement e) { } public void FromXml(System.Security.SecurityElement e, System.Security.Policy.PolicyLevel level) { } public override int GetHashCode() { throw null; } diff --git a/src/libraries/System.Security.Permissions/src/System/Data/Common/DBDataPermission.cs b/src/libraries/System.Security.Permissions/src/System/Data/Common/DBDataPermission.cs index d6d97f1..7b23c5e 100644 --- a/src/libraries/System.Security.Permissions/src/System/Data/Common/DBDataPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Data/Common/DBDataPermission.cs @@ -12,20 +12,20 @@ namespace System.Data.Common public abstract class DBDataPermission : CodeAccessPermission, IUnrestrictedPermission { protected DBDataPermission() { } - protected DBDataPermission(DBDataPermission dataPermission) { } - protected DBDataPermission(DBDataPermissionAttribute attribute) { } + protected DBDataPermission(DBDataPermission permission) { } + protected DBDataPermission(DBDataPermissionAttribute permissionAttribute) { } protected DBDataPermission(PermissionState state) { } - protected DBDataPermission(PermissionState state, bool blankPassword) { } + protected DBDataPermission(PermissionState state, bool allowBlankPassword) { } public bool AllowBlankPassword { get; set; } public virtual void Add(string connectionString, string restrictions, KeyRestrictionBehavior behavior) { } protected void Clear() { } protected virtual DBDataPermission CreateInstance() => null; public override IPermission Copy() => null; - public override void FromXml(SecurityElement elem) { } + public override void FromXml(SecurityElement securityElement) { } public override IPermission Intersect(IPermission target) => null; public override bool IsSubsetOf(IPermission target) => false; public bool IsUnrestricted() => false; public override SecurityElement ToXml() => null; - public override IPermission Union(IPermission other) { return default(IPermission); } + public override IPermission Union(IPermission target) { return default(IPermission); } } } -- 2.7.4