diff --git a/runtime/CSharp/src/Atn/Transition.cs b/runtime/CSharp/src/Atn/Transition.cs index 98748f9c8a..85c0b4e8ba 100644 --- a/runtime/CSharp/src/Atn/Transition.cs +++ b/runtime/CSharp/src/Atn/Transition.cs @@ -34,7 +34,7 @@ protected internal Transition(ATNState target) { if (target == null) { - throw new ArgumentNullException("target cannot be null."); + throw new ArgumentNullException(nameof(target), "target cannot be null."); } this.target = target; } diff --git a/runtime/CSharp/src/BufferedTokenStream.cs b/runtime/CSharp/src/BufferedTokenStream.cs index 806e3553a1..9729787c32 100644 --- a/runtime/CSharp/src/BufferedTokenStream.cs +++ b/runtime/CSharp/src/BufferedTokenStream.cs @@ -112,7 +112,7 @@ public BufferedTokenStream(ITokenSource tokenSource) { if (tokenSource == null) { - throw new ArgumentNullException("tokenSource cannot be null"); + throw new ArgumentNullException(nameof(tokenSource), "tokenSource cannot be null"); } this._tokenSource = tokenSource; } diff --git a/runtime/CSharp/src/ListTokenSource.cs b/runtime/CSharp/src/ListTokenSource.cs index ea263b9c80..23aaf125fd 100644 --- a/runtime/CSharp/src/ListTokenSource.cs +++ b/runtime/CSharp/src/ListTokenSource.cs @@ -134,7 +134,7 @@ public ListTokenSource(IList tokens, string sourceName) { if (tokens == null) { - throw new ArgumentNullException("tokens cannot be null"); + throw new ArgumentNullException(nameof(tokens), "tokens cannot be null"); } this.tokens = tokens; this.sourceName = sourceName;