package sfBugs;

import javax.annotation.CheckForNull;

import edu.umd.cs.findbugs.annotations.DesireNoWarning;


public class Bug3484713 {
  @CheckForNull
  private String foo;

  public Runnable doFoo() {
    if (foo != null) {
      // No warning here.
      System.out.println(foo.equals("foo"));
    }
    Runnable r = new Runnable() {
      @Override
      public void run() {
        if (foo != null) {
          /*
           * Getting a findbugs warning on next line:
           * "Possible null pointer dereference in WrongNPWarning$1.run() due to return value of called method"
           */
          System.out.println(foo.equals("foo"));
        }
      }
    };
    return r;
  }
}
@@ -92,14 +92,8 @@
 ons.
-Desire
 NoWa
@@ -166,16 +166,35 @@
 g foo;%0A%0A
+  @NoWarning(%22NP%22)%0A
   public
@@ -343,24 +343,47 @@
 unnable() %7B%0A
+      @NoWarning(%22NP%22)%0A
       @Overr

mark warning expectations