infer_clone/infer/documentation/issues/GUARDEDBY_VIOLATION.md

361 B

A field annotated with @GuardedBy is being accessed by a call-chain that starts at a non-private method without synchronization.

Example:

class C {
  @GuardedBy("this")
  String f;

  void foo(String s) {
    f = s; // unprotected access here
  }
}

Action: Protect the offending access by acquiring the lock indicated by the @GuardedBy(...).