Package soot.JastAddJ
Class TryStmt
- java.lang.Object
-
- beaver.Symbol
-
- soot.JastAddJ.ASTNode<ASTNode>
-
- soot.JastAddJ.Stmt
-
- soot.JastAddJ.TryStmt
-
- All Implemented Interfaces:
Cloneable,Iterable<ASTNode>,FinallyHost
- Direct Known Subclasses:
TryWithResources
public class TryStmt extends Stmt implements Cloneable, FinallyHost
-
-
Field Summary
-
Fields inherited from class soot.JastAddJ.Stmt
localNum_computed, localNum_value
-
Fields inherited from class soot.JastAddJ.ASTNode
children, generatedWithCacheCycle, generatedWithCircularEnabled, generatedWithComponentCheck, in$Circle, is$Final, numChildren, parent, PRIMITIVE_PACKAGE_NAME, state
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCatchClause(CatchClause node)Append an element to the CatchClause list.voidaddCatchClauseNoTransform(CatchClause node)protected voidaddFallThroughLabelTag(Body b, Stmt handler, Stmt fallThrough)Collectionbranches()CollectionbranchesFromFinally()StmtbranchTarget(Stmt branchStmt)Stmtbreak_label()booleancanCompleteNormally()booleancatchableException(TypeDecl type)The block of the try statement can throw an exception of a type assignable to the given type.TryStmtclone()voidcollectBranches(Collection c)voidcollectFinally(Stmt branchStmt, ArrayList list)Stmtcontinue_label()TryStmtcopy()ArrayListDefine_ArrayList_exceptionRanges(ASTNode caller, ASTNode child)booleanDefine_boolean_enclosedByExceptionHandler(ASTNode caller, ASTNode child)booleanDefine_boolean_handlesException(ASTNode caller, ASTNode child, TypeDecl exceptionType)booleanDefine_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v)booleanDefine_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v)booleanDefine_boolean_reachable(ASTNode caller, ASTNode child)booleanDefine_boolean_reachableCatchClause(ASTNode caller, ASTNode child, TypeDecl exceptionType)booleanDefine_boolean_reportUnreachable(ASTNode caller, ASTNode child)Collection<TypeDecl>Define_Collection_TypeDecl__caughtExceptions(ASTNode caller, ASTNode child)voidemitExceptionHandler(Body b)voidemitFinallyCode(Body b)booleanenclosedByExceptionHandler()CollectionescapedBranches()ArrayListexceptionRanges()voidflushCache()voidflushCollectionCache()TryStmtfullCopy()Create a deep copy of the AST subtree at this node.BlockgetBlock()Retrieves the Block child.BlockgetBlockNoTransform()Retrieves the Block child.CatchClausegetCatchClause(int i)Retrieves the element at indexiin the CatchClause list..List<CatchClause>getCatchClauseList()Retrieves the CatchClause list.List<CatchClause>getCatchClauseListNoTransform()Retrieves the CatchClause list.List<CatchClause>getCatchClauses()Retrieves the CatchClause list.List<CatchClause>getCatchClausesNoTransform()Retrieves the CatchClause list.BlockgetFinally()Retrieves the (optional) Finally child.Opt<Block>getFinallyOpt()Opt<Block>getFinallyOptNoTransform()Retrieves the optional node for child Finally.intgetNumCatchClause()Retrieves the number of children in the CatchClause list.intgetNumCatchClauseNoTransform()Retrieves the number of children in the CatchClause list.booleanhandlesException(TypeDecl exceptionType)booleanhasFinally()Check whether the optional Finally child exists.voidinit$Children()Initializes the child array to the correct size.booleanisDAafter(Variable v)booleanisDAafterFinally(Variable v)booleanisDUafter(Variable v)booleanisDUafterFinally(Variable v)booleanisDUbefore(Variable v)voidjimplify2(Body b)Stmtlabel_begin()Stmtlabel_block_end()Stmtlabel_catch_end()Stmtlabel_end()Stmtlabel_exception_handler()Stmtlabel_finally()Stmtlabel_finally_block()booleanmayHaveRewrite()booleanmodifiedInScope(Variable var)booleanneedsFinallyTrap()protected intnumChildren()protected booleanreachedException(TypeDecl type)ASTNoderewriteTo()voidsetBlock(Block node)Replaces the Block child.voidsetCatchClause(CatchClause node, int i)Replaces the CatchClause list element at indexiwith the new nodenode.voidsetCatchClauseList(List<CatchClause> list)Replaces the CatchClause list.voidsetFinally(Block node)Replaces the (optional) Finally child.voidsetFinallyOpt(Opt<Block> opt)Replaces the optional node for the Finally child.CollectiontargetBranches()voidtoString(StringBuffer s)TypeDecltypeError()TypeDecltypeRuntimeException()TypeDecltypeThrowable()-
Methods inherited from class soot.JastAddJ.Stmt
addsIndentationLevel, continueLabel, declaresVariable, Define_String_typeDeclIndent, enclosingBodyDecl, hostType, isDAbefore, localNum, lookupMethod, lookupType, lookupType, lookupVariable, reachable, reportUnreachable
-
Methods inherited from class soot.JastAddJ.ASTNode
accessControl, addAttributes, addChild, asImmediate, asLocal, asLocal, asRValue, beginExceptionRange, checkDUeverywhere, checkEnum, checkUncheckedConversion, checkWarnings, clearLocations, cloneSubtree, collectEnclosingVariables, collectErrors, collectExceptions, collectTypesToHierarchy, collectTypesToSignatures, compilationUnit, Define_Annotation_lookupAnnotation, Define_ASTNode_enclosingBlock, Define_BodyDecl_enclosingBodyDecl, Define_boolean_hasPackage, Define_boolean_inExplicitConstructorInvocation, Define_boolean_inExtendsOrImplements, Define_boolean_inhModifiedInScope, Define_boolean_insideLoop, Define_boolean_insideSwitch, Define_boolean_inStaticContext, Define_boolean_isAnonymous, Define_boolean_isAnonymousDecl, Define_boolean_isCatchParam, Define_boolean_isConstructorParameter, Define_boolean_isDest, Define_boolean_isExceptionHandlerParameter, Define_boolean_isExplicitGenericConstructorAccess, Define_boolean_isIncOrDec, Define_boolean_isLocalClass, Define_boolean_isMemberType, Define_boolean_isMethodParameter, Define_boolean_isNestedType, Define_boolean_isSource, Define_boolean_mayBeAbstract, Define_boolean_mayBeFinal, Define_boolean_mayBeNative, Define_boolean_mayBePrivate, Define_boolean_mayBeProtected, Define_boolean_mayBePublic, Define_boolean_mayBeStatic, Define_boolean_mayBeStrictfp, Define_boolean_mayBeSynchronized, Define_boolean_mayBeTransient, Define_boolean_mayBeVolatile, Define_boolean_mayUseAnnotationTarget, Define_boolean_resourcePreviouslyDeclared, Define_boolean_variableArityValid, Define_boolean_withinDeprecatedAnnotation, Define_boolean_withinSuppressWarnings, Define_Case_bind, Define_CatchClause_catchClause, Define_ClassInstanceExpr_getClassInstanceExpr, Define_Collection_lookupConstructor, Define_Collection_lookupMethod, Define_Collection_lookupSuperConstructor, Define_CompilationUnit_compilationUnit, Define_ConstructorDecl_constructorDecl, Define_ConstructorDecl_unknownConstructor, Define_ElementValue_lookupElementTypeValue, Define_Expr_nestedScope, Define_GLBType_lookupGLBType, Define_int_localNum, Define_LabeledStmt_lookupLabel, Define_LUBType_lookupLUBType, Define_MethodDecl_unknownMethod, Define_NameType_nameType, Define_SimpleSet_allImportedTypes, Define_SimpleSet_lookupType, Define_SimpleSet_lookupVariable, Define_soot_jimple_Stmt_condition_false_label, Define_soot_jimple_Stmt_condition_true_label, Define_String_hostPackage, Define_String_methodHost, Define_String_packageName, Define_TypeDecl_assignConvertedType, Define_TypeDecl_componentType, Define_TypeDecl_declType, Define_TypeDecl_enclosingAnnotationDecl, Define_TypeDecl_enclosingInstance, Define_TypeDecl_enclosingType, Define_TypeDecl_expectedType, Define_TypeDecl_genericDecl, Define_TypeDecl_hostType, Define_TypeDecl_lookupType, Define_TypeDecl_lookupWildcardExtends, Define_TypeDecl_lookupWildcardSuper, Define_TypeDecl_returnType, Define_TypeDecl_superType, Define_TypeDecl_switchType, Define_TypeDecl_typeBoolean, Define_TypeDecl_typeByte, Define_TypeDecl_typeChar, Define_TypeDecl_typeCloneable, Define_TypeDecl_typeDouble, Define_TypeDecl_typeError, Define_TypeDecl_typeException, Define_TypeDecl_typeFloat, Define_TypeDecl_typeInt, Define_TypeDecl_typeLong, Define_TypeDecl_typeNull, Define_TypeDecl_typeNullPointerException, Define_TypeDecl_typeObject, Define_TypeDecl_typeRuntimeException, Define_TypeDecl_typeSerializable, Define_TypeDecl_typeShort, Define_TypeDecl_typeString, Define_TypeDecl_typeThrowable, Define_TypeDecl_typeVoid, Define_TypeDecl_typeWildcard, Define_TypeDecl_unknownType, Define_Variable_unknownField, Define_VariableScope_outerScope, definesLabel, definiteAssignment, dumpString, dumpTree, dumpTree, dumpTreeNoRewrite, dumpTreeNoRewrite, duringAnnotations, duringAnonymousClasses, duringBoundNames, duringDU, duringEnums, duringGenericTypeVariables, duringImplicitConstructor, duringLiterals, duringNameResolution, duringSyntacticClassification, duringVariableDeclarationTransformation, emitConstant, end, endExceptionRange, error, errorPrefix, exceptionHandling, extractIndent, extractSingleType, flushCaches, getChild, getChildNoTransform, getIndexOfChild, getNumChild, getNumChildNoTransform, getParent, in$Circle, in$Circle, indent, insertChild, is$Final, is$Final, isDescendantTo, isStringAdd, iterator, jimplify1phase1, jimplify1phase2, jimplify2, lineNumber, location, nameCheck, newLabel, options, putSimpleSetElement, removeChild, removeInstanceMethods, removeInstanceVariables, replace, setChild, setEnd, setLocation, setParent, setStart, sourceFile, start, state, toString, transformation, transformEnumConstructors, typeCheck, unassignedEverywhere, usesTypeVariable, varChildIndex, varChildIndex, warning, warningPrefix, with
-
Methods inherited from class beaver.Symbol
getColumn, getEnd, getId, getLine, getStart, makePosition
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
branches_computed
protected boolean branches_computed
-
branches_value
protected Collection branches_value
-
branchesFromFinally_computed
protected boolean branchesFromFinally_computed
-
branchesFromFinally_value
protected Collection branchesFromFinally_value
-
targetBranches_computed
protected boolean targetBranches_computed
-
targetBranches_value
protected Collection targetBranches_value
-
escapedBranches_computed
protected boolean escapedBranches_computed
-
escapedBranches_value
protected Collection escapedBranches_value
-
isDAafter_Variable_values
protected Map isDAafter_Variable_values
-
isDUbefore_Variable_values
protected Map isDUbefore_Variable_values
-
isDUafter_Variable_values
protected Map isDUafter_Variable_values
-
catchableException_TypeDecl_values
protected Map catchableException_TypeDecl_values
-
canCompleteNormally_computed
protected boolean canCompleteNormally_computed
-
canCompleteNormally_value
protected boolean canCompleteNormally_value
-
label_begin_computed
protected boolean label_begin_computed
-
label_begin_value
protected Stmt label_begin_value
-
label_block_end_computed
protected boolean label_block_end_computed
-
label_block_end_value
protected Stmt label_block_end_value
-
label_end_computed
protected boolean label_end_computed
-
label_end_value
protected Stmt label_end_value
-
label_finally_computed
protected boolean label_finally_computed
-
label_finally_value
protected Stmt label_finally_value
-
label_finally_block_computed
protected boolean label_finally_block_computed
-
label_finally_block_value
protected Stmt label_finally_block_value
-
label_exception_handler_computed
protected boolean label_exception_handler_computed
-
label_exception_handler_value
protected Stmt label_exception_handler_value
-
label_catch_end_computed
protected boolean label_catch_end_computed
-
label_catch_end_value
protected Stmt label_catch_end_value
-
exceptionRanges_computed
protected boolean exceptionRanges_computed
-
exceptionRanges_value
protected ArrayList exceptionRanges_value
-
handlesException_TypeDecl_values
protected Map handlesException_TypeDecl_values
-
typeError_computed
protected boolean typeError_computed
-
typeError_value
protected TypeDecl typeError_value
-
typeRuntimeException_computed
protected boolean typeRuntimeException_computed
-
typeRuntimeException_value
protected TypeDecl typeRuntimeException_value
-
-
Constructor Detail
-
TryStmt
public TryStmt()
-
TryStmt
public TryStmt(Block p0, List<CatchClause> p1, Opt<Block> p2)
-
-
Method Detail
-
flushCache
public void flushCache()
- Overrides:
flushCachein classStmt
-
flushCollectionCache
public void flushCollectionCache()
- Overrides:
flushCollectionCachein classStmt
-
clone
public TryStmt clone() throws CloneNotSupportedException
- Overrides:
clonein classStmt- Throws:
CloneNotSupportedException
-
fullCopy
public TryStmt fullCopy()
Create a deep copy of the AST subtree at this node. The copy is dangling, i.e. has no parent.
-
collectBranches
public void collectBranches(Collection c)
- Overrides:
collectBranchesin classASTNode<ASTNode>
-
branchTarget
public Stmt branchTarget(Stmt branchStmt)
- Overrides:
branchTargetin classASTNode<ASTNode>
-
collectFinally
public void collectFinally(Stmt branchStmt, ArrayList list)
- Overrides:
collectFinallyin classASTNode<ASTNode>
-
reachedException
protected boolean reachedException(TypeDecl type)
- Overrides:
reachedExceptionin classASTNode<ASTNode>
-
toString
public void toString(StringBuffer s)
-
emitFinallyCode
public void emitFinallyCode(Body b)
- Specified by:
emitFinallyCodein interfaceFinallyHost
-
addFallThroughLabelTag
protected void addFallThroughLabelTag(Body b, Stmt handler, Stmt fallThrough)
-
emitExceptionHandler
public void emitExceptionHandler(Body b)
-
init$Children
public void init$Children()
Initializes the child array to the correct size. Initializes List and Opt nta children.- Overrides:
init$Childrenin classStmt
-
numChildren
protected int numChildren()
- Overrides:
numChildrenin classStmt
-
mayHaveRewrite
public boolean mayHaveRewrite()
- Overrides:
mayHaveRewritein classStmt
-
setBlock
public void setBlock(Block node)
Replaces the Block child.- Parameters:
node- The new node to replace the Block child.
-
getBlock
public Block getBlock()
Retrieves the Block child.- Returns:
- The current node used as the Block child.
-
getBlockNoTransform
public Block getBlockNoTransform()
Retrieves the Block child.This method does not invoke AST transformations.
- Returns:
- The current node used as the Block child.
-
setCatchClauseList
public void setCatchClauseList(List<CatchClause> list)
Replaces the CatchClause list.- Parameters:
list- The new list node to be used as the CatchClause list.
-
getNumCatchClause
public int getNumCatchClause()
Retrieves the number of children in the CatchClause list.- Returns:
- Number of children in the CatchClause list.
-
getNumCatchClauseNoTransform
public int getNumCatchClauseNoTransform()
Retrieves the number of children in the CatchClause list. Calling this method will not trigger rewrites..- Returns:
- Number of children in the CatchClause list.
-
getCatchClause
public CatchClause getCatchClause(int i)
Retrieves the element at indexiin the CatchClause list..- Parameters:
i- Index of the element to return.- Returns:
- The element at position
iin the CatchClause list.
-
addCatchClause
public void addCatchClause(CatchClause node)
Append an element to the CatchClause list.- Parameters:
node- The element to append to the CatchClause list.
-
addCatchClauseNoTransform
public void addCatchClauseNoTransform(CatchClause node)
-
setCatchClause
public void setCatchClause(CatchClause node, int i)
Replaces the CatchClause list element at indexiwith the new nodenode.- Parameters:
node- The new node to replace the old list element.i- The list index of the node to be replaced.
-
getCatchClauses
public List<CatchClause> getCatchClauses()
Retrieves the CatchClause list.- Returns:
- The node representing the CatchClause list.
-
getCatchClausesNoTransform
public List<CatchClause> getCatchClausesNoTransform()
Retrieves the CatchClause list.This method does not invoke AST transformations.
- Returns:
- The node representing the CatchClause list.
-
getCatchClauseList
public List<CatchClause> getCatchClauseList()
Retrieves the CatchClause list.- Returns:
- The node representing the CatchClause list.
-
getCatchClauseListNoTransform
public List<CatchClause> getCatchClauseListNoTransform()
Retrieves the CatchClause list.This method does not invoke AST transformations.
- Returns:
- The node representing the CatchClause list.
-
setFinallyOpt
public void setFinallyOpt(Opt<Block> opt)
Replaces the optional node for the Finally child. This is theOptnode containing the child Finally, not the actual child!- Parameters:
opt- The new node to be used as the optional node for the Finally child.
-
hasFinally
public boolean hasFinally()
Check whether the optional Finally child exists.- Returns:
trueif the optional Finally child exists,falseif it does not.
-
getFinally
public Block getFinally()
Retrieves the (optional) Finally child.- Returns:
- The Finally child, if it exists. Returns
nullotherwise.
-
setFinally
public void setFinally(Block node)
Replaces the (optional) Finally child.- Parameters:
node- The new node to be used as the Finally child.
-
getFinallyOptNoTransform
public Opt<Block> getFinallyOptNoTransform()
Retrieves the optional node for child Finally. This is theOptnode containing the child Finally, not the actual child!This method does not invoke AST transformations.
- Returns:
- The optional node for child Finally.
-
branches
public Collection branches()
-
branchesFromFinally
public Collection branchesFromFinally()
-
targetBranches
public Collection targetBranches()
-
escapedBranches
public Collection escapedBranches()
-
isDUafterFinally
public boolean isDUafterFinally(Variable v)
- Specified by:
isDUafterFinallyin interfaceFinallyHost
-
isDAafterFinally
public boolean isDAafterFinally(Variable v)
- Specified by:
isDAafterFinallyin interfaceFinallyHost
-
isDUbefore
public boolean isDUbefore(Variable v)
- Overrides:
isDUbeforein classStmt
-
catchableException
public boolean catchableException(TypeDecl type)
The block of the try statement can throw an exception of a type assignable to the given type.
-
canCompleteNormally
public boolean canCompleteNormally()
- Overrides:
canCompleteNormallyin classStmt
-
break_label
public Stmt break_label()
- Overrides:
break_labelin classStmt
-
continue_label
public Stmt continue_label()
- Overrides:
continue_labelin classStmt
-
label_begin
public Stmt label_begin()
-
label_block_end
public Stmt label_block_end()
-
label_end
public Stmt label_end()
-
label_finally
public Stmt label_finally()
-
label_finally_block
public Stmt label_finally_block()
- Specified by:
label_finally_blockin interfaceFinallyHost
-
label_exception_handler
public Stmt label_exception_handler()
-
label_catch_end
public Stmt label_catch_end()
-
needsFinallyTrap
public boolean needsFinallyTrap()
-
exceptionRanges
public ArrayList exceptionRanges()
-
modifiedInScope
public boolean modifiedInScope(Variable var)
- Specified by:
modifiedInScopein classStmt
-
handlesException
public boolean handlesException(TypeDecl exceptionType)
-
typeError
public TypeDecl typeError()
-
typeRuntimeException
public TypeDecl typeRuntimeException()
-
enclosedByExceptionHandler
public boolean enclosedByExceptionHandler()
-
typeThrowable
public TypeDecl typeThrowable()
-
Define_boolean_isDAbefore
public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v)
- Overrides:
Define_boolean_isDAbeforein classASTNode<ASTNode>
-
Define_boolean_isDUbefore
public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v)
- Overrides:
Define_boolean_isDUbeforein classASTNode<ASTNode>
-
Define_boolean_handlesException
public boolean Define_boolean_handlesException(ASTNode caller, ASTNode child, TypeDecl exceptionType)
- Overrides:
Define_boolean_handlesExceptionin classASTNode<ASTNode>
-
Define_boolean_reachable
public boolean Define_boolean_reachable(ASTNode caller, ASTNode child)
- Overrides:
Define_boolean_reachablein classASTNode<ASTNode>
-
Define_boolean_reachableCatchClause
public boolean Define_boolean_reachableCatchClause(ASTNode caller, ASTNode child, TypeDecl exceptionType)
- Overrides:
Define_boolean_reachableCatchClausein classASTNode<ASTNode>
-
Define_boolean_reportUnreachable
public boolean Define_boolean_reportUnreachable(ASTNode caller, ASTNode child)
- Overrides:
Define_boolean_reportUnreachablein classASTNode<ASTNode>
-
Define_boolean_enclosedByExceptionHandler
public boolean Define_boolean_enclosedByExceptionHandler(ASTNode caller, ASTNode child)
- Overrides:
Define_boolean_enclosedByExceptionHandlerin classASTNode<ASTNode>
-
Define_ArrayList_exceptionRanges
public ArrayList Define_ArrayList_exceptionRanges(ASTNode caller, ASTNode child)
- Overrides:
Define_ArrayList_exceptionRangesin classASTNode<ASTNode>
-
Define_Collection_TypeDecl__caughtExceptions
public Collection<TypeDecl> Define_Collection_TypeDecl__caughtExceptions(ASTNode caller, ASTNode child)
- Overrides:
Define_Collection_TypeDecl__caughtExceptionsin classASTNode<ASTNode>
-
-