Class CollectionToArrayHeuristics

java.lang.Object
org.checkerframework.checker.nullness.CollectionToArrayHeuristics

public class CollectionToArrayHeuristics extends Object
Determines the nullness type of calls to Collection.toArray().
See the Checker Framework Manual:
Nullness and conversions from collections to arrays, Constant Value Checker
  • Constructor Details

    • CollectionToArrayHeuristics

      public CollectionToArrayHeuristics(BaseTypeChecker checker, NullnessAnnotatedTypeFactory factory)
      Create a CollectionToArrayHeuristics.
      Parameters:
      checker - the checker, used for issuing diagnostic messages
      factory - the type factory
  • Method Details

    • handle

      If the method invocation is a call to toArray, then it manipulates the returned type of method arg to contain the appropriate nullness. Otherwise, it does nothing.
      Parameters:
      tree - method invocation tree
      method - invoked method type