-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
area-System.Diagnostics.TracingtrackingThis issue is tracking the completion of other related issues.This issue is tracking the completion of other related issues.
Milestone
Description
The public methods on this internal type have xmldoc that says that eventName can be null.
Lines 167 to 180 in 363b7ad
| /// <summary> | |
| /// Writes an event associated with this activity. | |
| /// May only be called when the activity is in the Started state. | |
| /// </summary> | |
| /// <param name="eventName"> | |
| /// The name to use for the event. If null, the name is determined from | |
| /// data's type. | |
| /// </param> | |
| /// <param name="data">The data to include in the event.</param> | |
| public void Write<T>(string? eventName, T data) | |
| { | |
| EventSourceOptions options = default; | |
| this.Write(this.eventSource, eventName, ref options, ref data); | |
| } |
But one of the two ArgumentNullException sources in this class is for when eventName is null:
Lines 260 to 268 in 363b7ad
| private void Write<T>(EventSource eventSource, string? eventName, ref EventSourceOptions options, ref T data) | |
| { | |
| if (this.state != State.Started) | |
| throw new InvalidOperationException(); // Write after stop. | |
| if (eventName == null) | |
| throw new ArgumentNullException(); | |
| eventSource.Write(eventName, ref options, ref this.activityId, ref s_empty, ref data); | |
| } |
maybe there's something I'm missing, though. Spotted in a code review for updating parameter names for ArgumentException types.
Metadata
Metadata
Assignees
Labels
area-System.Diagnostics.TracingtrackingThis issue is tracking the completion of other related issues.This issue is tracking the completion of other related issues.