Class FindRoughConstants

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

public class FindRoughConstants extends BytecodeScanningDetector
  • Field Details

  • Constructor Details

    • FindRoughConstants

      public FindRoughConstants(BugReporter bugReporter)
  • Method Details

    • 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
      Overrides:
      visitClassContext in class BytecodeScanningDetector
      Parameters:
      classContext - the ClassContext
    • visitAfter

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

      public void sawOpcode(int seen)
      Overrides:
      sawOpcode in class DismantleBytecode
    • hasInterestingConstant

      private boolean hasInterestingConstant(org.apache.bcel.classfile.ConstantPool cp)
    • isInteresting

      private boolean isInteresting(Number constValue, double candidate)
    • getPriority

      private int getPriority(FindRoughConstants.BadConstant badConstant, Number constValue, double candidate)
    • checkConst

      private void checkConst(Number constValue)