Package spoon
Class ContractVerifier
- java.lang.Object
-
- spoon.ContractVerifier
-
public class ContractVerifier extends Object
Verifies all contracts that should hold on any AST. Usage: `new ContractVerifier(pack).verifyAll();`
-
-
Constructor Summary
Constructors Constructor Description ContractVerifier()
use at your own risk, not part of the public APIContractVerifier(CtPackage rootPackage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkAssignmentContracts()
checks that all assignments are aither a CtFieldWrite, a CtVariableWrite or a CtArrayWritevoid
checkBoundAndUnboundTypeReference()
void
checkContractCtScanner()
verifies the core scanning contracts (enter implies exit, etc)void
checkElementIsContainedInAttributeOfItsParent()
contract: element is contained in attribute of element's parentvoid
checkElementToPathToElementEquivalence()
checks that for all elements, the path can be obtained, parsed, and give the same element when evaluatedvoid
checkGenericContracts()
void
checkJavaIdentifiers()
checks that the identifiers are validvoid
checkModelIsTree()
contract: each element is used only once in the modelvoid
checkModifiers()
verifies that the explicit modifier should be present in the original source codevoid
checkParentConsistency()
checks that the scanner behavior and the parents correspondvoid
checkParentConsistency(CtElement element)
public modifier for testing purpose only, not in the public APIvoid
checkParentContract()
checks that there is always one parent, corresponding to the scanning ordervoid
checkRoleInParent()
void
checkShadow()
check that we have all shadow elements, and that they are correctly isShadowvoid
verify()
verify all possible contracts in this class
-
-
-
Constructor Detail
-
ContractVerifier
public ContractVerifier(CtPackage rootPackage)
-
ContractVerifier
public ContractVerifier()
use at your own risk, not part of the public API
-
-
Method Detail
-
verify
public void verify()
verify all possible contracts in this class
-
checkModifiers
public void checkModifiers()
verifies that the explicit modifier should be present in the original source code
-
checkParentContract
public void checkParentContract()
checks that there is always one parent, corresponding to the scanning order
-
checkBoundAndUnboundTypeReference
public void checkBoundAndUnboundTypeReference()
-
checkShadow
public void checkShadow()
check that we have all shadow elements, and that they are correctly isShadow
-
checkContractCtScanner
public void checkContractCtScanner()
verifies the core scanning contracts (enter implies exit, etc)
-
checkAssignmentContracts
public void checkAssignmentContracts()
checks that all assignments are aither a CtFieldWrite, a CtVariableWrite or a CtArrayWrite
-
checkParentConsistency
public void checkParentConsistency()
checks that the scanner behavior and the parents correspond
-
checkParentConsistency
public void checkParentConsistency(CtElement element)
public modifier for testing purpose only, not in the public API
-
checkModelIsTree
public void checkModelIsTree()
contract: each element is used only once in the model
-
checkRoleInParent
public void checkRoleInParent()
-
checkElementToPathToElementEquivalence
public void checkElementToPathToElementEquivalence()
checks that for all elements, the path can be obtained, parsed, and give the same element when evaluated
-
checkElementIsContainedInAttributeOfItsParent
public void checkElementIsContainedInAttributeOfItsParent()
contract: element is contained in attribute of element's parent
-
checkGenericContracts
public void checkGenericContracts()
-
checkJavaIdentifiers
public void checkJavaIdentifiers()
checks that the identifiers are valid
-
-