Package org.apache.groovy.contracts.ast
Class ModifiesEnsuresValidationTransformation
java.lang.Object
org.apache.groovy.contracts.ast.ModifiesEnsuresValidationTransformation
- All Implemented Interfaces:
ASTTransformation
Validates that
@Ensures postconditions on a method only reference
fields via old.xxx that are declared as modifiable by @Modifies.
Runs at CompilePhase.INSTRUCTION_SELECTION after both:
ModifiesASTTransformationhas stored the modification set, andAnnotationClosureVisitorhas recorded theoldreferences
- Since:
- 6.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvisit(ASTNode[] nodes, SourceUnit source) Validates thatoldreferences used by@Ensuresstay within the state declared by@Modifies.
-
Constructor Details
-
ModifiesEnsuresValidationTransformation
public ModifiesEnsuresValidationTransformation()
-
-
Method Details
-
visit
Validates thatoldreferences used by@Ensuresstay within the state declared by@Modifies.- Specified by:
visitin interfaceASTTransformation- Parameters:
nodes- the annotated AST nodes supplied by the compilersource- the current source unit
-