Package edu.umd.cs.findbugs.ba
Class TargetEnumeratingVisitor
java.lang.Object
org.apache.bcel.generic.EmptyVisitor
edu.umd.cs.findbugs.ba.TargetEnumeratingVisitor
- All Implemented Interfaces:
EdgeTypes
,org.apache.bcel.generic.Visitor
public class TargetEnumeratingVisitor
extends org.apache.bcel.generic.EmptyVisitor
implements EdgeTypes
Visitor to find all of the targets of an instruction whose InstructionHandle
is given. Note that we don't consider exception edges.
- Author:
- David Hovemeyer, Chadd Williams
-
Field Summary
Fields inherited from interface edu.umd.cs.findbugs.ba.EdgeTypes
BACKEDGE_SOURCE_EDGE, BACKEDGE_TARGET_EDGE, CHECKED_EXCEPTIONS_FLAG, EXIT_EDGE, EXPLICIT_EXCEPTIONS_FLAG, FALL_THROUGH_EDGE, GOTO_EDGE, HANDLED_EXCEPTION_EDGE, IFCMP_EDGE, JSR_EDGE, RET_EDGE, RETURN_EDGE, START_EDGE, SWITCH_DEFAULT_EDGE, SWITCH_EDGE, UNHANDLED_EXCEPTION_EDGE, UNKNOWN_EDGE
-
Constructor Summary
ConstructorDescriptionTargetEnumeratingVisitor
(org.apache.bcel.generic.InstructionHandle handle, org.apache.bcel.generic.ConstantPoolGen constPoolGen) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Is the analyzed instruction an exit (call to System.exit())?boolean
Is the analyzed instruction a method return?boolean
Is the analyzed instruction an explicit throw?boolean
Is the instruction the end of a basic block?Iterate over Target objects representing control flow targets and their edge types.void
visitATHROW
(org.apache.bcel.generic.ATHROW ins) void
visitGotoInstruction
(org.apache.bcel.generic.GotoInstruction ins) void
visitIfInstruction
(org.apache.bcel.generic.IfInstruction ins) void
visitINVOKESTATIC
(org.apache.bcel.generic.INVOKESTATIC ins) void
visitReturnInstruction
(org.apache.bcel.generic.ReturnInstruction ins) void
visitSelect
(org.apache.bcel.generic.Select ins) Methods inherited from class org.apache.bcel.generic.EmptyVisitor
visitAALOAD, visitAASTORE, visitACONST_NULL, visitAllocationInstruction, visitALOAD, visitANEWARRAY, visitARETURN, visitArithmeticInstruction, visitArrayInstruction, visitARRAYLENGTH, visitASTORE, visitBALOAD, visitBASTORE, visitBIPUSH, visitBranchInstruction, visitBREAKPOINT, visitCALOAD, visitCASTORE, visitCHECKCAST, visitConstantPushInstruction, visitConversionInstruction, visitCPInstruction, visitD2F, visitD2I, visitD2L, visitDADD, visitDALOAD, visitDASTORE, visitDCMPG, visitDCMPL, visitDCONST, visitDDIV, visitDLOAD, visitDMUL, visitDNEG, visitDREM, visitDRETURN, visitDSTORE, visitDSUB, visitDUP, visitDUP_X1, visitDUP_X2, visitDUP2, visitDUP2_X1, visitDUP2_X2, visitExceptionThrower, visitF2D, visitF2I, visitF2L, visitFADD, visitFALOAD, visitFASTORE, visitFCMPG, visitFCMPL, visitFCONST, visitFDIV, visitFieldInstruction, visitFieldOrMethod, visitFLOAD, visitFMUL, visitFNEG, visitFREM, visitFRETURN, visitFSTORE, visitFSUB, visitGETFIELD, visitGETSTATIC, visitGOTO, visitGOTO_W, visitI2B, visitI2C, visitI2D, visitI2F, visitI2L, visitI2S, visitIADD, visitIALOAD, visitIAND, visitIASTORE, visitICONST, visitIDIV, visitIF_ACMPEQ, visitIF_ACMPNE, visitIF_ICMPEQ, visitIF_ICMPGE, visitIF_ICMPGT, visitIF_ICMPLE, visitIF_ICMPLT, visitIF_ICMPNE, visitIFEQ, visitIFGE, visitIFGT, visitIFLE, visitIFLT, visitIFNE, visitIFNONNULL, visitIFNULL, visitIINC, visitILOAD, visitIMPDEP1, visitIMPDEP2, visitIMUL, visitINEG, visitINSTANCEOF, visitINVOKEDYNAMIC, visitInvokeInstruction, visitINVOKEINTERFACE, visitINVOKESPECIAL, visitINVOKEVIRTUAL, visitIOR, visitIREM, visitIRETURN, visitISHL, visitISHR, visitISTORE, visitISUB, visitIUSHR, visitIXOR, visitJSR, visitJSR_W, visitJsrInstruction, visitL2D, visitL2F, visitL2I, visitLADD, visitLALOAD, visitLAND, visitLASTORE, visitLCMP, visitLCONST, visitLDC, visitLDC2_W, visitLDIV, visitLLOAD, visitLMUL, visitLNEG, visitLoadClass, visitLoadInstruction, visitLocalVariableInstruction, visitLOOKUPSWITCH, visitLOR, visitLREM, visitLRETURN, visitLSHL, visitLSHR, visitLSTORE, visitLSUB, visitLUSHR, visitLXOR, visitMONITORENTER, visitMONITOREXIT, visitMULTIANEWARRAY, visitNEW, visitNEWARRAY, visitNOP, visitPOP, visitPOP2, visitPopInstruction, visitPushInstruction, visitPUTFIELD, visitPUTSTATIC, visitRET, visitRETURN, visitSALOAD, visitSASTORE, visitSIPUSH, visitStackConsumer, visitStackInstruction, visitStackProducer, visitStoreInstruction, visitSWAP, visitTABLESWITCH, visitTypedInstruction, visitUnconditionalBranch, visitVariableLengthInstruction
-
Constructor Details
-
TargetEnumeratingVisitor
public TargetEnumeratingVisitor(org.apache.bcel.generic.InstructionHandle handle, org.apache.bcel.generic.ConstantPoolGen constPoolGen) Constructor.- Parameters:
handle
- the handle of the instruction whose targets should be enumeratedconstPoolGen
- the ConstantPoolGen object for the class
-
-
Method Details
-
isEndOfBasicBlock
public boolean isEndOfBasicBlock()Is the instruction the end of a basic block? -
instructionIsReturn
public boolean instructionIsReturn()Is the analyzed instruction a method return? -
instructionIsThrow
public boolean instructionIsThrow()Is the analyzed instruction an explicit throw? -
instructionIsExit
public boolean instructionIsExit()Is the analyzed instruction an exit (call to System.exit())? -
targetIterator
Iterate over Target objects representing control flow targets and their edge types. -
visitGotoInstruction
public void visitGotoInstruction(org.apache.bcel.generic.GotoInstruction ins) - Specified by:
visitGotoInstruction
in interfaceorg.apache.bcel.generic.Visitor
- Overrides:
visitGotoInstruction
in classorg.apache.bcel.generic.EmptyVisitor
-
visitIfInstruction
public void visitIfInstruction(org.apache.bcel.generic.IfInstruction ins) - Specified by:
visitIfInstruction
in interfaceorg.apache.bcel.generic.Visitor
- Overrides:
visitIfInstruction
in classorg.apache.bcel.generic.EmptyVisitor
-
visitSelect
public void visitSelect(org.apache.bcel.generic.Select ins) - Specified by:
visitSelect
in interfaceorg.apache.bcel.generic.Visitor
- Overrides:
visitSelect
in classorg.apache.bcel.generic.EmptyVisitor
-
visitReturnInstruction
public void visitReturnInstruction(org.apache.bcel.generic.ReturnInstruction ins) - Specified by:
visitReturnInstruction
in interfaceorg.apache.bcel.generic.Visitor
- Overrides:
visitReturnInstruction
in classorg.apache.bcel.generic.EmptyVisitor
-
visitATHROW
public void visitATHROW(org.apache.bcel.generic.ATHROW ins) - Specified by:
visitATHROW
in interfaceorg.apache.bcel.generic.Visitor
- Overrides:
visitATHROW
in classorg.apache.bcel.generic.EmptyVisitor
-
visitINVOKESTATIC
public void visitINVOKESTATIC(org.apache.bcel.generic.INVOKESTATIC ins) - Specified by:
visitINVOKESTATIC
in interfaceorg.apache.bcel.generic.Visitor
- Overrides:
visitINVOKESTATIC
in classorg.apache.bcel.generic.EmptyVisitor
-