diff --git a/CHANGELOG.md b/CHANGELOG.md index f5f6f660cf..e005ae52bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ API Changes: }); ``` - `ISpan` and `ITransaction` have been renamed to `ISpanTracer` and `ITransactionTracer`. You will need to update any references to these interfaces in your code to use the new interface names ([#2731](https://github.com/getsentry/sentry-dotnet/pull/2731)) +- Removed obsolete setter from `Sentry.PlatformAbstractions.Runtime.Identifier` ([2764](https://github.com/getsentry/sentry-dotnet/pull/2764)) - The TracePropagationTarget class has been removed. Use the SubstringOrRegexPattern class instead. ([#2763](https://github.com/getsentry/sentry-dotnet/pull/2763)) ## Unreleased diff --git a/src/Sentry/PlatformAbstractions/Runtime.cs b/src/Sentry/PlatformAbstractions/Runtime.cs index ca3c71b993..755dd9dea1 100644 --- a/src/Sentry/PlatformAbstractions/Runtime.cs +++ b/src/Sentry/PlatformAbstractions/Runtime.cs @@ -54,18 +54,7 @@ public class Runtime : IEquatable /// /// This property will be populated for .NET 5 and newer, or null otherwise. /// - public string? Identifier - { - get => _identifier; - - [Obsolete("This setter is nonfunctional, and will be removed in a future version.")] - // ReSharper disable ValueParameterNotUsed - set { } - // ReSharper restore ValueParameterNotUsed - } - - // TODO: Convert to get-only auto-property in next major version - private readonly string? _identifier; + public string? Identifier { get; } /// /// Creates a new Runtime instance @@ -81,7 +70,7 @@ public class Runtime : IEquatable Version = version; FrameworkInstallation = frameworkInstallation; Raw = raw; - _identifier = null; + Identifier = null; } #else public Runtime( @@ -93,7 +82,7 @@ public class Runtime : IEquatable Name = name; Version = version; Raw = raw; - _identifier = identifier; + Identifier = identifier; } #endif @@ -183,7 +172,7 @@ public override int GetHashCode() #if NETFRAMEWORK hashCode = (hashCode * 397) ^ (FrameworkInstallation?.GetHashCode() ?? 0); #else - hashCode = (hashCode * 397) ^ (_identifier?.GetHashCode() ?? 0); + hashCode = (hashCode * 397) ^ (Identifier?.GetHashCode() ?? 0); #endif return hashCode; } diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt index 749a1d2216..43693bd8b3 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt @@ -1462,8 +1462,7 @@ namespace Sentry.PlatformAbstractions public class Runtime : System.IEquatable { public Runtime(string? name = null, string? version = null, string? raw = null, string? identifier = null) { } - [set: System.Obsolete("This setter is nonfunctional, and will be removed in a future version.")] - public string? Identifier { get; set; } + public string? Identifier { get; } public string? Name { get; } public string? Raw { get; } public string? Version { get; } diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt index 1b2bdf0d2a..3aec950d8d 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt @@ -1463,8 +1463,7 @@ namespace Sentry.PlatformAbstractions public class Runtime : System.IEquatable { public Runtime(string? name = null, string? version = null, string? raw = null, string? identifier = null) { } - [set: System.Obsolete("This setter is nonfunctional, and will be removed in a future version.")] - public string? Identifier { get; set; } + public string? Identifier { get; } public string? Name { get; } public string? Raw { get; } public string? Version { get; } diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt index 1b2bdf0d2a..3aec950d8d 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt @@ -1463,8 +1463,7 @@ namespace Sentry.PlatformAbstractions public class Runtime : System.IEquatable { public Runtime(string? name = null, string? version = null, string? raw = null, string? identifier = null) { } - [set: System.Obsolete("This setter is nonfunctional, and will be removed in a future version.")] - public string? Identifier { get; set; } + public string? Identifier { get; } public string? Name { get; } public string? Raw { get; } public string? Version { get; } diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt index b6c678a626..e4b5d97094 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt @@ -1462,8 +1462,7 @@ namespace Sentry.PlatformAbstractions { public Runtime(string? name = null, string? version = null, Sentry.PlatformAbstractions.FrameworkInstallation? frameworkInstallation = null, string? raw = null) { } public Sentry.PlatformAbstractions.FrameworkInstallation? FrameworkInstallation { get; } - [set: System.Obsolete("This setter is nonfunctional, and will be removed in a future version.")] - public string? Identifier { get; set; } + public string? Identifier { get; } public string? Name { get; } public string? Raw { get; } public string? Version { get; }