Class ContractExecutionTracker

java.lang.Object
org.apache.groovy.contracts.generation.ContractExecutionTracker

public class ContractExecutionTracker extends Object
Keeps track of contract executions to avoid cyclic contract checks.
  • 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 name
      methodIdentifier - the executable identifier
      assertionType - the logical contract kind
      isStatic - whether the executable is static
      Returns:
      true if the execution was newly tracked, false if 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 name
      methodIdentifier - the executable identifier
      assertionType - the logical contract kind
      isStatic - whether the executable is static