Class CheckRelaxingNullnessAnnotation

java.lang.Object
org.objectweb.asm.ClassVisitor
org.objectweb.asm.tree.ClassNode
edu.umd.cs.findbugs.asm.ClassNodeDetector
edu.umd.cs.findbugs.detect.CheckRelaxingNullnessAnnotation
All Implemented Interfaces:
Detector2, Priorities

public class CheckRelaxingNullnessAnnotation extends ClassNodeDetector
Checks that overriding methods do not relax Nonnull (made CheckForNull) on return values or CheckForNull (made Nonnull) on parameters. The code accepts also old (deprecated) nullness annotations from edu.umd.cs.findbugs.annotations package.
  • Constructor Details

    • CheckRelaxingNullnessAnnotation

      public CheckRelaxingNullnessAnnotation(BugReporter bugReporter)
  • Method Details

    • visitMethod

      public org.objectweb.asm.MethodVisitor visitMethod(int methodAccess, String methodName, String desc, String methodSignature, String[] exceptions)
      Overrides:
      visitMethod in class org.objectweb.asm.tree.ClassNode
    • containsRelaxedNonNull

      static boolean containsRelaxedNonNull(@CheckForNull List<org.objectweb.asm.tree.AnnotationNode> methodAnnotations)
    • getNonnullOrNullableParams

      @CheckForNull static Map<Integer, NullnessAnnotation> getNonnullOrNullableParams(@CheckForNull List<org.objectweb.asm.tree.AnnotationNode>[] parameterAnnotations)
    • getNullness

      @CheckForNull static NullnessAnnotation getNullness(@SlashedClassName String annotationDesc)
    • containsNullness

      static boolean containsNullness(Collection<AnnotationValue> annotations, NullnessAnnotation nullness)
    • compatibleParameters

      static boolean compatibleParameters(String signature, String superSignature)
    • areRelated

      static boolean areRelated(String sig, String superSig)