Remove some NoWarns from CoreLib (#183)
authorStephen Toub <stoub@microsoft.com>
Fri, 22 Nov 2019 01:49:55 +0000 (20:49 -0500)
committerGitHub <noreply@github.com>
Fri, 22 Nov 2019 01:49:55 +0000 (20:49 -0500)
13 files changed:
src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj
src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/NativeRuntimeEventSource.cs
src/libraries/System.Private.CoreLib/src/Internal/IO/File.Windows.cs
src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventProvider.cs
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/IncrementingPollingCounter.cs
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/PollingCounter.cs
src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Unix.cs
src/libraries/System.Private.CoreLib/src/System/IO/TextWriter.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs
src/libraries/System.Private.CoreLib/src/System/Threading/CancellationToken.cs
src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs
src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TplEventSource.cs

index 8d98beb..4a21dee 100644 (file)
@@ -52,7 +52,7 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
-    <NoWarn>$(NoWarn),0419,0649,1573,1591,3021,CA2002</NoWarn>
+    <NoWarn>$(NoWarn),0419,0649</NoWarn>
     <Nullable>enable</Nullable>
 
     <!-- Ignore all previous constants since SPCL is sensitive to what is defined and the Sdk adds some by default -->
index 5b091f2..abd68ba 100644 (file)
@@ -18,6 +18,10 @@ namespace System.Diagnostics.Tracing
         /// Dispatch a single event with the specified event ID and payload.
         /// </summary>
         /// <param name="eventID">The eventID corresponding to the event as defined in the auto-generated portion of the NativeRuntimeEventSource class.</param>
+        /// <param name="osThreadID">The thread ID of the operating system thread.</param>
+        /// <param name="timeStamp">The current timestamp.</param>
+        /// <param name="activityId">The ID of the current activity.</param>
+        /// <param name="childActivityId">The ID of the current child activity.</param>
         /// <param name="payload">A span pointing to the data payload for the event.</param>
         [NonEvent]
         internal unsafe void ProcessEvent(uint eventID, uint osThreadID, DateTime timeStamp, Guid activityId, Guid childActivityId, ReadOnlySpan<byte> payload)
index c19279d..879ac61 100644 (file)
@@ -23,7 +23,6 @@ namespace Internal.IO
         /// Returns 0 on success, otherwise a Win32 error code.  Note that
         /// classes should use -1 as the uninitialized state for dataInitialized.
         /// </summary>
-        /// <param name="returnErrorOnNotFound">Return the error code for not found errors?</param>
         internal static int FillAttributeInfo(string path, ref Interop.Kernel32.WIN32_FILE_ATTRIBUTE_DATA data, bool returnErrorOnNotFound)
         {
             int errorCode = Interop.Errors.ERROR_SUCCESS;
index eb5deb9..d5380c1 100644 (file)
@@ -874,6 +874,8 @@ ThrowOverflow:
             /// Adds or subtracts two decimal values.
             /// On return, d1 contains the result of the operation and d2 is trashed.
             /// </summary>
+            /// <param name="d1">First decimal to add or subtract.</param>
+            /// <param name="d2">Second decimal to add or subtract.</param>
             /// <param name="sign">True means subtract and false means add.</param>
             internal static unsafe void DecAddSub(ref DecCalc d1, ref DecCalc d2, bool sign)
             {
index b178701..f61366d 100644 (file)
@@ -930,6 +930,9 @@ namespace System.Diagnostics.Tracing
         /// <param name="eventDescriptor">
         /// Event Descriptor for this event.
         /// </param>
+        /// <param name="eventHandle">
+        /// Event handle for this event.
+        /// </param>
         /// <param name="activityID">
         /// A pointer to the activity ID GUID to log
         /// </param>
@@ -1132,6 +1135,9 @@ namespace System.Diagnostics.Tracing
         /// <param name="eventDescriptor">
         /// Event Descriptor for this event.
         /// </param>
+        /// <param name="eventHandle">
+        /// Event handle for this event.
+        /// </param>
         /// <param name="activityID">
         /// A pointer to the activity ID to log
         /// </param>
index 0cdbac7..52def27 100644 (file)
@@ -29,6 +29,7 @@ namespace System.Diagnostics.Tracing
         /// </summary>
         /// <param name="name">The name.</param>
         /// <param name="eventSource">The event source.</param>
+        /// <param name="totalValueProvider">The delegate to invoke to get the total value for this counter.</param>
         public IncrementingPollingCounter(string name, EventSource eventSource, Func<double> totalValueProvider) : base(name, eventSource)
         {
             if (totalValueProvider == null)
index 3dd3d83..d6c6a56 100644 (file)
@@ -27,6 +27,7 @@ namespace System.Diagnostics.Tracing
         /// </summary>
         /// <param name="name">The name.</param>
         /// <param name="eventSource">The event source.</param>
+        /// <param name="metricProvider">The delegate to invoke to get the current metric value.</param>
         public PollingCounter(string name, EventSource eventSource, Func<double> metricProvider) : base(name, eventSource)
         {
             if (metricProvider == null)
index c1f0fcf..2a8e277 100644 (file)
@@ -66,6 +66,7 @@ namespace System.IO
         /// <summary>Initializes a stream for reading or writing a Unix file.</summary>
         /// <param name="mode">How the file should be opened.</param>
         /// <param name="share">What other access to the file should be allowed.  This is currently ignored.</param>
+        /// <param name="originalPath">The original path specified for the FileStream.</param>
         private void Init(FileMode mode, FileShare share, string originalPath)
         {
             _fileHandle.IsAsync = _useAsyncIO;
@@ -802,6 +803,7 @@ namespace System.IO
         }
 
         /// <summary>Sets the current position of this stream to the given value.</summary>
+        /// <param name="fileHandle">The file handle on which to seek.</param>
         /// <param name="offset">The point relative to origin from which to begin seeking. </param>
         /// <param name="origin">
         /// Specifies the beginning, the end, or the current position as a reference
index 8263072..8188fd8 100644 (file)
@@ -567,6 +567,7 @@ namespace System.IO
         /// StringBuilder.GetChunks() method to avoid creating the intermediate string
         /// </summary>
         /// <param name="value">The string (as a StringBuilder) to write to the stream</param>
+        /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
         public virtual Task WriteAsync(StringBuilder? value, CancellationToken cancellationToken = default)
         {
             return
@@ -641,6 +642,7 @@ namespace System.IO
         /// StringBuilder.GetChunks() method to avoid creating the intermediate string
         /// </summary>
         /// <param name="value">The string (as a StringBuilder) to write to the stream</param>
+        /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
         public virtual Task WriteLineAsync(StringBuilder? value, CancellationToken cancellationToken = default)
         {
             return
index 043a133..0cea738 100644 (file)
@@ -151,6 +151,7 @@ namespace System.Runtime.CompilerServices
         /// <summary>Gets the "boxed" state machine object.</summary>
         /// <typeparam name="TStateMachine">Specifies the type of the async state machine.</typeparam>
         /// <param name="stateMachine">The state machine.</param>
+        /// <param name="taskField">The reference to the Task field storing the Task instance.</param>
         /// <returns>The "boxed" state machine.</returns>
         private static IAsyncStateMachineBox GetStateMachineBox<TStateMachine>(
             ref TStateMachine stateMachine,
@@ -427,16 +428,17 @@ namespace System.Runtime.CompilerServices
 
         /// <summary>Completes the already initialized task with the specified result.</summary>
         /// <param name="result">The result to use to complete the task.</param>
-        internal static void SetExistingTaskResult(Task<TResult> taskField, [AllowNull] TResult result)
+        /// <param name="task">The task to complete.</param>
+        internal static void SetExistingTaskResult(Task<TResult> task, [AllowNull] TResult result)
         {
-            Debug.Assert(taskField != null, "Expected non-null task");
+            Debug.Assert(task != null, "Expected non-null task");
 
             if (AsyncCausalityTracer.LoggingOn)
             {
-                AsyncCausalityTracer.TraceOperationCompletion(taskField, AsyncCausalityStatus.Completed);
+                AsyncCausalityTracer.TraceOperationCompletion(task, AsyncCausalityStatus.Completed);
             }
 
-            if (!taskField.TrySetResult(result))
+            if (!task.TrySetResult(result))
             {
                 ThrowHelper.ThrowInvalidOperationException(ExceptionResource.TaskT_TransitionToFinal_AlreadyCompleted);
             }
index 498ccd4..d751bb4 100644 (file)
@@ -262,6 +262,7 @@ namespace System.Threading
         /// <param name="useSynchronizationContext">A Boolean value that indicates whether to capture
         /// the current <see cref="System.Threading.SynchronizationContext">SynchronizationContext</see> and use it
         /// when invoking the <paramref name="callback"/>.</param>
+        /// <param name="useExecutionContext">true to capture the current ExecutionContext; otherwise, false.</param>
         /// <returns>The <see cref="System.Threading.CancellationTokenRegistration"/> instance that can
         /// be used to unregister the callback.</returns>
         /// <exception cref="System.ArgumentNullException"><paramref name="callback"/> is null.</exception>
index 05cd310..8ce8004 100644 (file)
@@ -4229,6 +4229,7 @@ namespace System.Threading.Tasks
         /// <param name="continuationTask">The continuation task itself.</param>
         /// <param name="scheduler">TaskScheduler with which to associate continuation task.</param>
         /// <param name="options">Restrictions on when the continuation becomes active.</param>
+        /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
         internal void ContinueWithCore(Task continuationTask,
                                        TaskScheduler scheduler,
                                        CancellationToken cancellationToken,
index 359d336..f244f31 100644 (file)
@@ -194,6 +194,7 @@ namespace System.Threading.Tasks
         /// <param name="TaskID">The task ID.</param>
         /// <param name="CreatingTaskID">The task ID</param>
         /// <param name="TaskCreationOptions">The options used to create the task.</param>
+        /// <param name="appDomain">The ID for the current AppDomain.</param>
         [Event(TASKSCHEDULED_ID, Task = Tasks.TaskScheduled, Version = 1, Opcode = EventOpcode.Send,
          Level = EventLevel.Informational, Keywords = Keywords.TaskTransfer | Keywords.Tasks)]
         public void TaskScheduled(
@@ -392,11 +393,12 @@ namespace System.Threading.Tasks
         /// </summary>
         /// <param name="OriginatingTaskSchedulerID">The scheduler ID.</param>
         /// <param name="OriginatingTaskID">The task ID.</param>
+        /// <param name="ContinueWithTaskId">The ID of the continuation object.</param>
         [Event(AWAITTASKCONTINUATIONSCHEDULED_ID, Task = Tasks.AwaitTaskContinuationScheduled, Opcode = EventOpcode.Send,
          Level = EventLevel.Informational, Keywords = Keywords.TaskTransfer | Keywords.Tasks)]
         public void AwaitTaskContinuationScheduled(
             int OriginatingTaskSchedulerID, int OriginatingTaskID,  // PFX_COMMON_EVENT_HEADER
-            int ContinuwWithTaskId)
+            int ContinueWithTaskId)
         {
             if (IsEnabled() && IsEnabled(EventLevel.Informational, Keywords.TaskTransfer | Keywords.Tasks))
             {
@@ -410,11 +412,11 @@ namespace System.Threading.Tasks
                     eventPayload[1].DataPointer = ((IntPtr)(&OriginatingTaskID));
                     eventPayload[1].Reserved = 0;
                     eventPayload[2].Size = sizeof(int);
-                    eventPayload[2].DataPointer = ((IntPtr)(&ContinuwWithTaskId));
+                    eventPayload[2].DataPointer = ((IntPtr)(&ContinueWithTaskId));
                     eventPayload[2].Reserved = 0;
                     if (TasksSetActivityIds)
                     {
-                        Guid continuationActivityId = CreateGuidForTaskID(ContinuwWithTaskId);
+                        Guid continuationActivityId = CreateGuidForTaskID(ContinueWithTaskId);
                         WriteEventWithRelatedActivityIdCore(AWAITTASKCONTINUATIONSCHEDULED_ID, &continuationActivityId, 3, eventPayload);
                     }
                     else