Package: org.apache.groovy.contracts.ast

## [Java] Class MethodVariantASTTransformation

- org.apache.groovy.contracts.ast.MethodVariantASTTransformation

- All Implemented Interfaces and Traits:
    ASTTransformation

      public class MethodVariantASTTransformation
      extends Object
      implements ASTTransformation

  Handles a Decreases annotation placed on a method (the loop case is handled by LoopVariantASTTransformation). The closure is a termination measure over the method's parameters that must strictly decrease, and stay non-negative, on every recursive re-entry.

  The method body is wrapped so that, conceptually:

       def $m   = <measure>
       def $prev = MethodVariantSupport.enter("<key>", $m)   // checks decrease vs the enclosing frame
       try { <original body> } finally { MethodVariantSupport.exit("<key>", $prev) }

  The check is pure entry/exit bookkeeping keyed by method signature, so no static analysis of recursive call sites is needed.
  Since:
    6.0.0
  See Also:
    Decreases
    MethodVariantSupport

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `visit(ASTNode[] nodes, SourceUnit source)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### public void visit(ASTNode[] nodes, SourceUnit source)