public class WholeProgramInferenceScenesHelper
extends java.lang.Object
The set of annotations inferred for a certain class is stored in an AScene
, which writeScenesToJaif()
can write into a .jaif file.
For example, a class field of a class whose fully-qualified name is my.package.MyClass
will have its inferred type stored in a Scene, and later written into a file named my.package.MyClass.jaif
.
This class populates the initial Scenes by reading existing .jaif files on the jaifFilesPath
directory. Having more information in those initial .jaif files means that the
precision achieved by the whole-program inference analysis will be better. writeScenesToJaif()
rewrites the initial .jaif files, and may create new ones.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
jaifFilesPath
Directory where .jaif files will be written to and read from.
|
Constructor and Description |
---|
WholeProgramInferenceScenesHelper(boolean ignoreNullAssignments) |
Modifier and Type | Method and Description |
---|---|
protected scenelib.annotations.el.AClass |
getAClass(java.lang.String className,
java.lang.String jaifPath)
Returns the AClass in an AScene, given a className and a jaifPath.
|
protected java.lang.String |
getJaifPath(java.lang.String className)
Returns the String representing the .jaif path of a class given its name.
|
protected scenelib.annotations.el.AScene |
getScene(java.lang.String jaifPath)
Returns the Scene stored in a .jaif file path passed as input.
|
protected void |
updateAnnotationSetInScene(scenelib.annotations.el.ATypeElement type,
AnnotatedTypeFactory atf,
java.lang.String jaifPath,
AnnotatedTypeMirror rhsATM,
AnnotatedTypeMirror lhsATM,
TypeUseLocation defLoc)
Updates the set of annotations in a location of a Scene.
|
void |
writeScenesToJaif()
Write all modified scenes into .jaif files.
|
public static final java.lang.String jaifFilesPath
public WholeProgramInferenceScenesHelper(boolean ignoreNullAssignments)
public void writeScenesToJaif()
updateAnnotationSetInScene(scenelib.annotations.el.ATypeElement, org.checkerframework.framework.type.AnnotatedTypeFactory, java.lang.String, org.checkerframework.framework.type.AnnotatedTypeMirror, org.checkerframework.framework.type.AnnotatedTypeMirror, org.checkerframework.framework.qual.TypeUseLocation)
.)protected java.lang.String getJaifPath(java.lang.String className)
protected scenelib.annotations.el.AScene getScene(java.lang.String jaifPath)
protected scenelib.annotations.el.AClass getAClass(java.lang.String className, java.lang.String jaifPath)
protected void updateAnnotationSetInScene(scenelib.annotations.el.ATypeElement type, AnnotatedTypeFactory atf, java.lang.String jaifPath, AnnotatedTypeMirror rhsATM, AnnotatedTypeMirror lhsATM, TypeUseLocation defLoc)
type
- ATypeElement of the Scene which will be modifiedatf
- the annotated type factory of a given type system, whose type hierarchy will be
usedjaifPath
- used to identify a ScenerhsATM
- the RHS of the annotated type on the source codelhsATM
- the LHS of the annotated type on the source codedefLoc
- the location where the annotation will be added