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

public @Interface GuardSatisfied

extends Annotation
Annotations
@Documented
@Retention:RUNTIME
@Target:TYPE_USE
@TargetLocations:RECEIVER, PARAMETER, RETURN
@SubtypeOf:GuardedByUnknown
Imports
java.lang.annotation.Documented, .ElementType, .Retention, .RetentionPolicy, .Target, org.checkerframework.framework.qual.SubtypeOf, .TargetLocations, .TypeUseLocation

If a variable x has type @GuardSatisfied, then all lock expressions for x's value are held.

Written on a formal parameter (including the receiver), this annotation indicates that the @GuardedBy type for the corresponding actual argument at the method call site is unknown at the method definition site, but any lock expressions that guard it are known to be held prior to the method call.

For example, the formal parameter of the String copy constructor, String#String(String s), is annotated with @GuardSatisfied. This requires that all locks guarding the actual argument are held when the constructor is called. However, the definition of the constructor does not need to know what those locks are (and it cannot know, because the constructor can be called by arbitrary code).

See Also
GuardedBy, Holding

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the index on the GuardSatisfied polymorphic qualifier, or -1 if none
value
()

The index on the GuardSatisfied polymorphic qualifier, if any.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public int value()

The index on the GuardSatisfied polymorphic qualifier, if any. Defaults to -1 so that, if the user writes 0, that is different than writing no index. Writing no index is the usual case.

Returns:int

the index on the GuardSatisfied polymorphic qualifier, or -1 if none