IBatisNet.DataMapper.Scope.ErrorContext.ToString() incorrectly tests for unset _resource, _activity, _objectId, and _moreInfo members. --------------------------------------------------------------------------------------------------------------------------------------
Key: IBATISNET-52 URL: http://issues.apache.org/jira/browse/IBATISNET-52 Project: iBatis for .NET Type: Bug Environment: [assembly: AssemblyVersion("1.1.458")] Reporter: Ron Grabowski Assigned to: Gilles Bayon Priority: Trivial As of 5/5/2005, the IBatisNet.DataMapper.Scope.ErrorContext class in SVN has the following code for Reset(): public void Reset() { _resource = string.Empty; _activity = string.Empty;; _objectId = string.Empty;; _moreInfo = string.Empty;; } When a call to ToString() is made: public override string ToString() { StringBuilder message = new StringBuilder(); /* snip */ // object if (_objectId != null) { message.Append(" \n- Check the "); message.Append(_objectId); message.Append("."); } The test for _objectId will always be true becuase the 4 members are not equal to null. The test for the 4 members should be: if (_objectId != null && _objectId.Length > 0) An example of the incorrect output can be seen by looking at issue IBATISNET-51. Specifically the line: - Check the .] -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira