Fix StyleCop warning SA1206 (modifer ordering)
authorStephen Toub <stoub@microsoft.com>
Thu, 8 Aug 2019 18:35:33 +0000 (14:35 -0400)
committerStephen Toub <stoub@microsoft.com>
Fri, 9 Aug 2019 11:54:53 +0000 (07:54 -0400)
Commit migrated from https://github.com/dotnet/coreclr/commit/d5cd7526f9d1e5d7a3c98d3a745f8566f789af17

50 files changed:
src/coreclr/src/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs
src/coreclr/src/System.Private.CoreLib/src/Internal/Runtime/InteropServices/WindowsRuntime/ActivationFactoryLoader.cs
src/coreclr/src/System.Private.CoreLib/src/System/ApplicationModel.Windows.cs
src/coreclr/src/System.Private.CoreLib/src/System/DateTime.Windows.CoreCLR.cs
src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/XplatEventLogger.cs
src/coreclr/src/System.Private.CoreLib/src/System/Enum.CoreCLR.cs
src/coreclr/src/System.Private.CoreLib/src/System/Environment.CoreCLR.cs
src/coreclr/src/System.Private.CoreLib/src/System/Exception.CoreCLR.cs
src/coreclr/src/System.Private.CoreLib/src/System/MulticastDelegate.cs
src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/EnumBuilder.cs
src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ISymWrapperCore.cs
src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RtFieldInfo.cs
src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs
src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeEventInfo.cs
src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeParameterInfo.cs
src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimePropertyInfo.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Variant.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs
src/coreclr/src/System.Private.CoreLib/src/System/RuntimeHandles.cs
src/coreclr/src/System.Private.CoreLib/src/System/StubHelpers.cs
src/coreclr/src/System.Private.CoreLib/src/System/Threading/Overlapped.cs
src/coreclr/src/System.Private.CoreLib/src/System/Threading/WaitHandle.CoreCLR.cs
src/coreclr/src/System.Private.CoreLib/src/System/Type.CoreCLR.cs
src/coreclr/src/System.Private.CoreLib/src/System/Utf8String.Construction.cs
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeFileHandle.Windows.cs
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeFindHandle.Windows.cs
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.cs
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.cs
src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.cs
src/libraries/System.Private.CoreLib/src/System/IO/BinaryWriter.cs
src/libraries/System.Private.CoreLib/src/System/IO/TextReader.cs
src/libraries/System.Private.CoreLib/src/System/IO/UnmanagedMemoryStreamWrapper.cs
src/libraries/System.Private.CoreLib/src/System/IntPtr.cs
src/libraries/System.Private.CoreLib/src/System/Security/SafeBSTRHandle.cs
src/libraries/System.Private.CoreLib/src/System/Text/ASCIIEncoding.cs
src/libraries/System.Private.CoreLib/src/System/Text/DecoderBestFitFallback.cs
src/libraries/System.Private.CoreLib/src/System/Text/DecoderFallback.cs
src/libraries/System.Private.CoreLib/src/System/Text/DecoderNLS.cs
src/libraries/System.Private.CoreLib/src/System/Text/DecoderReplacementFallback.cs
src/libraries/System.Private.CoreLib/src/System/Text/EncoderFallback.cs
src/libraries/System.Private.CoreLib/src/System/Text/EncoderNLS.cs
src/libraries/System.Private.CoreLib/src/System/Text/Encoding.cs
src/libraries/System.Private.CoreLib/src/System/Text/EncodingNLS.cs
src/libraries/System.Private.CoreLib/src/System/Text/UTF32Encoding.cs
src/libraries/System.Private.CoreLib/src/System/Text/UTF7Encoding.cs
src/libraries/System.Private.CoreLib/src/System/Text/UTF8Encoding.cs
src/libraries/System.Private.CoreLib/src/System/Text/UnicodeEncoding.cs
src/libraries/System.Private.CoreLib/src/System/Type.cs
src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs

index 0a0590b..56b8251 100644 (file)
@@ -91,7 +91,7 @@ namespace Internal.Runtime.InteropServices
         public string TypeName;
 
         [CLSCompliant(false)]
