title: Dataflow anomaly analysis warnings from PMD
body: <p>I am using Eclipse with the <code>PMD Plug-in (4.0.0.v20130510-1000)</code> and get a lot of those violations:</p>
  
  <p><code>Found 'DD'-anomaly for variable 'freq' (lines '187'-'189').</code><br />
  <code>Found 'DU'-anomaly for variable 'freq' (lines '189'-'333').</code></p>
  
  <p>In <a href="https://stackoverflow.com/a/1615477/1137043">this</a> SO answer, it says that those anomalies are related to assigning values that are never read. But I get the violations for instance in this case:</p>
  
  <pre><code>// here I get a DD anomaly
  double freq = 0;
  try {
    // here I get a DU anomaly
    freq = Double.parseDouble(getFrequencyTextField().getText());
  } catch (final NumberFormatException e) {
    Log.e(e.getMessage());
  }
  if (freq &lt; 10E6) doSomething();
  </code></pre>
  
  <p>If I remove the initialization and add a <code>freq = 0;</code> line in the <code>catch</code> block, the DD anomaly vanishes, but I get a DU anomaly on both the assignments.</p>
  
  <p><strong>Now my question: How am I supposed to deal with that? What would be the preferred solution of PMD? And what exactly is this rule trying to prevent (i.e. why is it bad practice)?</strong> </p>