Package edu.umd.cs.findbugs.detect
Class WrongMapIterator
- All Implemented Interfaces:
Detector
,Priorities
,StatelessDetector
,Cloneable
,org.apache.bcel.classfile.Visitor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) final class
(package private) static enum
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BugAccumulator
private static final int
private int
private int
private int
private WrongMapIterator.LoadedVariable
private boolean
private WrongMapIterator.LoadedVariable
private static final Set
<MethodDescriptor> (package private) final WrongMapIterator.LoadedVariable
private static final int
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
handleStore
(int register) private int
handleStore
(int storeRegister, int current) private static boolean
Determine from the class descriptor for a variable whether that variable implements java.util.Map.private void
removedFromStack
(boolean includeKey) private void
reset()
void
sawOpcode
(int seen) void
visit
(org.apache.bcel.classfile.Code code) void
visit
(org.apache.bcel.classfile.Method obj) void
visitClassContext
(ClassContext classContext) Visit the ClassContext for a class which should be analyzed for instances of bug patterns.Methods inherited from class edu.umd.cs.findbugs.BytecodeScanningDetector
getClassContext, report, shouldVisitCode
Methods inherited from class edu.umd.cs.findbugs.visitclass.DismantleBytecode
afterOpcode, areOppositeBranches, atCatchBlock, beforeOpcode, 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
getAnnotationParameterAsEnum, 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, visitAfter, visitAnnotationDefault, visitAnnotationEntry, visitBootstrapMethods, visitCode, 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, 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 edu.umd.cs.findbugs.StatelessDetector
clone
Methods inherited from interface org.apache.bcel.classfile.Visitor
visitConstantDynamic, visitMethodParameter, visitModule, visitModuleExports, visitModuleMainClass, visitModuleOpens, visitModulePackages, visitModuleProvides, visitModuleRequires, visitNestHost, visitNestMembers, visitRecord, visitRecordComponent, visitStackMapType
-
Field Details
-
methods
-
NONE
-
bugAccumulator
-
NOT_FOUND
private static final int NOT_FOUND- See Also:
-
IN_STACK
private static final int IN_STACK- See Also:
-
loadedVariable
-
mapVariable
-
keySetRegister
private int keySetRegister -
iteratorRegister
private int iteratorRegister -
keyRegister
private int keyRegister -
mapAndKeyLoaded
private boolean mapAndKeyLoaded
-
-
Constructor Details
-
WrongMapIterator
-
-
Method Details
-
visitClassContext
Description copied from interface:Detector
Visit the ClassContext for a class which should be analyzed for instances of bug patterns.- Specified by:
visitClassContext
in interfaceDetector
- Overrides:
visitClassContext
in classBytecodeScanningDetector
- Parameters:
classContext
- the ClassContext
-
visit
public void visit(org.apache.bcel.classfile.Method obj) - Overrides:
visit
in classBetterVisitor
-
reset
private void reset() -
visit
public void visit(org.apache.bcel.classfile.Code code) - Overrides:
visit
in classDismantleBytecode
-
implementsMap
Determine from the class descriptor for a variable whether that variable implements java.util.Map.- Parameters:
d
- class descriptor for variable we want to check implements Map- Returns:
- true iff the descriptor corresponds to an implementor of Map
-
handleStore
private int handleStore(int storeRegister, int current) -
handleStore
private void handleStore(int register) -
removedFromStack
private void removedFromStack(boolean includeKey) -
sawOpcode
public void sawOpcode(int seen) - Overrides:
sawOpcode
in classDismantleBytecode
-