Class DumbMethods

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

public class DumbMethods extends OpcodeStackDetector
  • Field Details

    • CLASS_NAME_RANDOM

      @SlashedClassName private static final String CLASS_NAME_RANDOM
      See Also:
    • subDetectors

      private final DumbMethods.SubDetector[] subDetectors
    • CONDITION_TYPE

      private static final org.apache.bcel.generic.ObjectType CONDITION_TYPE
    • bugReporter

      private final BugReporter bugReporter
    • sawCurrentTimeMillis

      private boolean sawCurrentTimeMillis
    • gcInvocationBugReport

      private BugInstance gcInvocationBugReport
    • gcInvocationPC

      private int gcInvocationPC
    • exceptionTable

      private org.apache.bcel.classfile.CodeException[] exceptionTable
    • primitiveObjCtorSeen

      private String primitiveObjCtorSeen
    • ctorSeen

      private boolean ctorSeen
    • prevOpcodeWasReadLine

      private boolean prevOpcodeWasReadLine
    • prevOpcode

      private int prevOpcode
    • isPublicStaticVoidMain

      private boolean isPublicStaticVoidMain
    • sawCheckForNonNegativeSignedByte

      private int sawCheckForNonNegativeSignedByte
    • sinceBufferedInputStreamReady

      private int sinceBufferedInputStreamReady
    • randomNextIntState

      private int randomNextIntState
    • checkForBitIorofSignedByte

      private boolean checkForBitIorofSignedByte
    • OOM_CATCH_LEN

      private static final int OOM_CATCH_LEN
      A heuristic - how long a catch block for OutOfMemoryError might be.
      See Also:
    • testingEnabled

      private final boolean testingEnabled
    • accumulator

      private final BugAccumulator accumulator
    • absoluteValueAccumulator

      private final BugAccumulator absoluteValueAccumulator
    • MICROS_PER_DAY_OVERFLOWED_AS_INT

      private static final int MICROS_PER_DAY_OVERFLOWED_AS_INT
      See Also:
    • isSynthetic

      boolean isSynthetic
    • opcodesSincePendingAbsoluteValueBug

      int opcodesSincePendingAbsoluteValueBug
    • pendingAbsoluteValueBug

      BugInstance pendingAbsoluteValueBug
    • pendingAbsoluteValueBugSourceLine

      SourceLineAnnotation pendingAbsoluteValueBugSourceLine
    • sawLoadOfMinValue

      boolean sawLoadOfMinValue
    • previousMethodCall

      MethodDescriptor previousMethodCall
  • Constructor Details

    • DumbMethods

      public DumbMethods(BugReporter bugReporter)
  • Method Details

    • visit

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

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

      public static boolean isTestMethod(org.apache.bcel.classfile.Method method)
    • visit

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

      public void visit(org.apache.bcel.classfile.Method method)
      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:
    • checkForCompatibleLongComparison

      private void checkForCompatibleLongComparison(OpcodeStack.Item left, OpcodeStack.Item right)
    • reportVacuousBitOperation

      private void reportVacuousBitOperation(int seen, OpcodeStack.Item item)
      Parameters:
      seen -
      item -
    • stackEntryThatMustBeNonnegative

      private int stackEntryThatMustBeNonnegative(int seen)
      Return index of stack entry that must be nonnegative. Return -1 if no stack entry is required to be nonnegative.
    • getStackEntryOfListCallThatMustBeNonnegative

      private int getStackEntryOfListCallThatMustBeNonnegative()
    • checkMonitorWait

      private void checkMonitorWait()
    • isMonitorWait

      private boolean isMonitorWait(String name, String sig)
    • visit

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

      private void flush()
      Flush out cached state at the end of a method.