Top Description Methods
org.checkerframework.checker.lock.qual

public @Interface GuardedBy

extends Annotation
Annotations
@Documented
@Retention:RUNTIME
@Target:TYPE_USE, TYPE_PARAMETER
@SubtypeOf:GuardedByUnknown
@DefaultQualifierInHierarchy
@DefaultFor:EXCEPTION_PARAMETER, UPPER_BOUND
typeKinds:BOOLEAN, BYTE, CHAR, DOUBLE, FLOAT, INT, LONG, SHORT
types:String, Void
@UpperBoundFor
typeKinds:BOOLEAN, BYTE, CHAR, DOUBLE, FLOAT, INT, LONG, SHORT
types:String
Imports
java.lang.annotation.Documented, .ElementType, .Retention, .RetentionPolicy, .Target, org.checkerframework.framework.qual.DefaultFor, .DefaultQualifierInHierarchy, .JavaExpression, .SubtypeOf, .TypeKind, .TypeUseLocation, .UpperBoundFor

Indicates that a thread may dereference the value referred to by the annotated variable only if the thread holds all the given lock expressions.

@GuardedBy({}) is the default type qualifier.

The argument is a string or set of strings that indicates the expression(s) that must be held, using the syntax of Java expressions described in the manual. The expressions evaluate to an intrinsic (built-in, synchronization) monitor or an explicit java.util.concurrent.locks.Lock. The expression "<self>" is also permitted; the type @GuardedBy("<self>") Object o indicates that the value referenced by o is guarded by the intrinsic (monitor) lock of the value referenced by o.

Two @GuardedBy annotations with different argument expressions are unrelated by subtyping.

See Also
Holding

Method Summary

Modifier and TypeMethod and Description
public String[]
value()

The Java value expressions that need to be held.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public String[] value()

The Java value expressions that need to be held.

Annotations
@JavaExpression
See Also
Syntax of Java expressions