Validating method's parameter is marked as 'only used in precondition'

Recent Resharper builds mark parameters of my validating methods as 'not used'. I was wondering what's the correct approach to take when writing these methods?

Example:

private static void ValidateText(string text)
{
    if (text.Length == 0) throw new ArgumentException("text is empty");
}

1 comment

Hello Alex,

You can either disable this warning (with comment or through options) or
inline this method. Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Recent Resharper builds marks parameters of  my validating methods as
'not used'. I was wondering what's the correct approach to take in
writing these methods?

Example:

private static void ValidateText(string text)
{
if (text.Length == 0) throw new ArgumentException("text is
empty");
}
---
Original message URL:
http://devnet.jetbrains.net/message/5303988#5303988



0

Please sign in to leave a comment.