Skip to content

Commit 0ae0b0b

Browse files
committed
Instantiate argument exceptions correctly
Signed-off-by: Author Name <[email protected]>
1 parent 6722835 commit 0ae0b0b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

runtime/CSharp/src/Atn/Transition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected internal Transition(ATNState target)
3434
{
3535
if (target == null)
3636
{
37-
throw new ArgumentNullException("target cannot be null.");
37+
throw new ArgumentNullException(nameof(target), "target cannot be null.");
3838
}
3939
this.target = target;
4040
}

runtime/CSharp/src/BufferedTokenStream.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public BufferedTokenStream(ITokenSource tokenSource)
112112
{
113113
if (tokenSource == null)
114114
{
115-
throw new ArgumentNullException("tokenSource cannot be null");
115+
throw new ArgumentNullException(nameof(tokenSource), "tokenSource cannot be null");
116116
}
117117
this._tokenSource = tokenSource;
118118
}

runtime/CSharp/src/ListTokenSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public ListTokenSource(IList<IToken> tokens, string sourceName)
134134
{
135135
if (tokens == null)
136136
{
137-
throw new ArgumentNullException("tokens cannot be null");
137+
throw new ArgumentNullException(nameof(tokens), "tokens cannot be null");
138138
}
139139
this.tokens = tokens;
140140
this.sourceName = sourceName;

0 commit comments

Comments
 (0)