UnqualifiedYield
In recent versions of Java, 'yield' is a contextual keyword, and calling an unqualified method with that name is an error.

Severity
WARNING

The problem

In recent versions of Java, yield is a restricted identifier:

class T {
  void yield() {}
  {
    yield();
  }
}
$ javac --release 20 T.java
T.java:3: error: invalid use of a restricted identifier 'yield'
    yield();
    ^
  (to invoke a method called yield, qualify the yield with a receiver or type name)
1 error

To invoke existing methods called yield, use qualified names:

class T {
  void yield() {}
  {
    this.yield();
  }
}
class T {
  static void yield() {}
  {
    T.yield();
  }
}
class T {
  void yield() {}
  class I {
    {
      T.this.yield();
    }
  }
}

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("UnqualifiedYield") to the enclosing element.