Class MustCallInference

java.lang.Object
org.checkerframework.checker.resourceleak.MustCallInference

public class MustCallInference extends Object
This class implements the annotation inference algorithm for the Resource Leak Checker. It infers annotations such as @Owning on owning fields and parameters, @EnsuresCalledMethods on methods, and @InheritableMustCall on class declarations.

Each instance of this class corresponds to a single control flow graph (CFG), typically representing a method.

The algorithm determines if the @MustCall obligation of a field is satisfied along some path leading to the regular exit point of the method. If the obligation is satisfied, it adds an @Owning annotation on the field and an @EnsuresCalledMethods annotation on the method being analyzed. Additionally, if the method being analyzed satisfies the must-call obligation of all the enclosed owning fields, it adds a @InheritableMustCall annotation on the enclosing class.

Note: This class makes the assumption that the must-call set has only one element. Must-call sets with more than one element may be supported in the future.

See ResourceLeakChecker.ENABLE_WPI_FOR_RLC for an explanation of the meaning of the flags -Ainfer and -AenableWpiForRlc.

See Also: