Top Description Inners Methods
org.checkerframework.checker.calledmethods.qual

public @Interface EnsuresCalledMethods

extends Annotation
Annotations
@PostconditionAnnotation
qualifier:CalledMethods
@Target:METHOD, CONSTRUCTOR
@Repeatable:List
Imports
java.lang.annotation.Documented, .ElementType, .Repeatable, .Retention, .RetentionPolicy, .Target, org.checkerframework.framework.qual.InheritedAnnotation, .PostconditionAnnotation, .QualifierArgument

Indicates that the method, if it terminates successfully, always invokes the given methods on the given expressions. This annotation is repeatable, which means that users can write more than one instance of it on the same method (users should NOT manually write an @EnsuresCalledMethods.List annotation, which the checker will create from multiple copies of this annotation automatically).

Consider the following method:

@EnsuresCalledMethods(value = "#1", methods = "m")
public void callM(T t) { ... }

This method guarantees that t.m() is always called before the method returns.

If a class has any @Owning fields, then one or more of its must-call methods should be annotated to indicate that the must-call obligations are satisfied. The must-call methods are those named by the @MustCall or @InheritableMustCall annotation on the class declaration, such as close(). Here is a common example:

@EnsuresCalledMethods(value = {"owningField1", "owningField2"}, methods = "close")
public void close() { ... }
See Also
EnsuresCalledMethodsIf

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static @interface
EnsuresCalledMethods.List

A wrapper annotation that makes the EnsuresCalledMethods annotation repeatable.

Method Summary

Modifier and TypeMethod and Description
public String[]

Returns:

the methods guaranteed to be invoked on the expressions
methods
()

The methods guaranteed to be invoked on the expressions.

public String[]

Returns:

the Java expressions to which the qualifier applies
value
()

The Java expressions to which the qualifier applies.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

methodsback to summary
public String[] methods()

The methods guaranteed to be invoked on the expressions.

Returns:String[]

the methods guaranteed to be invoked on the expressions

Annotations
@QualifierArgument:value
valueback to summary
public String[] value()

The Java expressions to which the qualifier applies.

Returns:String[]

the Java expressions to which the qualifier applies

See Also
org.checkerframework.framework.qual.EnsuresQualifier
org.checkerframework.checker.calledmethods.qual back to summary

public @Interface EnsuresCalledMethods.List

extends Annotation
Annotations
@Documented
@Retention:RUNTIME
@Target:METHOD, CONSTRUCTOR
@InheritedAnnotation

A wrapper annotation that makes the EnsuresCalledMethods annotation repeatable. This annotation is an implementation detail: programmers generally do not need to write this. It is created automatically by Java when a programmer writes more than one EnsuresCalledMethods annotation at the same location.

Method Summary

Modifier and TypeMethod and Description
public EnsuresCalledMethods[]

Returns:

the repeatable annotations
value
()

Return the repeatable annotations.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public EnsuresCalledMethods[] value()

Return the repeatable annotations.

Returns:EnsuresCalledMethods[]

the repeatable annotations