Package spoon
Class ContractVerifier
java.lang.Object
spoon.ContractVerifier
Verifies all contracts that should hold on any AST.
Usage: `new ContractVerifier(pack).verifyAll();`
-
Constructor Summary
ConstructorDescriptionuse at your own risk, not part of the public APIContractVerifier(CtPackage rootPackage)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checks that all assignments are aither a CtFieldWrite, a CtVariableWrite or a CtArrayWritevoid
void
verifies the core scanning contracts (enter implies exit, etc)void
contract: element is contained in attribute of element's parentvoid
checks that for all elements, the path can be obtained, parsed, and give the same element when evaluatedvoid
void
checks that the identifiers are validvoid
contract: each element is used only once in the modelvoid
verifies that the explicit modifier should be present in the original source codevoid
checks that the scanner behavior and the parents correspondvoid
checkParentConsistency(CtElement element)
public modifier for testing purpose only, not in the public APIvoid
checks that there is always one parent, corresponding to the scanning ordervoid
void
check that we have all shadow elements, and that they are correctly isShadowvoid
verify()
verify all possible contracts in this class
-
Constructor Details
-
ContractVerifier
-
ContractVerifier
public ContractVerifier()use at your own risk, not part of the public API
-
-
Method Details
-
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 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
-