Skip to content

Commit 88a0220

Browse files
committed
ISSUE-1131: Added 2nd review improvements
1 parent 83a15b5 commit 88a0220

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Microsoft.OpenApi.Readers/OpenApiDiagnostic.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public class OpenApiDiagnostic : IDiagnostic
3131
/// Append another set of diagnostic Errors and Warnings to this one, this may be appended from another external
3232
/// document's parsing and we want to indicate which file it originated from.
3333
/// </summary>
34-
/// <param name="diagnosticToAdd"></param>
35-
/// <param name="fileNameToAdd"></param>
34+
/// <param name="diagnosticToAdd">The diagnostic instance of which the errors and warnings are to be appended to this diagnostic's</param>
35+
/// <param name="fileNameToAdd">The originating file of the diagnostic to be appended, this is prefixed to each error and warning to indicate the originating file</param>
3636
public void AppendDiagnostic(OpenApiDiagnostic diagnosticToAdd, string fileNameToAdd = null)
3737
{
3838
var fileNameIsSupplied = !string.IsNullOrEmpty(fileNameToAdd);
@@ -53,16 +53,18 @@ public void AppendDiagnostic(OpenApiDiagnostic diagnosticToAdd, string fileNameT
5353
/// <summary>
5454
/// Extension class for IList to add the Method "AddRange" used above
5555
/// </summary>
56-
public static class IDiagnosticExtensions
56+
internal static class IDiagnosticExtensions
5757
{
5858
/// <summary>
5959
/// Extension method for IList so that another list can be added to the current list.
6060
/// </summary>
6161
/// <param name="collection"></param>
6262
/// <param name="enumerable"></param>
6363
/// <typeparam name="T"></typeparam>
64-
public static void AddRange<T>(this ICollection<T> collection, IEnumerable<T> enumerable)
64+
internal static void AddRange<T>(this ICollection<T> collection, IEnumerable<T> enumerable)
6565
{
66+
if (collection is null || enumerable is null) return;
67+
6668
foreach (var cur in enumerable)
6769
{
6870
collection.Add(cur);

0 commit comments

Comments
 (0)