Remove ObsoletedInOSPlatformAttribute (#40945)
authorJeff Handley <jeffhandley@users.noreply.github.com>
Mon, 17 Aug 2020 21:53:18 +0000 (14:53 -0700)
committerGitHub <noreply@github.com>
Mon, 17 Aug 2020 21:53:18 +0000 (14:53 -0700)
src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/PlatformAttributes.cs
src/libraries/System.Runtime/ref/System.Runtime.cs
src/libraries/System.Runtime/tests/System/Runtime/Versioning/OSPlatformAttributeTests.cs

index 0f99e44..66564c1 100644 (file)
@@ -74,43 +74,6 @@ namespace System.Runtime.Versioning
     }
 
     /// <summary>
-    /// Marks APIs that were obsoleted in a given operating system version.
-    ///
-    /// Primarily used by OS bindings to indicate APIs that should only be used in
-    /// earlier versions.
-    /// </summary>
-    [AttributeUsage(AttributeTargets.Assembly |
-                    AttributeTargets.Class |
-                    AttributeTargets.Constructor |
-                    AttributeTargets.Enum |
-                    AttributeTargets.Event |
-                    AttributeTargets.Field |
-                    AttributeTargets.Method |
-                    AttributeTargets.Module |
-                    AttributeTargets.Property |
-                    AttributeTargets.Struct,
-                    AllowMultiple = true, Inherited = false)]
-#if SYSTEM_PRIVATE_CORELIB
-    public
-#else
-    internal
-#endif
-        sealed class ObsoletedInOSPlatformAttribute : OSPlatformAttribute
-    {
-        public ObsoletedInOSPlatformAttribute(string platformName) : base(platformName)
-        {
-        }
-
-        public ObsoletedInOSPlatformAttribute(string platformName, string message) : base(platformName)
-        {
-            Message = message;
-        }
-
-        public string? Message { get; }
-        public string? Url { get; set; }
-    }
-
-    /// <summary>
     /// Marks APIs that were removed in a given operating system version.
     /// </summary>
     /// <remarks>
index ef8bbb7..b347edf 100644 (file)
@@ -9998,14 +9998,6 @@ namespace System.Runtime.Versioning
     {
         public SupportedOSPlatformAttribute(string platformName) : base(platformName) { }
     }
-    [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple = true, Inherited = false)]
-    public sealed class ObsoletedInOSPlatformAttribute : System.Runtime.Versioning.OSPlatformAttribute
-    {
-        public ObsoletedInOSPlatformAttribute(string platformName) : base(platformName) { }
-        public ObsoletedInOSPlatformAttribute(string platformName, string message) : base(platformName) { }
-        public string? Message { get; }
-        public string? Url { get; set; }
-    }
     public abstract class OSPlatformAttribute : System.Attribute
     {
         private protected OSPlatformAttribute(string platformName) { }
index af507a5..4167455 100644 (file)
@@ -20,20 +20,6 @@ namespace System.Runtime.Versioning.Tests
         }
 
         [Theory]
-        [InlineData("Windows8.0", "Obsolete", "http://test.com/obsoletedInOSPlatform")]
-        [InlineData("Linux", "Message", null)]
-        [InlineData("iOS13", null, null)]
-        [InlineData("", null, "http://test.com/obsoletedInOSPlatform")]
-        public void TestObsoletedInOSPlatformAttribute(string platformName, string message, string url)
-        {
-            var opa = message == null ? new ObsoletedInOSPlatformAttribute(platformName) { Url = url} : new ObsoletedInOSPlatformAttribute(platformName, message) { Url = url };
-
-            Assert.Equal(platformName, opa.PlatformName);
-            Assert.Equal(message, opa.Message);
-            Assert.Equal(url, opa.Url);
-        }
-
-        [Theory]
         [InlineData("Windows8.0")]
         [InlineData("Android4.1")]
         [InlineData("")]