Skip to content

Commit

Permalink
Omit unnecessary error:false from Obsolete attributes. Fix message typo.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffhandley committed Aug 1, 2021
1 parent 0d1661c commit afea905
Show file tree
Hide file tree
Showing 23 changed files with 40 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public virtual void Dispose() { }
public virtual System.Threading.Tasks.Task StartAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
public virtual System.Threading.Tasks.Task StopAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
}
[System.ObsoleteAttribute("EnvironmentName has been deprecated. Use Microsoft.Extensions.Hosting.Environments instead.", false)]
[System.ObsoleteAttribute("EnvironmentName has been deprecated. Use Microsoft.Extensions.Hosting.Environments instead.")]
public static partial class EnvironmentName
{
public static readonly string Development;
Expand Down Expand Up @@ -77,7 +77,7 @@ public static partial class HostingEnvironmentExtensions
public static bool IsProduction(this Microsoft.Extensions.Hosting.IHostingEnvironment hostingEnvironment) { throw null; }
public static bool IsStaging(this Microsoft.Extensions.Hosting.IHostingEnvironment hostingEnvironment) { throw null; }
}
[System.ObsoleteAttribute("IApplicationLifetime has been deprecated. Use Microsoft.Extensions.Hosting.IHostApplicationLifetime instead.", false)]
[System.ObsoleteAttribute("IApplicationLifetime has been deprecated. Use Microsoft.Extensions.Hosting.IHostApplicationLifetime instead.")]
public partial interface IApplicationLifetime
{
System.Threading.CancellationToken ApplicationStarted { get; }
Expand Down Expand Up @@ -121,7 +121,7 @@ public partial interface IHostEnvironment
string ContentRootPath { get; set; }
string EnvironmentName { get; set; }
}
[System.ObsoleteAttribute("IHostingEnvironment has been deprecated. Use Microsoft.Extensions.Hosting.IHostEnvironment instead.", false)]
[System.ObsoleteAttribute("IHostingEnvironment has been deprecated. Use Microsoft.Extensions.Hosting.IHostEnvironment instead.")]
public partial interface IHostingEnvironment
{
string ApplicationName { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Microsoft.Extensions.Hosting
/// The recommended alternative is Microsoft.Extensions.Hosting.Environments.
/// </para>
/// </summary>
[System.Obsolete("EnvironmentName has been deprecated. Use Microsoft.Extensions.Hosting.Environments instead.", error: false)]
[System.Obsolete("EnvironmentName has been deprecated. Use Microsoft.Extensions.Hosting.Environments instead.")]
public static class EnvironmentName
{
public static readonly string Development = "Development";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Microsoft.Extensions.Hosting
/// The recommended alternative is Microsoft.Extensions.Hosting.IHostApplicationLifetime.
/// </para>
/// </summary>
[Obsolete("IApplicationLifetime has been deprecated. Use Microsoft.Extensions.Hosting.IHostApplicationLifetime instead.", error: false)]
[Obsolete("IApplicationLifetime has been deprecated. Use Microsoft.Extensions.Hosting.IHostApplicationLifetime instead.")]
public interface IApplicationLifetime
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Microsoft.Extensions.Hosting
/// The recommended alternative is Microsoft.Extensions.Hosting.IHostEnvironment.
/// </para>
/// </summary>
[Obsolete("IHostingEnvironment has been deprecated. Use Microsoft.Extensions.Hosting.IHostEnvironment instead.", error: false)]
[Obsolete("IHostingEnvironment has been deprecated. Use Microsoft.Extensions.Hosting.IHostEnvironment instead.")]
public interface IHostingEnvironment
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public ConsoleFormatterOptions() { }
public string TimestampFormat { get { throw null; } set { } }
public bool UseUtcTimestamp { get { throw null; } set { } }
}
[System.ObsoleteAttribute("ConsoleLoggerFormat has been deprecated.", false)]
[System.ObsoleteAttribute("ConsoleLoggerFormat has been deprecated.")]
public enum ConsoleLoggerFormat
{
Default = 0,
Expand All @@ -53,17 +53,17 @@ public enum ConsoleLoggerFormat
public partial class ConsoleLoggerOptions
{
public ConsoleLoggerOptions() { }
[System.ObsoleteAttribute("ConsoleLoggerOptions.DisableColors has been deprecated. Use SimpleConsoleFormatterOptions.ColorBehavior instead.", false)]
[System.ObsoleteAttribute("ConsoleLoggerOptions.DisableColors has been deprecated. Use SimpleConsoleFormatterOptions.ColorBehavior instead.")]
public bool DisableColors { get { throw null; } set { } }
[System.ObsoleteAttribute("ConsoleLoggerOptions.Format has been deprecated. Use ConsoleLoggerOptions.FormatterName instead.", false)]
[System.ObsoleteAttribute("ConsoleLoggerOptions.Format has been deprecated. Use ConsoleLoggerOptions.FormatterName instead.")]
public Microsoft.Extensions.Logging.Console.ConsoleLoggerFormat Format { get { throw null; } set { } }
public string FormatterName { get { throw null; } set { } }
[System.ObsoleteAttribute("ConsoleLoggerOptions.IncludeScopes has been deprecated. Use ConsoleFormatterOptions.IncludeScopes instead.", false)]
[System.ObsoleteAttribute("ConsoleLoggerOptions.IncludeScopes has been deprecated. Use ConsoleFormatterOptions.IncludeScopes instead.")]
public bool IncludeScopes { get { throw null; } set { } }
public Microsoft.Extensions.Logging.LogLevel LogToStandardErrorThreshold { get { throw null; } set { } }
[System.ObsoleteAttribute("ConsoleLoggerOptions.TimestampFormat has been deprecated. Use ConsoleFormatterOptions.TimestampFormat instead.", false)]
[System.ObsoleteAttribute("ConsoleLoggerOptions.TimestampFormat has been deprecated. Use ConsoleFormatterOptions.TimestampFormat instead.")]
public string TimestampFormat { get { throw null; } set { } }
[System.ObsoleteAttribute("ConsoleLoggerOptions.UseUtcTimestamp has been deprecated. Use ConsoleFormatterOptions.UseUtcTimestamp instead.", false)]
[System.ObsoleteAttribute("ConsoleLoggerOptions.UseUtcTimestamp has been deprecated. Use ConsoleFormatterOptions.UseUtcTimestamp instead.")]
public bool UseUtcTimestamp { get { throw null; } set { } }
}
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.Logging.Console
/// <summary>
/// Format of <see cref="ConsoleLogger" /> messages.
/// </summary>
[System.ObsoleteAttribute("ConsoleLoggerFormat has been deprecated.", false)]
[System.ObsoleteAttribute("ConsoleLoggerFormat has been deprecated.")]
public enum ConsoleLoggerFormat
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ public class ConsoleLoggerOptions
/// <summary>
/// Disables colors when <see langword="true" />.
/// </summary>
[System.ObsoleteAttribute("ConsoleLoggerOptions.DisableColors has been deprecated. Use SimpleConsoleFormatterOptions.ColorBehavior instead.", false)]
[System.ObsoleteAttribute("ConsoleLoggerOptions.DisableColors has been deprecated. Use SimpleConsoleFormatterOptions.ColorBehavior instead.")]
public bool DisableColors { get; set; }

#pragma warning disable CS0618
private ConsoleLoggerFormat _format = ConsoleLoggerFormat.Default;
/// <summary>
/// Gets or sets log message format. Defaults to <see cref="ConsoleLoggerFormat.Default" />.
/// </summary>
[System.ObsoleteAttribute("ConsoleLoggerOptions.Format has been deprecated. Use ConsoleLoggerOptions.FormatterName instead.", false)]
[System.ObsoleteAttribute("ConsoleLoggerOptions.Format has been deprecated. Use ConsoleLoggerOptions.FormatterName instead.")]
public ConsoleLoggerFormat Format
{
get => _format;
Expand All @@ -44,7 +44,7 @@ public ConsoleLoggerFormat Format
/// <summary>
/// Includes scopes when <see langword="true" />.
/// </summary>
[System.ObsoleteAttribute("ConsoleLoggerOptions.IncludeScopes has been deprecated. Use ConsoleFormatterOptions.IncludeScopes instead.", false)]
[System.ObsoleteAttribute("ConsoleLoggerOptions.IncludeScopes has been deprecated. Use ConsoleFormatterOptions.IncludeScopes instead.")]
public bool IncludeScopes { get; set; }

/// <summary>
Expand All @@ -55,13 +55,13 @@ public ConsoleLoggerFormat Format
/// <summary>
/// Gets or sets format string used to format timestamp in logging messages. Defaults to <c>null</c>.
/// </summary>
[System.ObsoleteAttribute("ConsoleLoggerOptions.TimestampFormat has been deprecated. Use ConsoleFormatterOptions.TimestampFormat instead.", false)]
[System.ObsoleteAttribute("ConsoleLoggerOptions.TimestampFormat has been deprecated. Use ConsoleFormatterOptions.TimestampFormat instead.")]
public string TimestampFormat { get; set; }

/// <summary>
/// Gets or sets indication whether or not UTC timezone should be used to for timestamps in logging messages. Defaults to <c>false</c>.
/// </summary>
[System.ObsoleteAttribute("ConsoleLoggerOptions.UseUtcTimestamp has been deprecated. Use ConsoleFormatterOptions.UseUtcTimestamp instead.", false)]
[System.ObsoleteAttribute("ConsoleLoggerOptions.UseUtcTimestamp has been deprecated. Use ConsoleFormatterOptions.UseUtcTimestamp instead.")]
public bool UseUtcTimestamp { get; set; }
}
}
4 changes: 2 additions & 2 deletions src/libraries/System.Data.Common/ref/System.Data.Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -658,10 +658,10 @@ public enum DataSetDateTime
Utc = 4,
}
[System.AttributeUsageAttribute(System.AttributeTargets.All)]
[System.ObsoleteAttribute("DataSysDescriptionAttribute has been deprecated and is not supported.", false)]
[System.ObsoleteAttribute("DataSysDescriptionAttribute has been deprecated and is not supported.")]
public partial class DataSysDescriptionAttribute : System.ComponentModel.DescriptionAttribute
{
[System.ObsoleteAttribute("DataSysDescriptionAttribute has been deprecated and is not supported.", false)]
[System.ObsoleteAttribute("DataSysDescriptionAttribute has been deprecated and is not supported.")]
public DataSysDescriptionAttribute(string description) { }
public override string Description { get { throw null; } }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ namespace System.Data
/// the member.
/// </summary>
[AttributeUsage(AttributeTargets.All)]
[Obsolete("DataSysDescriptionAttribute has been deprecated and is not supported.", false)]
[Obsolete("DataSysDescriptionAttribute has been deprecated and is not supported.")]
public class DataSysDescriptionAttribute : DescriptionAttribute
{
private bool _replaced;

/// <summary>
/// Constructs a new sys description.
/// </summary>
[Obsolete("DataSysDescriptionAttribute has been deprecated and is not supported.", false)]
[Obsolete("DataSysDescriptionAttribute has been deprecated and is not supported.")]
public DataSysDescriptionAttribute(string description) : base(description)
{
}
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/System.Data.Odbc/ref/System.Data.Odbc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ internal OdbcParameterCollection() { }
public System.Data.Odbc.OdbcParameter Add(string? parameterName, System.Data.Odbc.OdbcType odbcType, int size) { throw null; }
public System.Data.Odbc.OdbcParameter Add(string? parameterName, System.Data.Odbc.OdbcType odbcType, int size, string? sourceColumn) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("Add(String parameterName, Object value) has been deprecated. Use AddWithValue(String parameterName, Object value) instead.", false)]
[System.ObsoleteAttribute("Add(String parameterName, Object value) has been deprecated. Use AddWithValue(String parameterName, Object value) instead.")]
public System.Data.Odbc.OdbcParameter Add(string? parameterName, object? value) { throw null; }
public override void AddRange(System.Array values) { }
public void AddRange(System.Data.Odbc.OdbcParameter[] values) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public OdbcParameter Add(OdbcParameter value)
}

[EditorBrowsableAttribute(EditorBrowsableState.Never)]
[ObsoleteAttribute("Add(String parameterName, Object value) has been deprecated. Use AddWithValue(String parameterName, Object value) instead.", false)] // 79027
[ObsoleteAttribute("Add(String parameterName, Object value) has been deprecated. Use AddWithValue(String parameterName, Object value) instead.")] // 79027
public OdbcParameter Add(string? parameterName, object? value)
{
// MDAC 59206
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public OleDbParameter Add(OleDbParameter value)
}

[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Add(String parameterName, Object value) has been deprecated. Use AddWithValue(String parameterName, Object value) instead.", false)]
[Obsolete("Add(String parameterName, Object value) has been deprecated. Use AddWithValue(String parameterName, Object value) instead.")]
public OleDbParameter Add(string? parameterName, object? value)
{
return Add(new OleDbParameter(parameterName, value));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ public enum StandardEventKeywords : long
WdiDiagnostic = (long)1125899906842624,
Sqm = (long)2251799813685248,
AuditFailure = (long)4503599627370496,
[System.ObsoleteAttribute("StandardEventKeywords.CorrelationHint has an incorrect value and has been deprecated. Use CorrelationHint2 instead.", false)]
[System.ObsoleteAttribute("StandardEventKeywords.CorrelationHint has an incorrect value and has been deprecated. Use CorrelationHint2 instead.")]
CorrelationHint = (long)4503599627370496,
AuditSuccess = (long)9007199254740992,
CorrelationHint2 = (long)18014398509481984,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public enum StandardEventKeywords : long
/// <summary>
/// Incorrect CorrelationHint value mistakenly shipped in .NET 3.5. Don't use: duplicates AuditFailure.
/// </summary>
[Obsolete("StandardEventKeywords.CorrelationHint has an incorrect value. Use CorrelationHint2 instead.", false)]
[Obsolete("StandardEventKeywords.CorrelationHint has an incorrect value. Use CorrelationHint2 instead.")]
CorrelationHint = 0x10000000000000,
/// <summary>
/// Transfer events where the related Activity ID is a computed value and not a GUID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public static long MonitoringSurvivedProcessMemorySize

public long MonitoringTotalAllocatedMemorySize => GC.GetTotalAllocatedBytes(precise: false);

[Obsolete("AppDomain.GetCurrentThreadId has been deprecated because it does not provide a stable Id when managed threads are running on fibers (aka lightweight threads). To get a stable identifier for a managed thread, use the ManagedThreadId property on Thread instead.", false)]
[Obsolete("AppDomain.GetCurrentThreadId has been deprecated because it does not provide a stable Id when managed threads are running on fibers (aka lightweight threads). To get a stable identifier for a managed thread, use the ManagedThreadId property on Thread instead.")]
public static int GetCurrentThreadId() => Environment.CurrentManagedThreadId;

public bool ShadowCopyFiles => false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,13 +447,13 @@ public static void ResetAbort()
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ThreadAbort);
}

[Obsolete("Thread.Suspend has been deprecated. Use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources.", false)]
[Obsolete("Thread.Suspend has been deprecated. Use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources.")]
public void Suspend()
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ThreadSuspend);
}

