From f79a53e1c81ae7821fd3a9bdcaa706de33662590 Mon Sep 17 00:00:00 2001 From: Sam Blackshear Date: Fri, 20 Jan 2017 10:32:55 -0800 Subject: [PATCH] [thread-safety] add string param to AssumeThreadSafe Reviewed By: jaegs Differential Revision: D4438627 fbshipit-source-id: 5f959a2 --- .../com/facebook/infer/annotation/AssumeThreadSafe.java | 1 + infer/tests/codetoanalyze/java/threadsafety/Annotations.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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(); }