title: Code Analysis Failure: Dead store to local variable
body: <p>I have a code analysis tool that is flagging the <code>LinkedHashSet&lt;String&gt; widgetsToCreate = new LinkedHashSet&lt;String&gt;();</code> line in the below method, any ideas on a way to fix the logic that would satisfy the analysis tool?  </p>
  
  <p><strong>Dead store to local variable:</strong> </p>
  
  <p>This instruction assigns a value to a local variable, but the value is not read or used in any subsequent instruction. Often, this indicates an error, because the value computed is never used. Note that Sun's javac compiler often generates dead stores for final local variables. Because FindBugs is a bytecode-based tool, there is no easy way to eliminate these false positives.</p>
  
  <pre><code>public void add(Map&lt;String, String&gt; input) {    
      TreeSet&lt;String&gt; widgetsToAdd = new TreeSet&lt;String&gt;();
      TreeSet&lt;String&gt; widgetsToUpdate = new TreeSet&lt;String&gt;();
      LinkedHashSet&lt;String&gt; widgetsToCreate = new LinkedHashSet&lt;String&gt;();
  
      for (Map.Entry&lt;String, String&gt; entry : input.entrySet()) {
        //logic to add to widgetsToAdd based on content of the input Map
      }
  
       widgetsToCreate = processInput(widgetsToAdd);
       for (Iterator&lt;String&gt; wIterator = widgetsToCreate.iterator(); wIterator.hasNext();) {
           //process each widgetsToCreate  
       }
  }
  </code></pre>