|
|
@ -23,11 +23,31 @@ import com.facebook.infer.annotation.ThreadConfined;
|
|
|
|
|
|
|
|
|
|
|
|
/** tests for classes and method annotations that are meaningful w.r.t thread-safety */
|
|
|
|
/** tests for classes and method annotations that are meaningful w.r.t thread-safety */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Target(ElementType.METHOD)
|
|
|
|
|
|
|
|
@Retention(RetentionPolicy.CLASS)
|
|
|
|
|
|
|
|
@interface OnBind {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Target(ElementType.METHOD)
|
|
|
|
@Target(ElementType.METHOD)
|
|
|
|
@Retention(RetentionPolicy.CLASS)
|
|
|
|
@Retention(RetentionPolicy.CLASS)
|
|
|
|
@interface OnEvent {
|
|
|
|
@interface OnEvent {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Target(ElementType.METHOD)
|
|
|
|
|
|
|
|
@Retention(RetentionPolicy.CLASS)
|
|
|
|
|
|
|
|
@interface OnMount {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Target(ElementType.METHOD)
|
|
|
|
|
|
|
|
@Retention(RetentionPolicy.CLASS)
|
|
|
|
|
|
|
|
@interface OnUnbind {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Target(ElementType.METHOD)
|
|
|
|
|
|
|
|
@Retention(RetentionPolicy.CLASS)
|
|
|
|
|
|
|
|
@interface OnUnmount {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ThreadSafe
|
|
|
|
@ThreadSafe
|
|
|
|
class Annotations {
|
|
|
|
class Annotations {
|
|
|
|
Object f;
|
|
|
|
Object f;
|
|
|
@ -89,6 +109,26 @@ class Annotations {
|
|
|
|
this.f = new Object();
|
|
|
|
this.f = new Object();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@OnBind
|
|
|
|
|
|
|
|
public void onBindMethodOk() {
|
|
|
|
|
|
|
|
this.f = new Object();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@OnMount
|
|
|
|
|
|
|
|
public void onMountMethodOk() {
|
|
|
|
|
|
|
|
this.f = new Object();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@OnUnmount
|
|
|
|
|
|
|
|
public void onUnmountMethodOk() {
|
|
|
|
|
|
|
|
this.f = new Object();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@OnUnbind
|
|
|
|
|
|
|
|
public void onUnbindMethodOk() {
|
|
|
|
|
|
|
|
this.f = new Object();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@AssumeThreadSafe(because = "it's a test")
|
|
|
|
@AssumeThreadSafe(because = "it's a test")
|
|
|
|
public void assumeThreadSafeOk() {
|
|
|
|
public void assumeThreadSafeOk() {
|
|
|
|
this.f = new Object();
|
|
|
|
this.f = new Object();
|
|
|
|