title: Warning in StringBuffer and StringBuilder
body: <p>I have a StringBuffer initialized outside for loop and inside for loop I am concatenating some strings. </p>
  
  <p>I am getting the warning </p>
  
  <blockquote>
    <p>'StringBuffer stringBuffer' may be declared as 'StringBuilder' </p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>string concatenation as argument to 'stringbuilder.append()' call </p>
  </blockquote>
  
  <p>Then I changed that StringBuffer to StringBuilder, since it is comparatively faster than StringBuffer. Now I am getting the warning as </p>
  
  <blockquote>
    <p>string concatenation as argument to 'stringbuilder.append()' call</p>
  </blockquote>
  
  <p>Sample code:</p>
  
  <pre><code>public static String stringConcat(String[] words) {
      StringBuffer stringBuffer = new StringBuffer();
      for (String word : words) {
          stringBuffer.append(word).append(" ");
      }
      return stringBuffer.toString();
  }
  </code></pre>
  
  <p>Why I am getting these warnings.</p>
  
  <p><strong>Edit Actual code:</strong></p>
  
  <pre><code>stringBuffer.append(word.substring(0, 1).toUpperCase() + word.substring(1).toLowerCase()).append(" ");
  </code></pre>