Howdy'all, I'm working through the verbosity behavior in SqlTask to make it behave more like what I expected (please see the attached patch for your consideration) and I came across this additional oddity.  Does it strike anybody else as defeating the purpose of using StringBuilder in the first place?  I didn't change it in the attached patch, but it (although more readable that proper Append()s should be) has Code Smell® to me.  :)

 

Peoples' Exhibit 001a:

 

         if ( this.Verbose ) {

             StringBuilder message = new StringBuilder();

             message.Append ("SQL Task:" + Environment.NewLine);

             message.Append ("Connection String: " + ConnectionString + Environment.NewLine);

             message.Append ("Use Transaction?: " + UseTransaction.ToString() + Environment.NewLine);

             message.Append ("Batch Sql Statements?: " + this.Batch.ToString() + Environment.NewLine);

             message.Append ("Batch Delimiter: " + this.Delimiter + Environment.NewLine);

             message.Append ("Delimiter Style: " + this.DelimiterStyle.ToString() + Environment.NewLine);

             message.Append ("Fail On Error?: " + this.FailOnError.ToString() + Environment.NewLine);

             message.Append ("Source script file: " + this.Source + Environment.NewLine);

             message.Append ("Output file: " + this.Output + Environment.NewLine);

             Log(Level.Info, message.ToString());

         }

 

Attachment: sqltask.patch
Description: sqltask.patch

Reply via email to