Fixed
Details
Details
Assignee
Former user
Former user(Deactivated)Reporter
i
iComponents
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created April 26, 2005 at 10:37 AM
Updated May 7, 2005 at 8:21 AM
Resolved April 27, 2005 at 2:05 AM
The ternary conditional operators in ValidateParameters is coded incorrectly and thus does nothing. The ternary is "test" ? "true" : "false", but what is coded is the opposite; the != null should be a == null.
public void ValidateParameters()
{
int typesLength = PositionalParameterTypes != null ? 0 : PositionalParameterTypes.Length;
int valuesLength = PositionalParameterValues != null ? 0 : PositionalParameterValues.Length;
if( typesLength != valuesLength )
{
throw new QueryException( "Number of positional parameter types (" + typesLength + ") does not match number of positional parameter values (" + valuesLength + ")" );
}
}
SHOULD BE:
public void ValidateParameters()
{
int typesLength = PositionalParameterTypes == null ? 0 : PositionalParameterTypes.Length;
int valuesLength = PositionalParameterValues == null ? 0 : PositionalParameterValues.Length;
if( typesLength != valuesLength )
{
throw new QueryException( "Number of positional parameter types (" + typesLength + ") does not match number of positional parameter values (" + valuesLength + ")" );
}
}