Summary: For collections whose type does not express that the collection is thread-safe (e.g., `Collections.syncrhonizedMap` and friends). If you annotate a field holding one of these collections, we won't warn when you mutate the collection. Reviewed By: jeremydubreil Differential Revision: D4763565 fbshipit-source-id: 58b487amaster
parent
81c0877e20
commit
d5ed44994f
@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 - present Facebook, Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the BSD style license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree. An additional grant
|
||||||
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.facebook.infer.annotation;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tell the analysis that a collection is thread-safe when this information is not already
|
||||||
|
* reflected in the collection's type. For example:
|
||||||
|
* private {@literal @SynchronizedCollection} Map mMap = Collections.synchronizedMap(...);
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Target({ ElementType.FIELD })
|
||||||
|
@Retention(RetentionPolicy.CLASS)
|
||||||
|
public @interface SynchronizedCollection {
|
||||||
|
}
|
Loading…
Reference in new issue