Class KeyForVisitor.KeyForOverrideChecker

java.lang.Object
org.checkerframework.common.basetype.OverrideChecker
org.checkerframework.checker.nullness.KeyForVisitor.KeyForOverrideChecker
Enclosing class:
KeyForVisitor

protected class KeyForVisitor.KeyForOverrideChecker extends OverrideChecker
An override checker that does not check the lower bounds of an overriding method's type parameters.

The default for lower bounds is @UnknownKeyFor, except in java.* packages, where it is @KeyForBottom. Checking lower bounds would therefore require an annotation on the type parameter of every method that overrides a generic JDK method, such as Collection.toArray(T[]).

See the Checker Framework Manual:
Default for lower bounds
  • Constructor Details

  • Method Details

    • checkTypeParameterLowerBound

      protected boolean checkTypeParameterLowerBound(int index)
      Description copied from class: OverrideChecker
      Issues an error if the lower bound of the overriding method's type parameter at the given index is not a subtype of the lower bound of the overridden method's type parameter.
      Overrides:
      checkTypeParameterLowerBound in class OverrideChecker
      Parameters:
      index - the index of the type parameter
      Returns:
      true if the lower bound is correct