Contribute to IDE0044 (make field readonly)
authorStephen Toub <stoub@microsoft.com>
Fri, 9 Aug 2019 15:32:32 +0000 (11:32 -0400)
committerStephen Toub <stoub@microsoft.com>
Tue, 13 Aug 2019 15:49:18 +0000 (11:49 -0400)
commit964098aae3249329dd0daede6a6fd237931f9548
tree6ab10cbfcae597ff6acb1849848e44dd712ebfdd
parent108041ba0293503cea742003d7c2440e2e43f4b5
Contribute to IDE0044 (make field readonly)

I used the auto-fix and then undid changes in areas where the fields were potentially mutated in native, e.g. I undid many of the changes in reflection.  We can revisit those individually later.

Commit migrated from https://github.com/dotnet/coreclr/commit/cead92222cb951eab80ed2bc3c2fc55cccd226e0
111 files changed:
src/coreclr/src/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs
src/coreclr/src/System.Private.CoreLib/src/System/Collections/ObjectModel/ReadOnlyDictionary.cs
src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipe.cs
src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventDispatcher.cs
src/coreclr/src/System.Private.CoreLib/src/System/Exception.CoreCLR.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/CompilerServices/TypeDependencyAttribute.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsInfo.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsMethod.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorViewOfEnumVariant.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/Attributes.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIPropertyValueImpl.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIReferenceImpl.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/CustomPropertyImpl.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/EnumeratorToIteratorAdapter.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/EventRegistrationTokenTable.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/ICustomPropertyProvider.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/IteratorToEnumeratorAdapter.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/ManagedActivationFactory.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs
src/coreclr/src/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
src/coreclr/src/System.Private.CoreLib/src/System/Threading/Overlapped.cs
src/coreclr/src/System.Private.CoreLib/src/System/Threading/Tasks/AsyncCausalityTracer.cs
src/coreclr/src/System.Private.CoreLib/src/System/TypeNameParser.cs
src/libraries/System.Private.CoreLib/src/Internal/Win32/RegistryKey.cs
src/libraries/System.Private.CoreLib/src/System/AggregateException.cs
src/libraries/System.Private.CoreLib/src/System/ArgumentException.cs
src/libraries/System.Private.CoreLib/src/System/ArgumentOutOfRangeException.cs
src/libraries/System.Private.CoreLib/src/System/Array.Enumerators.cs
src/libraries/System.Private.CoreLib/src/System/AttributeUsageAttribute.cs
src/libraries/System.Private.CoreLib/src/System/BadImageFormatException.cs
src/libraries/System.Private.CoreLib/src/System/CLSCompliantAttribute.cs
src/libraries/System.Private.CoreLib/src/System/Collections/ArrayList.cs
src/libraries/System.Private.CoreLib/src/System/Collections/Comparer.cs
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs
src/libraries/System.Private.CoreLib/src/System/Collections/Hashtable.cs
src/libraries/System.Private.CoreLib/src/System/Collections/ListDictionaryInternal.cs
src/libraries/System.Private.CoreLib/src/System/Collections/ObjectModel/Collection.cs
src/libraries/System.Private.CoreLib/src/System/Collections/ObjectModel/ReadOnlyCollection.cs
src/libraries/System.Private.CoreLib/src/System/CurrentSystemTimeZone.cs
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Contracts/ContractFailedEventArgs.cs
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Contracts/Contracts.cs
src/libraries/System.Private.CoreLib/src/System/Diagnostics/StackFrame.cs
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/ActivityTracker.cs
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventDescriptor.cs
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/IncrementingPollingCounter.cs
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/PollingCounter.cs
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/StubEnvironment.cs
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/EventPayload.cs
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/SimpleTypeInfos.cs
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureNotFoundException.cs
src/libraries/System.Private.CoreLib/src/System/Globalization/DateTimeFormatInfo.cs
src/libraries/System.Private.CoreLib/src/System/Globalization/DateTimeParse.cs
src/libraries/System.Private.CoreLib/src/System/Globalization/HebrewNumber.cs
src/libraries/System.Private.CoreLib/src/System/Globalization/IdnMapping.cs
src/libraries/System.Private.CoreLib/src/System/Globalization/SortVersion.cs
src/libraries/System.Private.CoreLib/src/System/Globalization/TaiwanCalendar.cs
src/libraries/System.Private.CoreLib/src/System/Globalization/TimeSpanParse.cs
src/libraries/System.Private.CoreLib/src/System/IO/BinaryReader.cs
src/libraries/System.Private.CoreLib/src/System/IO/BinaryWriter.cs
src/libraries/System.Private.CoreLib/src/System/IO/MemoryStream.cs
src/libraries/System.Private.CoreLib/src/System/IO/PinnedBufferMemoryStream.cs
src/libraries/System.Private.CoreLib/src/System/IO/Stream.cs
src/libraries/System.Private.CoreLib/src/System/IO/StreamReader.cs
src/libraries/System.Private.CoreLib/src/System/IO/TextWriter.cs
src/libraries/System.Private.CoreLib/src/System/IO/UnmanagedMemoryStreamWrapper.cs
src/libraries/System.Private.CoreLib/src/System/Math.cs
src/libraries/System.Private.CoreLib/src/System/MathF.cs
src/libraries/System.Private.CoreLib/src/System/NotFiniteNumberException.cs
src/libraries/System.Private.CoreLib/src/System/Number.NumberToFloatingPointBits.cs
src/libraries/System.Private.CoreLib/src/System/ObjectDisposedException.cs
src/libraries/System.Private.CoreLib/src/System/ObsoleteAttribute.cs
src/libraries/System.Private.CoreLib/src/System/Random.cs
src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyFlagsAttribute.cs
src/libraries/System.Private.CoreLib/src/System/Resources/FileBasedResourceGroveler.cs
src/libraries/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs
src/libraries/System.Private.CoreLib/src/System/Resources/MissingSatelliteAssemblyException.cs
src/libraries/System.Private.CoreLib/src/System/Resources/ResourceFallbackManager.cs
src/libraries/System.Private.CoreLib/src/System/Resources/ResourceManager.cs
src/libraries/System.Private.CoreLib/src/System/Resources/ResourceReader.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/DateTimeConstantAttribute.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/DecimalConstantAttribute.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ArrayWithOffset.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/MemoryFailPoint.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/Remoting/ObjectHandle.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/Serialization/SerializationInfo.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/TargetFrameworkAttribute.cs
src/libraries/System.Private.CoreLib/src/System/StringComparer.cs
src/libraries/System.Private.CoreLib/src/System/Text/DecoderBestFitFallback.cs
src/libraries/System.Private.CoreLib/src/System/Text/DecoderExceptionFallback.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/EncoderBestFitFallback.cs
src/libraries/System.Private.CoreLib/src/System/Text/EncoderExceptionFallback.cs
src/libraries/System.Private.CoreLib/src/System/Text/EncoderNLS.cs
src/libraries/System.Private.CoreLib/src/System/Text/EncoderReplacementFallback.cs
src/libraries/System.Private.CoreLib/src/System/Text/Encoding.cs
src/libraries/System.Private.CoreLib/src/System/Text/EncodingProvider.cs
src/libraries/System.Private.CoreLib/src/System/Text/UTF7Encoding.cs
src/libraries/System.Private.CoreLib/src/System/Threading/ReaderWriterLockSlim.cs
src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Future.cs
src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/FutureFactory.cs
src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs
src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskScheduler.cs
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadLocal.cs
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.cs
src/libraries/System.Private.CoreLib/src/System/Threading/Timer.cs
src/libraries/System.Private.CoreLib/src/System/TypeInitializationException.cs
src/libraries/System.Private.CoreLib/src/System/UnhandledExceptionEventArgs.cs