Class ContractExecutionTracker
java.lang.Object
org.apache.groovy.contracts.generation.ContractExecutionTracker
Keeps track of contract executions to avoid cyclic contract checks.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classIdentifies one contract execution so recursive re-entry can be suppressed. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidRemoves a previously tracked contract execution from the current thread.static booleanAttempts to register a contract execution for the current thread.
-
Constructor Details
-
ContractExecutionTracker
public ContractExecutionTracker()
-
-
Method Details
-
track
public static boolean track(String className, String methodIdentifier, String assertionType, boolean isStatic) Attempts to register a contract execution for the current thread.- Parameters:
className- the declaring class namemethodIdentifier- the executable identifierassertionType- the logical contract kindisStatic- whether the executable is static- Returns:
trueif the execution was newly tracked,falseif it was already active
-
clear
public static void clear(String className, String methodIdentifier, String assertionType, boolean isStatic) Removes a previously tracked contract execution from the current thread.- Parameters:
className- the declaring class namemethodIdentifier- the executable identifierassertionType- the logical contract kindisStatic- whether the executable is static
-