Package edu.umd.cs.findbugs.detect
Class DumbMethods
- All Implemented Interfaces:
Detector
,Priorities
,org.apache.bcel.classfile.Visitor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final class
private final class
private final class
private final class
private final class
private final class
private class
private final class
private final class
Nested classes/interfaces inherited from class edu.umd.cs.findbugs.bcel.OpcodeStackDetector
OpcodeStackDetector.WithCustomJumpInfo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BugAccumulator
private final BugAccumulator
private final BugReporter
private boolean
private static final String
private static final org.apache.bcel.generic.ObjectType
private boolean
private org.apache.bcel.classfile.CodeException[]
private BugInstance
private int
private boolean
(package private) boolean
private static final int
private static final int
A heuristic - how long a catch block for OutOfMemoryError might be.(package private) int
(package private) BugInstance
(package private) SourceLineAnnotation
(package private) MethodDescriptor
private int
private boolean
private String
private int
private int
private boolean
(package private) boolean
private int
private final DumbMethods.SubDetector[]
private final boolean
Fields inherited from class edu.umd.cs.findbugs.bcel.OpcodeStackDetector
stack
Fields inherited from class edu.umd.cs.findbugs.visitclass.DismantleBytecode
codeBytes, lineNumberTable, M_BR, M_CP, M_INT, M_PAD, M_R, M_UINT
Fields inherited from interface edu.umd.cs.findbugs.Priorities
EXP_PRIORITY, HIGH_PRIORITY, IGNORE_PRIORITY, LOW_PRIORITY, NORMAL_PRIORITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
private void
flush()
Flush out cached state at the end of a method.private int
private boolean
isMonitorWait
(String name, String sig) static boolean
isTestMethod
(org.apache.bcel.classfile.Method method) private void
reportVacuousBitOperation
(int seen, OpcodeStack.Item item) void
sawOpcode
(int seen) By default, this method will not be called when stack is TOP.private int
stackEntryThatMustBeNonnegative
(int seen) Return index of stack entry that must be nonnegative.void
visit
(org.apache.bcel.classfile.Code obj) void
visit
(org.apache.bcel.classfile.Field field) void
visit
(org.apache.bcel.classfile.JavaClass obj) void
visit
(org.apache.bcel.classfile.Method method) void
visitAfter
(org.apache.bcel.classfile.JavaClass obj) Methods inherited from class edu.umd.cs.findbugs.bcel.OpcodeStackDetector
afterOpcode, beforeOpcode, getStack, isUsingCustomUserValue, visitCode
Methods inherited from class edu.umd.cs.findbugs.BytecodeScanningDetector
getClassContext, report, shouldVisitCode, visitClassContext
Methods inherited from class edu.umd.cs.findbugs.visitclass.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, sawString
Methods inherited from class edu.umd.cs.findbugs.visitclass.AnnotationVisitor
getAnnotationParameterAsString, getAnnotationParameterAsStringArray, visitAnnotation, visitAnnotation, visitParameterAnnotation, visitParameterAnnotation, visitSyntheticParameterAnnotation
Methods inherited from class edu.umd.cs.findbugs.visitclass.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, visitStackMapEntry
Methods inherited from class edu.umd.cs.findbugs.visitclass.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, visitUnknown
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.bcel.classfile.Visitor
visitConstantDynamic, visitMethodParameter, visitModule, visitModuleExports, visitModuleMainClass, visitModuleOpens, visitModulePackages, visitModuleProvides, visitModuleRequires, visitNestHost, visitNestMembers, 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
private int randomNextIntState -
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:
visit
in classBetterVisitor
-
visitAfter
public void visitAfter(org.apache.bcel.classfile.JavaClass obj) - Overrides:
visitAfter
in classPreorderVisitor
-
isTestMethod
public static boolean isTestMethod(org.apache.bcel.classfile.Method method) -
visit
public void visit(org.apache.bcel.classfile.Field field) - Overrides:
visit
in classBetterVisitor
-
visit
public void visit(org.apache.bcel.classfile.Method method) - Overrides:
visit
in classBetterVisitor
-
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 classOpcodeStackDetector
- See Also:
-
checkForCompatibleLongComparison
-
reportVacuousBitOperation
- 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
-
visit
public void visit(org.apache.bcel.classfile.Code obj) - Overrides:
visit
in classDismantleBytecode
-
flush
private void flush()Flush out cached state at the end of a method.
-