报告对在 thisthis 的实例字段上锁定的非常量 static 字段的访问。

在实例数据上锁定 static 字段并不能防止其他实例修改该字段,因此可能会导致意外的竞争条件。

示例:


  static String s;
  def foo() {
      synchronized (this) {
          System.out.println(s); // 警告
      }
  }