Class DumbMethods
- All Implemented Interfaces:
Detector, Priorities, org.apache.bcel.classfile.Visitor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final classprivate final classprivate final classprivate final classprivate static enumprivate final classprivate final classprivate classprivate final classprivate final classNested classes/interfaces inherited from class OpcodeStackDetector
OpcodeStackDetector.WithCustomJumpInfo -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BugAccumulatorprivate final BugAccumulatorprivate final BugReporterprivate booleanprivate static final Stringprivate static final org.apache.bcel.generic.ObjectTypeprivate booleanprivate org.apache.bcel.classfile.CodeException[]private BugInstanceprivate intprivate boolean(package private) booleanprivate static final intprivate static final intA heuristic - how long a catch block for OutOfMemoryError might be.(package private) int(package private) BugInstance(package private) SourceLineAnnotation(package private) MethodDescriptorprivate intprivate booleanprivate Stringprivate intprivate DumbMethods.RandomNextIntStateprivate intprivate boolean(package private) booleanprivate intprivate final DumbMethods.SubDetector[]private final booleanFields inherited from class OpcodeStackDetector
stackFields inherited from class DismantleBytecode
codeBytes, lineNumberTable, M_BR, M_CP, M_INT, M_PAD, M_R, M_UINTFields inherited from interface Priorities
EXP_PRIORITY, HIGH_PRIORITY, IGNORE_PRIORITY, LOW_PRIORITY, NORMAL_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidprivate voidflush()Flush out cached state at the end of a method.private intprivate booleanisMonitorWait(String name, String sig) static booleanisTestMethod(org.apache.bcel.classfile.Method method) private voidreportVacuousBitOperation(int seen, OpcodeStack.Item item) voidsawOpcode(int seen) By default, this method will not be called when stack is TOP.private intstackEntryThatMustBeNonnegative(int seen) Return index of stack entry that must be non-negative.voidvisit(org.apache.bcel.classfile.Code obj) voidvisit(org.apache.bcel.classfile.Field field) voidvisit(org.apache.bcel.classfile.JavaClass obj) voidvisit(org.apache.bcel.classfile.Method method) voidvisitAfter(org.apache.bcel.classfile.JavaClass obj) Methods inherited from class OpcodeStackDetector
afterOpcode, beforeOpcode, getStack, isUsingCustomUserValue, visitCodeMethods inherited from class BytecodeScanningDetector
getClassContext, report, shouldVisitCode, visitClassContextMethods inherited from class DismantleBytecode
areOppositeBranches, atCatchBlock, getBranchFallThrough, getBranchOffset, getBranchTarget, getClassConstantOperand, getClassDescriptorOperand, getCodeByte, getConstantRefOperand, getDefaultSwitchOffset, getDottedClassConstantOperand, getFieldDescriptorOperand, getIntConstant, getLongConstant, getMaxPC, getMethodDescriptorOperand, getNameConstantOperand, getNextCodeByte, getNextOpcode, getNextPC, getOpcode, getPC, getPrevOpcode, getRefConstantOperand, getRefFieldIsStatic, getRegisterOperand, getSigConstantOperand, getStringConstantOperand, getSwitchLabels, getSwitchOffsets, getXClassOperand, getXFieldOperand, getXMethodOperand, isBranch, isMethodCall, isRegisterLoad, isRegisterStore, isRegisterStore, isReturn, isShift, isSwitch, isWideOpcode, printOpCode, sawBranchTo, sawClass, sawDouble, sawField, sawFloat, sawIMethod, sawInt, sawLong, sawMethod, sawRegister, sawStringMethods inherited from class AnnotationVisitor
getAnnotationParameterAsEnum, getAnnotationParameterAsString, getAnnotationParameterAsStringArray, visitAnnotation, visitAnnotation, visitParameterAnnotation, visitParameterAnnotation, visitSyntheticParameterAnnotationMethods inherited from class PreorderVisitor
amVisitingMainMethod, asUnsignedByte, doVisitMethod, getClassDescriptor, getClassName, getCode, getConstantPool, getDottedClassName, getDottedFieldSig, getDottedMethodSig, getDottedSuperclassName, getField, getFieldDescriptor, getFieldIsStatic, getFieldName, getFieldSig, getFullyQualifiedFieldName, getFullyQualifiedMethodName, getMethod, getMethodDescriptor, getMethodName, getMethodSig, getMethodVisitOrder, getNumberArguments, getNumberMethodArguments, getPackageName, getSizeOfSurroundingTryBlock, getSizeOfSurroundingTryBlock, getSourceFile, getStringFromIndex, getSuperclassName, getSurroundingCaughtExceptions, getSurroundingCaughtExceptions, getSurroundingCaughtExceptionTypes, getSurroundingTryBlock, getSurroundingTryBlock, getThisClass, getXClass, getXField, getXMethod, hasInterestingClass, hasInterestingMethod, isVisitMethodsInCallOrder, setupVisitorForClass, setVisitMethodsInCallOrder, shouldVisit, toString, visitAfter, visitAnnotationDefault, visitAnnotationEntry, visitBootstrapMethods, visitConstantInvokeDynamic, visitConstantMethodHandle, visitConstantMethodType, visitConstantModule, visitConstantPackage, visitConstantPool, visitEnclosingMethod, visitingField, visitingMethod, visitInnerClasses, visitJavaClass, visitLineNumberTable, visitLocalVariableTable, visitMethodParameters, visitParameterAnnotationEntry, visitStackMap, visitStackMapEntryMethods inherited from class BetterVisitor
clone, report, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitCodeException, visitConstantClass, visitConstantDouble, visitConstantFieldref, visitConstantFloat, visitConstantInteger, visitConstantInterfaceMethodref, visitConstantLong, visitConstantMethodref, visitConstantNameAndType, visitConstantString, visitConstantUtf8, visitConstantValue, visitDeprecated, visitExceptionTable, visitField, visitInnerClass, visitLineNumber, visitLocalVariable, visitLocalVariableTypeTable, visitMethod, visitSignature, visitSourceFile, visitSynthetic, visitUnknownMethods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.bcel.classfile.Visitor
visitConstantDynamic, visitMethodParameter, visitModule, visitModuleExports, visitModuleMainClass, visitModuleOpens, visitModulePackages, visitModuleProvides, visitModuleRequires, visitNestHost, visitNestMembers, visitRecord, visitRecordComponent, visitStackMapType
-
Field Details
-
CLASS_NAME_RANDOM
- See Also:
-
subDetectors
-
CONDITION_TYPE
private static final org.apache.bcel.generic.ObjectType CONDITION_TYPE -
bugReporter
-
sawCurrentTimeMillis
private boolean sawCurrentTimeMillis -
gcInvocationBugReport
-
gcInvocationPC
private int gcInvocationPC -
exceptionTable
private org.apache.bcel.classfile.CodeException[] exceptionTable -
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
-
randomNextIntRegister
private int randomNextIntRegister -
checkForBitIorofSignedByte
private boolean checkForBitIorofSignedByte -
OOM_CATCH_LEN
private static final int OOM_CATCH_LENA heuristic - how long a catch block for OutOfMemoryError might be.- See Also:
-
testingEnabled
private final boolean testingEnabled -
accumulator
-
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
-
-
Method Details
-
visit
public void visit(org.apache.bcel.classfile.JavaClass obj) - Overrides:
visitin classBetterVisitor
-
visitAfter
public void visitAfter(org.apache.bcel.classfile.JavaClass obj) - Overrides:
visitAfterin classPreorderVisitor
-
isTestMethod
public static boolean isTestMethod(org.apache.bcel.classfile.Method method) -
visit
public void visit(org.apache.bcel.classfile.Field field) - Overrides:
visitin classBetterVisitor
-
visit
public void visit(org.apache.bcel.classfile.Method method) - Overrides:
visitin classBetterVisitor
-
sawOpcode
public void sawOpcode(int seen) Description copied from class:OpcodeStackDetectorBy 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:
sawOpcodein classOpcodeStackDetector- See Also:
-
checkForCompatibleLongComparison
-
reportVacuousBitOperation
- Parameters:
seen-item-
-
stackEntryThatMustBeNonnegative
private int stackEntryThatMustBeNonnegative(int seen) Return index of stack entry that must be non-negative. Return -1 if no stack entry is required to be non-negative. -
getStackEntryOfListCallThatMustBeNonnegative
private int getStackEntryOfListCallThatMustBeNonnegative() -
checkMonitorWait
private void checkMonitorWait() -
isMonitorWait
-
visit
public void visit(org.apache.bcel.classfile.Code obj) - Overrides:
visitin classDismantleBytecode
-
flush
private void flush()Flush out cached state at the end of a method.
-