Class DateFormatStringChecker

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

public class DateFormatStringChecker extends OpcodeStackDetector
  • Field Details

    • bugPcMap

      private final BugPcMap bugPcMap
  • Constructor Details

    • DateFormatStringChecker

      public DateFormatStringChecker(BugReporter bugReporter)
  • Method Details

    • 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:
    • visitAfter

      public void visitAfter(org.apache.bcel.classfile.Code obj)
      Description copied from class: PreorderVisitor
      Called after visiting a code attribute
      Overrides:
      visitAfter in class PreorderVisitor
      Parameters:
      obj - Code that was just visited
    • runDateFormatRuleVerify

      private boolean runDateFormatRuleVerify(String dateFormat)
      Runs the check per each bad combination (Rule objects) on the provided string.
      Parameters:
      dateFormat - - string to be checked
      Returns:
      true if given string matches any bad combination.
    • removeNonInterpretedText

      protected String removeNonInterpretedText(String dateFormat)