Class SameLenVisitor

All Implemented Interfaces:
TreeVisitor<Void,Void>

public class SameLenVisitor extends BaseTypeVisitor<SameLenAnnotatedTypeFactory>
  • Constructor Details

  • Method Details

    • commonAssignmentCheck

      protected boolean commonAssignmentCheck(AnnotatedTypeMirror varType, AnnotatedTypeMirror valueType, Tree valueTree, @CompilerMessageKey String errorKey, Object... extraArgs)
      Merges SameLen annotations, then calls super.

      Checks the validity of an assignment (or pseudo-assignment) from a value to a variable and emits an error message (through the compiler's messaging interface) if it is not valid.

      Overrides:
      commonAssignmentCheck in class BaseTypeVisitor<SameLenAnnotatedTypeFactory>
      Parameters:
      varType - the annotated type of the variable
      valueType - the annotated type of the value
      valueTree - the location to use when reporting the error message
      errorKey - the error message key to use if the check fails
      extraArgs - arguments to the error message key, before "found" and "expected" types
      Returns:
      true if the check succeeds, false if an error message was issued