Class 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 Detail

      • CheckRelaxingNullnessAnnotation

        public CheckRelaxingNullnessAnnotation​(BugReporter bugReporter)
    • Method Detail

      • visitMethod

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

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

        @CheckForNull
        static java.util.Map<java.lang.Integer,​NullnessAnnotation> getNonnullOrNullableParams​(@CheckForNull
                                                                                                    java.util.List<org.objectweb.asm.tree.AnnotationNode>[] parameterAnnotations)
      • compatibleParameters

        static boolean compatibleParameters​(java.lang.String signature,
                                            java.lang.String superSignature)
      • areRelated

        static boolean areRelated​(java.lang.String sig,
                                  java.lang.String superSig)