Class DateFormatStringChecker

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

public class DateFormatStringChecker extends OpcodeStackDetector
  • Field Details

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