Class Insertions

java.lang.Object
org.checkerframework.afu.annotator.find.Insertions
All Implemented Interfaces:
Iterable<Insertion>

public class Insertions extends Object implements Iterable<Insertion>
A collection of Insertions, indexed by outer class and inner class. It has methods to select Insertions for a given class (forClass(com.sun.source.tree.CompilationUnitTree, java.lang.String)) or for an outer class along with its local classes (forOuterClass(com.sun.source.tree.CompilationUnitTree, java.lang.String)). When a single JAIF stores annotations for many source files, this class reduces the number of insertions to be considered for any AST node.

The class now serves a second purpose, which should probably be separated out: It attaches ASTPath-based inner type Insertions to a TypedInsertion on the outer type if one exists (see organizeTypedInsertions(CompilationUnitTree, String, Collection). Since getting these insertions right depends on this organization, this class is now essential for correctness, not merely for performance.