Skip to content

Commit

Permalink
Merge branch 'feat/4.0.0' into remove-tracepropagationtarget
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescrosswell committed Oct 29, 2023
2 parents 91b20bd + 99105fe commit f2524bd
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 23 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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
Expand Down
19 changes: 4 additions & 15 deletions src/Sentry/PlatformAbstractions/Runtime.cs
Expand Up @@ -54,18 +54,7 @@ public class Runtime : IEquatable<Runtime>
/// <remarks>
/// This property will be populated for .NET 5 and newer, or <c>null</c> otherwise.
/// </remarks>
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; }

/// <summary>
/// Creates a new Runtime instance
Expand All @@ -81,7 +70,7 @@ public class Runtime : IEquatable<Runtime>
Version = version;
FrameworkInstallation = frameworkInstallation;
Raw = raw;
_identifier = null;
Identifier = null;
}
#else
public Runtime(
Expand All @@ -93,7 +82,7 @@ public class Runtime : IEquatable<Runtime>
Name = name;
Version = version;
Raw = raw;
_identifier = identifier;
Identifier = identifier;
}
#endif

Expand Down Expand Up @@ -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;
}
Expand Down
3 changes: 1 addition & 2 deletions test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt
Expand Up @@ -1462,8 +1462,7 @@ namespace Sentry.PlatformAbstractions
public class Runtime : System.IEquatable<Sentry.PlatformAbstractions.Runtime>
{
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; }
Expand Down
Expand Up @@ -1463,8 +1463,7 @@ namespace Sentry.PlatformAbstractions
public class Runtime : System.IEquatable<Sentry.PlatformAbstractions.Runtime>
{
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; }
Expand Down
Expand Up @@ -1463,8 +1463,7 @@ namespace Sentry.PlatformAbstractions
public class Runtime : System.IEquatable<Sentry.PlatformAbstractions.Runtime>
{
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; }
Expand Down
3 changes: 1 addition & 2 deletions test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt
Expand Up @@ -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; }
Expand Down

0 comments on commit f2524bd

Please sign in to comment.