Class UnreadFields

All Implemented Interfaces:
Detector, Priorities, org.apache.bcel.classfile.Visitor

public class UnreadFields extends OpcodeStackDetector
  • Constructor Details

    • UnreadFields

      public UnreadFields(BugReporter bugReporter)
  • Method Details

    • visit

      public void visit(org.apache.bcel.classfile.JavaClass obj)
      Overrides:
      visit in class BetterVisitor
    • classHasParameter

      public static boolean classHasParameter(org.apache.bcel.classfile.JavaClass obj)
    • visitAfter

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

      public void visit(org.apache.bcel.classfile.Field obj)
      Overrides:
      visit in class BetterVisitor
    • isSeleniumWebElement

      public static boolean isSeleniumWebElement(String signature)
    • visitAnnotation

      public void visitAnnotation(String annotationClass, Map<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
    • isInjectionAttribute

      public static boolean isInjectionAttribute(@DottedClassName String annotationClass)
    • visit

      public void visit(org.apache.bcel.classfile.ConstantValue obj)
      Overrides:
      visit in class BetterVisitor
    • visit

      public void visit(org.apache.bcel.classfile.Code obj)
      Overrides:
      visit in class DismantleBytecode
    • visit

      public void visit(org.apache.bcel.classfile.Method obj)
      Overrides:
      visit in class BetterVisitor
    • sawOpcode

      public void sawOpcode(int seen)
      Description copied from class: OpcodeStackDetector

      By default, this method will not be called when stack is TOP. To change this behavior, override #beforeOpcode(int) and change to return true even if stack is TOP.

      see Using FindBugs for Research to learn lattice and what TOP means.

      Specified by:
      sawOpcode in class OpcodeStackDetector
      See Also:
    • 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
      Overrides:
      report in class BytecodeScanningDetector
    • containsSpecialAnnotation

      public static boolean containsSpecialAnnotation(Collection<AnnotationValue> annotationsToCheck)
      Checks whether the collection of annotations associated with a given element include annotations that indicate the "URF_UNREAD_FIELD" detector should be skipped.
      Parameters:
      annotationsToCheck - Collections of annotations associated with given element.
      Returns:
      If true, "URF_UNREAD_FIELD" detector should be ignored for given field.
      See Also: