This question is locked. New answers and comments are not allowed.
Hello, Again.
I am working on an exception to ensure that developers check incoming variables to a method before they use them. I'm having problems when they use a method like "String.IsNullOrEmpty(variable)". Here is the example code...
VB.NET
Public Sub test(ByVal str As String, ByVal logLine As String) Dim Y as string = str If String.IsNullOrEmpty(logLine) Then Throw New Exception("LogConsoleLogInfo: empty string logLine") End If Dim X as String = logLineEnd SubC#
public void test(String str, String logLine){ str Y = str; If (String.IsNullOrEmpty(logLine) { Throw New Exception("LogConsoleLogInfo: empty string Logline"); str X = logLine;}I would completely expect "str" to be underlined in my exception, but since they checked "logLine" with String.IsNullOrEmpty, it shouldn't be underlined. I either get both or neither with my existing code.
Any help would be greatly appreciated!
Thanks,
Jim Evans
Application Architect, eMASON, Inc.