diff --git a/infer/annotations/com/facebook/infer/annotation/AssumeThreadSafe.java b/infer/annotations/com/facebook/infer/annotation/AssumeThreadSafe.java index 7e0f51e3c..e2f8ca64b 100644 --- a/infer/annotations/com/facebook/infer/annotation/AssumeThreadSafe.java +++ b/infer/annotations/com/facebook/infer/annotation/AssumeThreadSafe.java @@ -20,4 +20,5 @@ import java.lang.annotation.Target; @Target({ ElementType.METHOD }) @Retention(RetentionPolicy.CLASS) public @interface AssumeThreadSafe { + String because(); /** describe why the thread-safety assumption is reasonable */ } diff --git a/infer/tests/codetoanalyze/java/threadsafety/Annotations.java b/infer/tests/codetoanalyze/java/threadsafety/Annotations.java index 3fbabb303..c34526b3d 100644 --- a/infer/tests/codetoanalyze/java/threadsafety/Annotations.java +++ b/infer/tests/codetoanalyze/java/threadsafety/Annotations.java @@ -89,7 +89,7 @@ class Annotations { this.f = new Object(); } - @AssumeThreadSafe + @AssumeThreadSafe(because = "it's a test") public void assumeThreadSafeOk() { this.f = new Object(); }