-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
area-System.Diagnostics.Activitybreaking-changeIssue or PR that represents a breaking API or functional change over a previous release.Issue or PR that represents a breaking API or functional change over a previous release.needs-breaking-change-doc-createdBreaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnetBreaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet
Milestone
Description
Activity has a quirk in that its OperationName is not marked as nullable but its constructor allows it to be null. Chatted offline with the group CCed below and we agreed that it is a low-risk change to coalesce to string.Empty in this case.
Something like this:
public Activity(string operationName)
{
Source = s_defaultSource;
// Allow data by default in the constructor to keep the compatibility.
IsAllDataRequested = true;
if (string.IsNullOrEmpty(operationName))
{
NotifyError(new ArgumentException(SR.OperationNameInvalid)); // <- Note: Does not throw.
operationName = string.Empty; // <- New logic here.
}
OperationName = operationName;
}We consider setting to something like "<null>" but decided to use string.Empty because that is similar to what happens for Activity.Source.Name in the case of legacy instances.
/cc @tarekgh @noahfalk @reyang @cijothomas @utpilla @alanwest
tarekgh, cijothomas, alanwest and xsoheilalizadeh
Metadata
Metadata
Assignees
Labels
area-System.Diagnostics.Activitybreaking-changeIssue or PR that represents a breaking API or functional change over a previous release.Issue or PR that represents a breaking API or functional change over a previous release.needs-breaking-change-doc-createdBreaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnetBreaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet