title: how to deal with bug "dead store to local variable" in java?
body: <p>I wrote a simple test code. It is a circle. I suppose most people can image what is a circle class, so I will not paste it.</p>
  
  <p>In the test code, I try to test the circle constructor with invalid point, and assume to throw an exception. But a bug occures. I check online, but still do not know how to solve the problem. Is there any one can help me? Thanks</p>
  
  <p>code information, bug is in the last sentence of following code</p>
  
  <pre><code>/**
   * Tests that the Circle constructor throws an exception for center Point. 
   */
  @Test (expected = IllegalArgumentException.class)
  public void testIllegalCenter() {
    //Instantiates a circle with an incorrect center point.
      @SuppressWarnings("unused")
      final Circle testCircle = new Circle(VALID_RADIUS, INVALID_POINT, VALID_COLOR);
  }
  </code></pre>
  
  <p>bug report</p>
  
  <p>Bug: Dead store to testCircle in CircleTest.testIllegalCenter()</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. </p>
  
  <p>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>