title: Suppress FindBugs warnings in Eclipse
body: <p>I am using a string as a lock and so want to ensure the object is a new instance.  FindBugs complains because it's generally more efficient to define the string directly (with double quotes).  My code looks like:</p>
  
  <pre><code>/** A lock for the list of inputs. */
  @edu.umd.cs.findbugs.annotations.SuppressWarnings("DM_STRING_CTOR")
  //We want a new String object here as this is a lock.
  private final Object inputListLock = new String("inputListLock");
  </code></pre>
  
  <p>Am I doing something wrong here?  The Eclipse FindBugs plugin is still reporting this as a problem:</p>
  
  <pre>
  Pattern id: DM_STRING_CTOR, type: Dm, category: PERFORMANCE
  
  Using the java.lang.String(String) constructor wastes memory because the object so constructed will be functionally indistinguishable from the String passed as a parameter.  Just use the argument String directly.
  </pre>