diff --git a/src/libraries/System.Diagnostics.TraceSource/ref/System.Diagnostics.TraceSource.cs b/src/libraries/System.Diagnostics.TraceSource/ref/System.Diagnostics.TraceSource.cs index 62e82e3e09c3b1..e57585e4d8fd7f 100644 --- a/src/libraries/System.Diagnostics.TraceSource/ref/System.Diagnostics.TraceSource.cs +++ b/src/libraries/System.Diagnostics.TraceSource/ref/System.Diagnostics.TraceSource.cs @@ -69,7 +69,7 @@ protected override void OnValueChanged() { } public abstract partial class Switch { protected Switch(string displayName, string? description) { } - protected Switch(string displayName, string? description, string? defaultSwitchValue) { } + protected Switch(string displayName, string? description, string defaultSwitchValue) { } public System.Collections.Specialized.StringDictionary Attributes { get { throw null; } } public string Description { get { throw null; } } public string DisplayName { get { throw null; } } diff --git a/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/Switch.cs b/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/Switch.cs index 23b40732ea4b5a..583d4cc1c8a050 100644 --- a/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/Switch.cs +++ b/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/Switch.cs @@ -24,7 +24,7 @@ public abstract class Switch private volatile bool _initialized; private bool _initializing; private volatile string _switchValueString = string.Empty; - private readonly string? _defaultValue; + private readonly string _defaultValue; private object? _initializedLock; private static readonly List> s_switches = new List>(); @@ -53,7 +53,7 @@ protected Switch(string displayName, string? description) : this(displayName, de { } - protected Switch(string displayName, string? description, string? defaultSwitchValue) + protected Switch(string displayName, string? description, string defaultSwitchValue) { // displayName is used as a hashtable key, so it can never // be null. @@ -203,7 +203,7 @@ private bool InitializeWithStatus() // called again, we don't want to get caught in an infinite loop. _initializing = true; - _switchValueString = _defaultValue!; + _switchValueString = _defaultValue; OnValueChanged(); _initialized = true; _initializing = false;