Class NoteSuppressedWarnings
java.lang.Object
edu.umd.cs.findbugs.visitclass.BetterVisitor
edu.umd.cs.findbugs.visitclass.PreorderVisitor
edu.umd.cs.findbugs.visitclass.AnnotationVisitor
edu.umd.cs.findbugs.detect.NoteSuppressedWarnings
- All Implemented Interfaces:
Detector, FirstPassDetector, NonReportingDetector, Priorities, org.apache.bcel.classfile.Visitor
public class NoteSuppressedWarnings
extends AnnotationVisitor
implements Detector, NonReportingDetector
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanFor records the header is compiled into fields, accessor methods and a canonical constructor.private final List<NoteSuppressedWarnings.RecordComponentSuppressors> private final Map<String, NoteSuppressedWarnings.RecordComponentSuppressors> private final SuppressionMatcherprivate booleanFields inherited from interface Priorities
EXP_PRIORITY, HIGH_PRIORITY, IGNORE_PRIORITY, LOW_PRIORITY, NORMAL_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanisConstructor(org.apache.bcel.classfile.Method method) static booleanisSuppressWarnings(String annotationClass) voidreport()This method is called after all classes to be visited.private voidsuppressParameterWarning(int parameter, String pattern, SuppressMatchType matchType) private voidsuppressWarning(String pattern, SuppressMatchType matchType) voidvisitAfter(org.apache.bcel.classfile.JavaClass obj) voidvisitAnnotation(String annotationClass, Map<String, org.apache.bcel.classfile.ElementValue> map, boolean runtimeVisible) Visit annotation on a class, field or methodvoidvisitClassContext(ClassContext classContext) Visit the ClassContext for a class which should be analyzed for instances of bug patterns.voidvisitField(org.apache.bcel.classfile.Field field) voidvisitMethod(org.apache.bcel.classfile.Method method) voidvisitParameterAnnotation(int p, String annotationClass, Map<String, org.apache.bcel.classfile.ElementValue> map, boolean runtimeVisible) Visit annotation on a method parameterMethods inherited from class AnnotationVisitor
getAnnotationParameterAsEnum, getAnnotationParameterAsString, getAnnotationParameterAsStringArray, visitAnnotation, visitParameterAnnotation, visitSyntheticParameterAnnotationMethods inherited from class PreorderVisitor
amVisitingMainMethod, asUnsignedByte, doVisitMethod, getClassDescriptor, getClassName, getCode, getConstantPool, getDottedClassName, getDottedFieldSig, getDottedMethodSig, getDottedSuperclassName, getField, getFieldDescriptor, getFieldIsStatic, getFieldName, getFieldSig, getFullyQualifiedFieldName, getFullyQualifiedMethodName, getMethod, getMethodDescriptor, getMethodName, getMethodSig, getMethodVisitOrder, getNumberArguments, getNumberMethodArguments, getPackageName, getSizeOfSurroundingTryBlock, getSizeOfSurroundingTryBlock, getSourceFile, getStringFromIndex, getSuperclassName, getSurroundingCaughtExceptions, getSurroundingCaughtExceptions, getSurroundingCaughtExceptionTypes, getSurroundingTryBlock, getSurroundingTryBlock, getThisClass, getXClass, getXField, getXMethod, hasInterestingClass, hasInterestingMethod, isVisitMethodsInCallOrder, setupVisitorForClass, setVisitMethodsInCallOrder, shouldVisit, toString, visitAfter, visitAnnotationDefault, visitAnnotationEntry, visitBootstrapMethods, visitCode, visitConstantInvokeDynamic, visitConstantMethodHandle, visitConstantMethodType, visitConstantModule, visitConstantPackage, visitConstantPool, visitEnclosingMethod, visitingField, visitingMethod, visitInnerClasses, visitJavaClass, visitLineNumberTable, visitLocalVariableTable, visitMethodParameters, visitParameterAnnotationEntry, visitStackMap, visitStackMapEntryMethods inherited from class BetterVisitor
clone, report, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitCodeException, visitConstantClass, visitConstantDouble, visitConstantFieldref, visitConstantFloat, visitConstantInteger, visitConstantInterfaceMethodref, visitConstantLong, visitConstantMethodref, visitConstantNameAndType, visitConstantString, visitConstantUtf8, visitConstantValue, visitDeprecated, visitExceptionTable, visitInnerClass, visitLineNumber, visitLocalVariable, visitLocalVariableTypeTable, visitSignature, visitSourceFile, visitSynthetic, visitUnknownMethods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.bcel.classfile.Visitor
visitConstantDynamic, visitMethodParameter, visitModule, visitModuleExports, visitModuleMainClass, visitModuleOpens, visitModulePackages, visitModuleProvides, visitModuleRequires, visitNestHost, visitNestMembers, visitRecord, visitRecordComponent, visitStackMapType
-
Field Details
-
packages
-
isRecord
private boolean isRecordFor records the header is compiled into fields, accessor methods and a canonical constructor. ASuppressWarningsannotation 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 inSuppressionMatcher.match(edu.umd.cs.findbugs.BugInstance) -
visitingCanonicalRecordConstructor
private boolean visitingCanonicalRecordConstructor -
recordComponents
-
recordComponentsByName
-
suppressionMatcher
-
-
Constructor Details
-
NoteSuppressedWarnings
-
-
Method Details
-
visitClassContext
Description copied from interface:DetectorVisit the ClassContext for a class which should be analyzed for instances of bug patterns.- Specified by:
visitClassContextin interfaceDetector- Parameters:
classContext- the ClassContext
-
visitField
public void visitField(org.apache.bcel.classfile.Field field) - Specified by:
visitFieldin interfaceorg.apache.bcel.classfile.Visitor- Overrides:
visitFieldin classBetterVisitor
-
visitMethod
public void visitMethod(org.apache.bcel.classfile.Method method) - Specified by:
visitMethodin interfaceorg.apache.bcel.classfile.Visitor- Overrides:
visitMethodin classBetterVisitor
-
isConstructor
private static boolean isConstructor(org.apache.bcel.classfile.Method method) -
visitAfter
public void visitAfter(org.apache.bcel.classfile.JavaClass obj) - Overrides:
visitAfterin classPreorderVisitor
-
visitAnnotation
public void visitAnnotation(String annotationClass, Map<String, org.apache.bcel.classfile.ElementValue> map, boolean runtimeVisible) Description copied from class:AnnotationVisitorVisit annotation on a class, field or method- Overrides:
visitAnnotationin classAnnotationVisitor- Parameters:
annotationClass- class of annotationmap- map from names to valuesruntimeVisible- true if annotation is runtime visible
-
isSuppressWarnings
-
visitParameterAnnotation
public void visitParameterAnnotation(int p, String annotationClass, Map<String, org.apache.bcel.classfile.ElementValue> map, boolean runtimeVisible) Description copied from class:AnnotationVisitorVisit annotation on a method parameter- Overrides:
visitParameterAnnotationin classAnnotationVisitor- Parameters:
p- parameter number, starting at zero ("this" parameter is not counted)annotationClass- class of annotationmap- map from names to valuesruntimeVisible- true if annotation is runtime visible
-
suppressParameterWarning
-
suppressWarning
-
report
-