Class NullnessAnnotations

java.lang.Object
com.google.errorprone.dataflow.nullnesspropagation.NullnessAnnotations

public class NullnessAnnotations extends Object
Utilities to extract Nullness from annotations.
  • Method Details

    • fromAnnotationTrees

      public static Optional<Nullness> fromAnnotationTrees(List<? extends com.sun.source.tree.AnnotationTree> annotations)
    • fromAnnotationMirrors

      public static Optional<Nullness> fromAnnotationMirrors(List<? extends AnnotationMirror> annotations)
    • annotationsAreAmbiguous

      public static boolean annotationsAreAmbiguous(Collection<? extends AnnotationMirror> annotations)
    • annotationsRelevantToNullness

      public static com.google.common.collect.ImmutableList<com.sun.source.tree.AnnotationTree> annotationsRelevantToNullness(List<? extends com.sun.source.tree.AnnotationTree> annotations)
    • fromAnnotationsOn

      public static Optional<Nullness> fromAnnotationsOn(@Nullable com.sun.tools.javac.code.Symbol sym)
    • fromAnnotationsOn

      public static Optional<Nullness> fromAnnotationsOn(@Nullable TypeMirror type)
    • fromDefaultAnnotations

      public static Optional<Nullness> fromDefaultAnnotations(@Nullable Element sym)
      Walks the syntactically enclosing elements of the given element until it finds a defaulting annotation.
    • getUpperBound

      public static Optional<Nullness> getUpperBound(TypeVariable typeVar)
      Returns any declared or implied bound for the given type variable, meaning this returns any annotation on the given type variable and otherwise returns fromDefaultAnnotations(javax.lang.model.element.Element) to find any default in scope of the given type variable.