Class OffsetDependentTypesHelper

java.lang.Object
org.checkerframework.framework.util.dependenttypes.DependentTypesHelper
org.checkerframework.checker.index.OffsetDependentTypesHelper

public class OffsetDependentTypesHelper extends DependentTypesHelper
Dependent type helper for array offset expressions. Each array offset expression may be the addition or subtraction of several Java expressions. For example, array.length - 1.
  • Constructor Details

  • Method Details

    • transform

      protected @Nullable JavaExpression transform(JavaExpression javaExpr)
      Description copied from class: DependentTypesHelper
      This method is for subclasses to override to change JavaExpressions in some way before they are inserted into new annotations. This method is called after parsing and viewpoint-adaptation have occurred. javaExpr may be a DependentTypesHelper.PassThroughExpression.

      If null is returned then the expression is not added to the new annotation.

      The default implementation returns the argument, but subclasses may override it.

      Overrides:
      transform in class DependentTypesHelper
      Parameters:
      javaExpr - a JavaExpression
      Returns:
      a transformed JavaExpression or null if no transformation exists
    • createDependentTypesTreeAnnotator

      public TreeAnnotator createDependentTypesTreeAnnotator()
      Description copied from class: DependentTypesHelper
      Creates a TreeAnnotator that viewpoint-adapts dependent type annotations.
      Overrides:
      createDependentTypesTreeAnnotator in class DependentTypesHelper
      Returns:
      a new TreeAnnotator that viewpoint-adapts dependent type annotations