[Obsolete("Thread.Resume has been deprecated. Use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources.", false)]
[Obsolete("Thread.Resume has been deprecated. Use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources.")]
public void Resume()
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ThreadSuspend);
Expand All @@ -473,7 +473,7 @@ public static void EndThreadAffinity() { }
public static object? GetData(LocalDataStoreSlot slot) => LocalDataStore.GetData(slot);
public static void SetData(LocalDataStoreSlot slot, object? data) => LocalDataStore.SetData(slot, data);

[Obsolete("The ApartmentState property has been deprecated. Use GetApartmentState, SetApartmentState or TrySetApartmentState.", false)]
[Obsolete("The ApartmentState property has been deprecated. Use GetApartmentState, SetApartmentState or TrySetApartmentState.")]
public ApartmentState ApartmentState
{
get => GetApartmentState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace System.Xml
{
// we must specify the error flag as false so that we can typeforward this type without hitting a compile error.
[Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", false)]
[Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public interface IApplicationResourceStreamResolver
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace System.Runtime.InteropServices
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Assembly, Inherited = false)]
[Obsolete("IDispatchImplAttribute has deprecated and is not supported.", error: false)]
[Obsolete("IDispatchImplAttribute has been deprecated and is not supported.")]
public sealed class IDispatchImplAttribute : Attribute
{
public IDispatchImplAttribute(short implType) : this((IDispatchImplType)implType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace System.Runtime.InteropServices
{
[Obsolete("IDispatchImplAttribute and IDispatchImplType have been deprecated and are no longer supported.", error: false)]
[Obsolete("IDispatchImplAttribute and IDispatchImplType have been deprecated and are no longer supported.")]
public enum IDispatchImplType
{
CompatibleImpl = 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace System.Runtime.InteropServices
{
[Obsolete("SetWin32ContextInIDispatchAttribute has been deprecated. Application Domains no longer respect Activation Context boundaries in IDispatch calls.", error: false)]
[Obsolete("SetWin32ContextInIDispatchAttribute has been deprecated. Application Domains no longer respect Activation Context boundaries in IDispatch calls.")]
[AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
public sealed class SetWin32ContextInIDispatchAttribute : Attribute
{
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/System.Runtime/ref/System.Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public void ClearShadowCopyPath() { }
public int ExecuteAssemblyByName(string assemblyName) { throw null; }
public int ExecuteAssemblyByName(string assemblyName, params string?[]? args) { throw null; }
public System.Reflection.Assembly[] GetAssemblies() { throw null; }
[System.ObsoleteAttribute("AppDomain.GetCurrentThreadId has been deprecated because it does not provide a stable Id when managed threads are running on fibers (aka lightweight threads). To get a stable identifier for a managed thread, use the ManagedThreadId property on Thread.", false)]
[System.ObsoleteAttribute("AppDomain.GetCurrentThreadId has been deprecated because it does not provide a stable Id when managed threads are running on fibers (aka lightweight threads). To get a stable identifier for a managed thread, use the ManagedThreadId property on Thread.")]
public static int GetCurrentThreadId() { throw null; }
public object? GetData(string name) { throw null; }
public bool? IsCompatibilitySwitchSet(string value) { throw null; }
Expand Down
Loading

0 comments on commit afea905

Please sign in to comment.