title: Write to static field - is FindBugs wrong in this case?
body: <p>I have a Java class like this:</p>
  
  <pre><code>public class Foo {
  
      public static int counter = 0;
  
      public void bar(int counter) {
          Foo.counter = counter;
      }
  }
  </code></pre>
  
  <p>FindBugs warns me about writing to the static field <code>counter</code> via the instance method <code>bar</code>. However, if I change the code to:</p>
  
  <pre><code>public class Foo {
  
      public static int counter = 0;
  
      public static void setCounter(int counter) {
          Foo.counter = counter;
      }
  
      public void bar(int counter) {
          setCounter(counter);
      }
  }
  </code></pre>
  
  <p>Then FindBugs won't complain. Isn't that wrong? I'm still writing to a static field from an instance method, just via a static method, am I not?</p>