Class NoteSuppressedWarnings

    • Field Detail

      • packages

        private final java.util.Set<java.lang.String> packages
      • isRecord

        private boolean isRecord
        For records the header is compiled into fields, accessor methods and a canonical constructor. A SuppressWarnings annotation in the header is applied to the corresponding field, accessor method and parameter of the canonical constructor. In the end we want to report unnecessary suppressions, however when only one of the three suppressors is matched we do not want to report the two others as unnecessary. We link the suppressors together so we can detect whether at least one of them was matched in SuppressionMatcher.match(edu.umd.cs.findbugs.BugInstance)
      • visitingCanonicalRecordConstructor

        private boolean visitingCanonicalRecordConstructor
    • Constructor Detail

      • NoteSuppressedWarnings

        public NoteSuppressedWarnings​(BugReporter bugReporter)
    • Method Detail

      • visitClassContext

        public void visitClassContext​(ClassContext classContext)
        Description copied from interface: Detector
        Visit the ClassContext for a class which should be analyzed for instances of bug patterns.
        Specified by:
        visitClassContext in interface Detector
        Parameters:
        classContext - the ClassContext
      • visitField

        public void visitField​(org.apache.bcel.classfile.Field field)
        Specified by:
        visitField in interface org.apache.bcel.classfile.Visitor
        Overrides:
        visitField in class BetterVisitor
      • visitMethod

        public void visitMethod​(org.apache.bcel.classfile.Method method)
        Specified by:
        visitMethod in interface org.apache.bcel.classfile.Visitor
        Overrides:
        visitMethod in class BetterVisitor
      • isConstructor

        private static boolean isConstructor​(org.apache.bcel.classfile.Method method)
      • visitAfter

        public void visitAfter​(org.apache.bcel.classfile.JavaClass obj)
        Overrides:
        visitAfter in class PreorderVisitor
      • visitAnnotation

        public void visitAnnotation​(java.lang.String annotationClass,
                                    java.util.Map<java.lang.String,​org.apache.bcel.classfile.ElementValue> map,
                                    boolean runtimeVisible)
        Description copied from class: AnnotationVisitor
        Visit annotation on a class, field or method
        Overrides:
        visitAnnotation in class AnnotationVisitor
        Parameters:
        annotationClass - class of annotation
        map - map from names to values
        runtimeVisible - true if annotation is runtime visible
      • isSuppressWarnings

        public static boolean isSuppressWarnings​(java.lang.String annotationClass)
      • visitParameterAnnotation

        public void visitParameterAnnotation​(int p,
                                             java.lang.String annotationClass,
                                             java.util.Map<java.lang.String,​org.apache.bcel.classfile.ElementValue> map,
                                             boolean runtimeVisible)
        Description copied from class: AnnotationVisitor
        Visit annotation on a method parameter
        Overrides:
        visitParameterAnnotation in class AnnotationVisitor
        Parameters:
        p - parameter number, starting at zero ("this" parameter is not counted)
        annotationClass - class of annotation
        map - map from names to values
        runtimeVisible - true if annotation is runtime visible
      • suppressParameterWarning

        private void suppressParameterWarning​(int parameter,
                                              java.lang.String pattern,
                                              SuppressMatchType matchType)
      • suppressWarning

        private void suppressWarning​(java.lang.String pattern,
                                     SuppressMatchType matchType)
      • report

        public void report()
        Description copied from interface: Detector
        This method is called after all classes to be visited. It should be used by any detectors which accumulate information over all visited classes to generate results.
        Specified by:
        report in interface Detector