-        public unsafe static ComActivationContext Create(ref ComActivationContextInternal cxtInt)
+        public static unsafe ComActivationContext Create(ref ComActivationContextInternal cxtInt)
         {
             return new ComActivationContext()
             {
@@ -223,7 +223,7 @@ namespace Internal.Runtime.InteropServices
         /// </summary>
         /// <param name="cxtInt">Reference to a <see cref="ComActivationContextInternal"/> instance</param>
         [CLSCompliant(false)]
-        public unsafe static int GetClassFactoryForTypeInternal(ref ComActivationContextInternal cxtInt)
+        public static unsafe int GetClassFactoryForTypeInternal(ref ComActivationContextInternal cxtInt)
         {
             if (IsLoggingEnabled())
             {
@@ -257,7 +257,7 @@ $@"{nameof(GetClassFactoryForTypeInternal)} arguments:
         /// </summary>
         /// <param name="cxtInt">Reference to a <see cref="ComActivationContextInternal"/> instance</param>
         [CLSCompliant(false)]
-        public unsafe static int RegisterClassForTypeInternal(ref ComActivationContextInternal cxtInt)
+        public static unsafe int RegisterClassForTypeInternal(ref ComActivationContextInternal cxtInt)
         {
             if (IsLoggingEnabled())
             {
@@ -294,7 +294,7 @@ $@"{nameof(RegisterClassForTypeInternal)} arguments:
         /// Internal entry point for unregistering a managed COM server API from native code
         /// </summary>
         [CLSCompliant(false)]
-        public unsafe static int UnregisterClassForTypeInternal(ref ComActivationContextInternal cxtInt)
+        public static unsafe int UnregisterClassForTypeInternal(ref ComActivationContextInternal cxtInt)
         {
             if (IsLoggingEnabled())
             {
index 5609a17..a6ddce7 100644 (file)
@@ -38,7 +38,7 @@ namespace Internal.Runtime.InteropServices.WindowsRuntime
         /// <param name="componentPath">The path to the WinRT component that the type is expected to be defined in.</param>
         /// <param name="typeName">The name of the component type to activate</param>
         /// <param name="activationFactory">The activation factory</param>
-        public unsafe static int GetActivationFactory(
+        public static unsafe int GetActivationFactory(
             char* componentPath,
             [MarshalAs(UnmanagedType.HString)] string typeName,
             [MarshalAs(UnmanagedType.Interface)] out IActivationFactory? activationFactory)
index 9c4a60d..ab0c353 100644 (file)
@@ -11,7 +11,7 @@ namespace System
     {
 #if FEATURE_APPX
         // Cache the value in readonly static that can be optimized out by the JIT
-        internal readonly static bool IsUap = IsAppXProcess() != Interop.BOOL.FALSE;
+        internal static readonly bool IsUap = IsAppXProcess() != Interop.BOOL.FALSE;
 
         [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
         private static extern Interop.BOOL IsAppXProcess();
index 26a440d..d53ed9e 100644 (file)
@@ -9,18 +9,18 @@ namespace System
     public readonly partial struct DateTime
     {
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
-        private static unsafe extern bool ValidateSystemTime(Interop.Kernel32.SYSTEMTIME* time, bool localTime);
+        private static extern unsafe bool ValidateSystemTime(Interop.Kernel32.SYSTEMTIME* time, bool localTime);
 
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
-        private static unsafe extern bool FileTimeToSystemTime(long fileTime, FullSystemTime* time);
+        private static extern unsafe bool FileTimeToSystemTime(long fileTime, FullSystemTime* time);
 
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
-        private static unsafe extern void GetSystemTimeWithLeapSecondsHandling(FullSystemTime* time);
+        private static extern unsafe void GetSystemTimeWithLeapSecondsHandling(FullSystemTime* time);
 
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
-        private static unsafe extern bool SystemTimeToFileTime(Interop.Kernel32.SYSTEMTIME* time, long* fileTime);
+        private static extern unsafe bool SystemTimeToFileTime(Interop.Kernel32.SYSTEMTIME* time, long* fileTime);
 
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
-        private static unsafe extern long GetSystemTimeAsFileTime();
+        private static extern unsafe long GetSystemTimeAsFileTime();
     }
 }
index b0a381e..8adae89 100644 (file)
@@ -157,7 +157,7 @@ namespace System.Diagnostics.Tracing
             }
         }
 
-        internal protected  override void OnEventSourceCreated(EventSource eventSource)
+        protected internal override void OnEventSourceCreated(EventSource eventSource)
         {
             // Don't enable forwarding of NativeRuntimeEventSource events.`
             if (eventSource.GetType() == typeof(NativeRuntimeEventSource))
@@ -172,7 +172,7 @@ namespace System.Diagnostics.Tracing
             }
         }
 
-        internal protected override void OnEventWritten(EventWrittenEventArgs eventData)
+        protected internal override void OnEventWritten(EventWrittenEventArgs eventData)
         {
             string? eventFilter = eventSourceEventFilter.Value;
             if (string.IsNullOrEmpty(eventFilter) || (eventData.EventName!.IndexOf(eventFilter, StringComparison.OrdinalIgnoreCase) >= 0))
index 71533b4..7630d4c 100644 (file)
@@ -15,7 +15,7 @@ namespace System
         private static extern void GetEnumValuesAndNames(QCallTypeHandle enumType, ObjectHandleOnStack values, ObjectHandleOnStack names, Interop.BOOL getNames);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
-        public override extern bool Equals(object? obj);
+        public extern override bool Equals(object? obj);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern object InternalBoxEnum(RuntimeType enumType, long value);
index f9572eb..69c4996 100644 (file)
@@ -122,7 +122,7 @@ namespace System
         private static class WinRT
         {
             // Cache the value in readonly static that can be optimized out by the JIT
-            public readonly static bool IsSupported = WinRTSupported() != Interop.BOOL.FALSE;
+            public static readonly bool IsSupported = WinRTSupported() != Interop.BOOL.FALSE;
         }
 
         // Does the current version of Windows have Windows Runtime suppport?
index 0daa63b..322ec61 100644 (file)
@@ -124,7 +124,7 @@ namespace System
 #endif // FEATURE_COMINTEROP
 
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
-        static private extern IRuntimeMethodInfo GetMethodFromStackTrace(object stackTrace);
+        private static extern IRuntimeMethodInfo GetMethodFromStackTrace(object stackTrace);
 
         private MethodBase? GetExceptionMethodFromStackTrace()
         {
index 9022a67..3abca1a 100644 (file)
@@ -55,7 +55,7 @@ namespace System
 
         // equals returns true IIF the delegate is not null and has the
         //    same target, method and invocation list as this object
-        public override sealed bool Equals(object? obj)
+        public sealed override bool Equals(object? obj)
         {
             if (obj == null)
                 return false;
@@ -221,7 +221,7 @@ namespace System
 
         // This method will combine this delegate with the passed delegate
         //    to form a new delegate.
-        protected override sealed Delegate CombineImpl(Delegate? follow)
+        protected sealed override Delegate CombineImpl(Delegate? follow)
         {
             if ((object?)follow == null) // cast to object for a more efficient test
                 return this;
@@ -339,7 +339,7 @@ namespace System
         //    look at the invocation list.)  If this is found we remove it from
         //    this list and return a new delegate.  If its not found a copy of the
         //    current list is returned.
-        protected override sealed Delegate? RemoveImpl(Delegate value)
+        protected sealed override Delegate? RemoveImpl(Delegate value)
         {
             // There is a special case were we are removing using a delegate as
             //    the value we need to check for this case
@@ -411,7 +411,7 @@ namespace System
         }
 
         // This method returns the Invocation list of this multicast delegate.
-        public override sealed Delegate[] GetInvocationList()
+        public sealed override Delegate[] GetInvocationList()
         {
             Delegate[] del;
             if (!(_invocationList is object[] invocationList))
@@ -463,7 +463,7 @@ namespace System
             return ReferenceEquals(d2, d1) ? false : !d2.Equals(d1);
         }
 
-        public override sealed int GetHashCode()
+        public sealed override int GetHashCode()
         {
             if (IsUnmanagedFunctionPtr())
                 return ValueType.GetHashCodeOfPtr(_methodPtr) ^ ValueType.GetHashCodeOfPtr(_methodPtrAux);
index e58e2b7..7d3e8b5 100644 (file)
@@ -17,7 +17,7 @@ using CultureInfo = System.Globalization.CultureInfo;
 
 namespace System.Reflection.Emit
 {
-    sealed public class EnumBuilder : TypeInfo
+    public sealed class EnumBuilder : TypeInfo
     {
         public override bool IsAssignableFrom(TypeInfo? typeInfo)
         {
index b64fd94..d8ba06f 100644 (file)
@@ -513,7 +513,7 @@ namespace System.Reflection.Emit
         {
         }
 
-        override protected bool ReleaseHandle()
+        protected override bool ReleaseHandle()
         {
             m_Release(handle);
             return true;
index ca75d25..2f45c78 100644 (file)
@@ -9,7 +9,7 @@ using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache;
 
 namespace System.Reflection
 {
-    internal unsafe sealed class RtFieldInfo : RuntimeFieldInfo, IRuntimeFieldInfo
+    internal sealed unsafe class RtFieldInfo : RuntimeFieldInfo, IRuntimeFieldInfo
     {
         #region Private Data Members
         // aggressive caching
index 15ceb0b..8630a7b 100644 (file)
@@ -248,7 +248,7 @@ namespace System.Reflection
             return GetManifestResourceStream(resourceName);
         }
 
-        public unsafe override Stream? GetManifestResourceStream(string name)
+        public override unsafe Stream? GetManifestResourceStream(string name)
         {
             uint length = 0;
             RuntimeAssembly runtimeAssembly = this;
index 2d5b937..e9d5dd7 100644 (file)
@@ -8,7 +8,7 @@ using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache;
 
 namespace System.Reflection
 {
-    internal unsafe sealed class RuntimeEventInfo : EventInfo
+    internal sealed unsafe class RuntimeEventInfo : EventInfo
     {
         #region Private Data Members
         private int m_token;
index 2fa4290..b03b0a6 100644 (file)
@@ -9,7 +9,7 @@ using MdToken = System.Reflection.MetadataToken;
 
 namespace System.Reflection
 {
-    internal unsafe sealed class RuntimeParameterInfo : ParameterInfo
+    internal sealed unsafe class RuntimeParameterInfo : ParameterInfo
     {
         #region Static Members
         internal static unsafe ParameterInfo[] GetParameters(IRuntimeMethodInfo method, MemberInfo member, Signature sig)
index 054381f..96e2fb3 100644 (file)
@@ -10,7 +10,7 @@ using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache;
 
 namespace System.Reflection
 {
-    internal unsafe sealed class RuntimePropertyInfo : PropertyInfo
+    internal sealed unsafe class RuntimePropertyInfo : PropertyInfo
     {
         #region Private Data Members
         private int m_token;
index fbcc0d4..a9b7281 100644 (file)
@@ -99,7 +99,7 @@ namespace System.Runtime.CompilerServices
         public static extern int GetHashCode(object o);
 
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
-        public new static extern bool Equals(object? o1, object? o2);
+        public static extern new bool Equals(object? o1, object? o2);
 
         public static int OffsetToStringData
         {
index 423f1b8..6081ab0 100644 (file)
@@ -115,7 +115,7 @@ namespace System.Runtime.InteropServices
             return false;
         }
 
-        unsafe public void CopyFromIndirect(object value)
+        public unsafe void CopyFromIndirect(object value)
         {
             VarEnum vt = (VarEnum)(((int)this.VariantType) & ~((int)VarEnum.VT_BYREF));
 
index ebf3c45..8d16076 100644 (file)
@@ -200,7 +200,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
             //     If the delegates aren't alive, it means either they have been unsubscribed, or the object itself is gone,
             //     and in either case, they've been already taken care of.
             //
-            internal volatile static
+            internal static volatile
                 ConditionalWeakTable<object, Dictionary<MethodInfo, Dictionary<object, EventRegistrationTokenList>>> s_eventRegistrations =
                     new ConditionalWeakTable<object, Dictionary<MethodInfo, Dictionary<object, EventRegistrationTokenList>>>();
 
@@ -513,11 +513,11 @@ namespace System.Runtime.InteropServices.WindowsRuntime
             //   b. The same delegate is subscribed then unsubscribed. We need to make sure give
             //   them the latest token in this case. This is guaranteed by always giving the last token and always use equality to
             //   add/remove event handlers
-            internal volatile static Dictionary<EventCacheKey, EventCacheEntry> s_eventRegistrations =
+            internal static volatile Dictionary<EventCacheKey, EventCacheEntry> s_eventRegistrations =
                 new Dictionary<EventCacheKey, EventCacheEntry>();
 
             // Prevent add/remove handler code to run at the same with with cache cleanup code
-            private volatile static MyReaderWriterLock s_eventCacheRWLock = new MyReaderWriterLock();
+            private static volatile MyReaderWriterLock s_eventCacheRWLock = new MyReaderWriterLock();
 
             // Get InstanceKey to use in the cache
             private static object GetInstanceKey(Action<EventRegistrationToken> removeMethod)
index 6386327..ae67ceb 100644 (file)
@@ -1409,10 +1409,10 @@ namespace System
         }
 
         [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
-        private unsafe static extern void GetPEKind(QCallModule handle, int *peKind, int *machine);
+        private static extern unsafe void GetPEKind(QCallModule handle, int *peKind, int *machine);
 
         // making this internal, used by Module.GetPEKind
-        internal unsafe static void GetPEKind(RuntimeModule module, out PortableExecutableKinds peKind, out ImageFileMachine machine)
+        internal static unsafe void GetPEKind(RuntimeModule module, out PortableExecutableKinds peKind, out ImageFileMachine machine)
         {
             int lKind, lMachine;
             GetPEKind(JitHelpers.GetQCallModuleOnStack(ref module), &lKind, &lMachine);
index f900261..382b32c 100644 (file)
@@ -21,7 +21,7 @@ namespace System.StubHelpers
     {
         // The length of the returned array is an approximation based on the length of the input string and the system
         // character set. It is only guaranteed to be larger or equal to cbLength, don't depend on the exact value.
-        unsafe internal static byte[] DoAnsiConversion(string str, bool fBestFit, bool fThrowOnUnmappableChar, out int cbLength)
+        internal static unsafe byte[] DoAnsiConversion(string str, bool fBestFit, bool fThrowOnUnmappableChar, out int cbLength)
         {
             byte[] buffer = new byte[checked((str.Length + 1) * Marshal.SystemMaxDBCSCharSize)];
             fixed (byte* bufferPtr = &buffer[0])
@@ -31,7 +31,7 @@ namespace System.StubHelpers
             return buffer;
         }
 
-        unsafe internal static byte ConvertToNative(char managedChar, bool fBestFit, bool fThrowOnUnmappableChar)
+        internal static unsafe byte ConvertToNative(char managedChar, bool fBestFit, bool fThrowOnUnmappableChar)
         {
             int cbAllocLength = (1 + 1) * Marshal.SystemMaxDBCSCharSize;
             byte* bufferPtr = stackalloc byte[cbAllocLength];
index 7260ac2..3eefadb 100644 (file)
@@ -85,7 +85,7 @@ namespace System.Threading
 
     #region class OverlappedData
 
-    sealed internal unsafe class OverlappedData
+    internal sealed unsafe class OverlappedData
     {
         // ! If you make any change to the layout here, you need to make matching change
         // ! to OverlappedDataObject in vm\nativeoverlapped.h
index 97b5c57..4837f65 100644 (file)
@@ -21,7 +21,7 @@ namespace System.Threading
         }
 
         [MethodImpl(MethodImplOptions.InternalCall)]
-        private static unsafe extern int WaitMultipleIgnoringSyncContext(IntPtr *waitHandles, int numHandles, bool waitAll, int millisecondsTimeout);
+        private static extern unsafe int WaitMultipleIgnoringSyncContext(IntPtr *waitHandles, int numHandles, bool waitAll, int millisecondsTimeout);
 
         private static int SignalAndWaitCore(IntPtr waitHandleToSignal, IntPtr waitHandleToWaitOn, int millisecondsTimeout)
         {
index 0ed5a4f..68a5a2c 100644 (file)
@@ -128,13 +128,13 @@ namespace System
 
 
         // Protected routine to determine if this class represents a Windows Runtime object
-        virtual internal bool IsWindowsRuntimeObjectImpl()
+        internal virtual bool IsWindowsRuntimeObjectImpl()
         {
             throw new NotImplementedException();
         }
 
         // Determines if this type is exported to WinRT (i.e. is an activatable class in a managed .winmd)
-        virtual internal bool IsExportedToWindowsRuntimeImpl()
+        internal virtual bool IsExportedToWindowsRuntimeImpl()
         {
             throw new NotImplementedException();
         }
index 2071690..4b678b6 100644 (file)
@@ -73,7 +73,7 @@ namespace System
         /// </remarks>
         [MethodImpl(MethodImplOptions.InternalCall)]
         [CLSCompliant(false)]
-        public unsafe extern Utf8String(byte* value);
+        public extern unsafe Utf8String(byte* value);
 
 #if !CORECLR
         static
@@ -139,7 +139,7 @@ namespace System
         /// </remarks>
         [MethodImpl(MethodImplOptions.InternalCall)]
         [CLSCompliant(false)]
-        public unsafe extern Utf8String(char* value);
+        public extern unsafe Utf8String(char* value);
 
 #if !CORECLR
         static
index a45c862..0bbae23 100644 (file)
@@ -41,7 +41,7 @@ namespace Microsoft.Win32.SafeHandles
 
         internal ThreadPoolBoundHandle? ThreadPoolBinding { get; set; }
 
-        override protected bool ReleaseHandle()
+        protected override bool ReleaseHandle()
         {
             return Interop.Kernel32.CloseHandle(handle);
         }
index 4ba0540..760ffaf 100644 (file)
@@ -14,7 +14,7 @@ namespace Microsoft.Win32.SafeHandles
     {
         internal SafeFindHandle() : base(true) { }
 
-        override protected bool ReleaseHandle()
+        protected override bool ReleaseHandle()
         {
             return Interop.Kernel32.FindClose(handle);
         }
index 03e1302..940a6ff 100644 (file)
@@ -902,7 +902,7 @@ namespace System.Globalization
             return IndexOf(source, value, startIndex, count, CompareOptions.None);
         }
 
-        public unsafe virtual int IndexOf(string source, char value, int startIndex, int count, CompareOptions options)
+        public virtual unsafe int IndexOf(string source, char value, int startIndex, int count, CompareOptions options)
         {
             if (source == null)
             {
@@ -932,7 +932,7 @@ namespace System.Globalization
             return IndexOf(source, char.ToString(value), startIndex, count, options, null);
         }
 
-        public unsafe virtual int IndexOf(string source, string value, int startIndex, int count, CompareOptions options)
+        public virtual unsafe int IndexOf(string source, string value, int startIndex, int count, CompareOptions options)
         {
             if (source == null)
             {
index 613f0c5..c42b7c5 100644 (file)
@@ -564,7 +564,7 @@ namespace System.Globalization
                 return s_Invariant;
             }
         }
-        private volatile static CultureData? s_Invariant;
+        private static volatile CultureData? s_Invariant;
 
         // Cache of cultures we've already looked up
         private static volatile StringCultureDataDictionary? s_cachedCultures;
index 702d96f..bf1cbfa 100644 (file)
@@ -52,7 +52,7 @@ namespace System.Globalization
             get => s_invariant ?? (s_invariant = new TextInfo(CultureData.Invariant));
         }
 
-        private volatile static TextInfo? s_invariant;
+        private static volatile TextInfo? s_invariant;
 
         internal TextInfo(CultureData cultureData)
         {
index 894959f..1f20a54 100644 (file)
@@ -193,7 +193,7 @@ namespace System.IO
         // advanced by two.
         // Note this method cannot handle surrogates properly in UTF-8.
         //
-        public unsafe virtual void Write(char ch)
+        public virtual unsafe void Write(char ch)
         {
             if (char.IsSurrogate(ch))
                 throw new ArgumentException(SR.Arg_SurrogatesNotAllowedAsSingleChar);
@@ -236,7 +236,7 @@ namespace System.IO
         // Writes a double to this stream. The current position of the stream is
         // advanced by eight.
         //
-        public unsafe virtual void Write(double value)
+        public virtual unsafe void Write(double value)
         {
             ulong TmpValue = *(ulong*)&value;
             _buffer[0] = (byte)TmpValue;
@@ -338,7 +338,7 @@ namespace System.IO
         // Writes a float to this stream. The current position of the stream is
         // advanced by four.
         //
-        public unsafe virtual void Write(float value)
+        public virtual unsafe void Write(float value)
         {
             uint TmpValue = *(uint*)&value;
             _buffer[0] = (byte)TmpValue;
@@ -354,7 +354,7 @@ namespace System.IO
         // a four-byte unsigned integer, and then writes that many characters
         // to the stream.
         //
-        public unsafe virtual void Write(string value)
+        public virtual unsafe void Write(string value)
         {
             if (value == null)
                 throw new ArgumentNullException(nameof(value));
index c43d30d..4b01f6e 100644 (file)
@@ -214,7 +214,7 @@ namespace System.IO
             this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
         }
 
-        public async virtual Task<string> ReadToEndAsync()
+        public virtual async Task<string> ReadToEndAsync()
         {
             var sb = new StringBuilder(4096);
             char[] chars = ArrayPool<char>.Shared.Rent(4096);
index ec2a795..72dcd15 100644 (file)
@@ -124,7 +124,7 @@ namespace System.IO
             return _unmanagedStream.Seek(offset, loc);
         }
 
-        public unsafe override byte[] ToArray()
+        public override unsafe byte[] ToArray()
         {
             byte[] buffer = new byte[_unmanagedStream.Length];
             _unmanagedStream.Read(buffer, 0, (int)_unmanagedStream.Length);
@@ -147,7 +147,7 @@ namespace System.IO
         }
 
         // Writes this MemoryStream to another stream.
-        public unsafe override void WriteTo(Stream stream)
+        public override unsafe void WriteTo(Stream stream)
         {
             if (stream == null)
                 throw new ArgumentNullException(nameof(stream), SR.ArgumentNull_Stream);
index 187be03..4a5ca1f 100644 (file)
@@ -73,7 +73,7 @@ namespace System
             info.AddValue("value", ToInt64());
         }
 
-        public unsafe override bool Equals(object? obj)
+        public override unsafe bool Equals(object? obj)
         {
             if (obj is IntPtr)
             {
@@ -87,7 +87,7 @@ namespace System
             return _value == other._value;
         }
 
-        public unsafe override int GetHashCode()
+        public override unsafe int GetHashCode()
         {
 #if BIT64
             long l = (long)_value;
@@ -223,7 +223,7 @@ namespace System
             return _value;
         }
 
-        public unsafe override string ToString()
+        public override unsafe string ToString()
         {
             return ((nint)_value).ToString(CultureInfo.InvariantCulture);
         }
index dd52f42..ceaf903 100644 (file)
@@ -24,7 +24,7 @@ namespace System.Security
             return bstr;
         }
 
-        override protected bool ReleaseHandle()
+        protected override bool ReleaseHandle()
         {
             RuntimeImports.RhZeroMemory(handle, (UIntPtr)Marshal.SysStringByteLen(handle));
             Interop.OleAut32.SysFreeString(handle);
index 91868e0..55d3adc 100644 (file)
@@ -586,7 +586,7 @@ namespace System.Text
         // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding
 
         [CLSCompliant(false)]
-        public unsafe override int GetChars(byte* bytes, int byteCount, char* chars, int charCount)
+        public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount)
         {
             // Validate Parameters
 
index 07d085c..d69d1c7 100644 (file)
@@ -158,7 +158,7 @@ namespace System.Text
         }
 
         // This version just counts the fallback and doesn't actually copy anything.
-        internal unsafe override int InternalFallback(byte[] bytes, byte* pBytes)
+        internal override unsafe int InternalFallback(byte[] bytes, byte* pBytes)
         // Right now this has both bytes and bytes[], since we might have extra bytes, hence the
         // array, and we might need the index, hence the byte*
         {
index 282baf7..d4397bc 100644 (file)
@@ -111,7 +111,7 @@ namespace System.Text
         // Right now this has both bytes and bytes[], since we might have extra bytes, hence the
         // array, and we might need the index, hence the byte*
         // Don't touch ref chars unless we succeed
-        internal unsafe virtual bool InternalFallback(byte[] bytes, byte* pBytes, ref char* chars)
+        internal virtual unsafe bool InternalFallback(byte[] bytes, byte* pBytes, ref char* chars)
         {
             Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize");
 
@@ -164,7 +164,7 @@ namespace System.Text
         }
 
         // This version just counts the fallback and doesn't actually copy anything.
-        internal unsafe virtual int InternalFallback(byte[] bytes, byte* pBytes)
+        internal virtual unsafe int InternalFallback(byte[] bytes, byte* pBytes)
         // Right now this has both bytes and bytes[], since we might have extra bytes, hence the
         // array, and we might need the index, hence the byte*
         {
index 184d59d..7ccaead 100644 (file)
@@ -67,7 +67,7 @@ namespace System.Text
                 return GetCharCount(pBytes + index, count, flush);
         }
 
-        public unsafe override int GetCharCount(byte* bytes, int count, bool flush)
+        public override unsafe int GetCharCount(byte* bytes, int count, bool flush)
         {
             // Validate parameters
             if (bytes == null)
@@ -123,7 +123,7 @@ namespace System.Text
                                 pChars + charIndex, charCount, flush);
         }
 
-        public unsafe override int GetChars(byte* bytes, int byteCount,
+        public override unsafe int GetChars(byte* bytes, int byteCount,
                                               char* chars, int charCount, bool flush)
         {
             // Validate parameters
@@ -184,7 +184,7 @@ namespace System.Text
 
         // This is the version that used pointers.  We call the base encoding worker function
         // after setting our appropriate internal variables.  This is getting chars
-        public unsafe override void Convert(byte* bytes, int byteCount,
+        public override unsafe void Convert(byte* bytes, int byteCount,
                                               char* chars, int charCount, bool flush,
                                               out int bytesUsed, out int charsUsed, out bool completed)
         {
index 8b4f1f2..a609b31 100644 (file)
@@ -191,7 +191,7 @@ namespace System.Text
         }
 
         // This version just counts the fallback and doesn't actually copy anything.
-        internal unsafe override int InternalFallback(byte[] bytes, byte* pBytes)
+        internal override unsafe int InternalFallback(byte[] bytes, byte* pBytes)
         // Right now this has both bytes and bytes[], since we might have extra bytes, hence the
         // array, and we might need the index, hence the byte*
         {
index fd32a19..13d1ab5 100644 (file)
@@ -318,7 +318,7 @@ namespace System.Text
         // Note that this could also change the contents of this.encoder, which is the same
         // object that the caller is using, so the caller could mess up the encoder for us
         // if they aren't careful.
-        internal unsafe virtual bool InternalFallback(char ch, ref char* chars)
+        internal virtual unsafe bool InternalFallback(char ch, ref char* chars)
         {
             // Shouldn't have null charStart
             Debug.Assert(charStart != null,
index e71ad05..12d020c 100644 (file)
@@ -67,7 +67,7 @@ namespace System.Text
             return result;
         }
 
-        public unsafe override int GetByteCount(char* chars, int count, bool flush)
+        public override unsafe int GetByteCount(char* chars, int count, bool flush)
         {
             // Validate input parameters
             if (chars == null)
@@ -115,7 +115,7 @@ namespace System.Text
                                 pBytes + byteIndex, byteCount, flush);
         }
 
-        public unsafe override int GetBytes(char* chars, int charCount, byte* bytes, int byteCount, bool flush)
+        public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount, bool flush)
         {
             // Validate parameters
             if (chars == null || bytes == null)
index 256602e..e19aa71 100644 (file)
@@ -1266,7 +1266,7 @@ namespace System.Text
                 return _encoding.GetByteCount(chars, index, count);
             }
 
-            public unsafe override int GetByteCount(char* chars, int count, bool flush)
+            public override unsafe int GetByteCount(char* chars, int count, bool flush)
             {
                 return _encoding.GetByteCount(chars, count);
             }
@@ -1297,7 +1297,7 @@ namespace System.Text
                 return _encoding.GetBytes(chars, charIndex, charCount, bytes, byteIndex);
             }
 
-            public unsafe override int GetBytes(char* chars, int charCount,
+            public override unsafe int GetBytes(char* chars, int charCount,
                                                  byte* bytes, int byteCount, bool flush)
             {
                 return _encoding.GetBytes(chars, charCount, bytes, byteCount);
@@ -1335,7 +1335,7 @@ namespace System.Text
                 return _encoding.GetCharCount(bytes, index, count);
             }
 
-            public unsafe override int GetCharCount(byte* bytes, int count, bool flush)
+            public override unsafe int GetCharCount(byte* bytes, int count, bool flush)
             {
                 // By default just call the encoding version, no flush by default
                 return _encoding.GetCharCount(bytes, count);
@@ -1370,7 +1370,7 @@ namespace System.Text
                 return _encoding.GetChars(bytes, byteIndex, byteCount, chars, charIndex);
             }
 
-            public unsafe override int GetChars(byte* bytes, int byteCount,
+            public override unsafe int GetChars(byte* bytes, int byteCount,
                                                   char* chars, int charCount, bool flush)
             {
                 // By default just call the encoding's version
index 62578e3..9bcd0ba 100644 (file)
@@ -248,7 +248,7 @@ namespace System.Text
         // All of our public Encodings that don't use EncodingNLS must have this (including EncodingNLS)
         // So if you fix this, fix the others.  Currently those include:
         // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding
-        public unsafe override int GetChars(byte* bytes, int byteCount, char* chars, int charCount)
+        public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount)
         {
             // Validate Parameters
             if (bytes == null || chars == null)
index 169957d..e1d2115 100644 (file)
@@ -319,7 +319,7 @@ namespace System.Text
         // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding
 
         [CLSCompliant(false)]
-        public unsafe override int GetChars(byte* bytes, int byteCount, char* chars, int charCount)
+        public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount)
         {
             // Validate Parameters
             if (bytes == null || chars == null)
index 1524b6f..823a13c 100644 (file)
@@ -351,7 +351,7 @@ namespace System.Text
         // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding
 
         [CLSCompliant(false)]
-        public unsafe override int GetChars(byte* bytes, int byteCount, char* chars, int charCount)
+        public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount)
         {
             // Validate Parameters
             if (bytes == null || chars == null)
@@ -957,7 +957,7 @@ namespace System.Text
             }
 
             // This version just counts the fallback and doesn't actually copy anything.
-            internal unsafe override int InternalFallback(byte[] bytes, byte* pBytes)
+            internal override unsafe int InternalFallback(byte[] bytes, byte* pBytes)
             // Right now this has both bytes and bytes[], since we might have extra bytes, hence the
             // array, and we might need the index, hence the byte*
             {
index eccf905..61f0507 100644 (file)
@@ -532,7 +532,7 @@ namespace System.Text
         // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding
 
         [CLSCompliant(false)]
-        public unsafe override int GetChars(byte* bytes, int byteCount, char* chars, int charCount)
+        public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount)
         {
             // Validate Parameters
 
index dfb55ad..3cd7292 100644 (file)
@@ -310,7 +310,7 @@ namespace System.Text
         // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding
 
         [CLSCompliant(false)]
-        public unsafe override int GetChars(byte* bytes, int byteCount, char* chars, int charCount)
+        public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount)
         {
             // Validate Parameters
             if (bytes == null || chars == null)
index f78c762..3f48068 100644 (file)
@@ -23,7 +23,7 @@ namespace System
         public abstract string? FullName { get; }
 
         public abstract Assembly Assembly { get; }
-        public abstract new Module Module { get; }
+        public new abstract Module Module { get; }
 
         public bool IsNested => DeclaringType != null;
         public override Type? DeclaringType => null;
index 8818733..01c4e17 100644 (file)
@@ -69,7 +69,7 @@ namespace System
             info.AddValue("value", ToUInt64());
         }
 
-        public unsafe override bool Equals(object? obj)
+        public override unsafe bool Equals(object? obj)
         {
             if (obj is UIntPtr)
             {
@@ -83,7 +83,7 @@ namespace System
             return _value == other._value;
         }
 
-        public unsafe override int GetHashCode()
+        public override unsafe int GetHashCode()
         {
 #if BIT64
             ulong l = (ulong)_value;
@@ -214,7 +214,7 @@ namespace System
             return _value;
         }
 
-        public unsafe override string ToString()
+        public override unsafe string ToString()
         {
             return ((nuint)_value).ToString(CultureInfo.InvariantCulture);
         }