public class UnitThrowAnalysis extends AbstractThrowAnalysis
ThrowAnalysis which returns the set of runtime exceptions
and errors that might be thrown by the bytecode instructions
represented by a unit, as indicated by the Java Virtual Machine
specification. I.e. this analysis is based entirely on the
“opcode” of the unit, the types of its arguments, and
the values of constant arguments.
The mightThrow methods could be declared static.
They are left virtual to facilitate testing. For example,
to verify that the expressions in a method call are actually being
examined, a test case can override the mightThrow(SootMethod)
with an implementation which returns the empty set instead of
all possible exceptions.
| Modifier and Type | Class and Description |
|---|---|
protected class |
UnitThrowAnalysis.UnitSwitch |
protected class |
UnitThrowAnalysis.ValueSwitch |
| Modifier | Constructor and Description |
|---|---|
protected |
UnitThrowAnalysis()
A protected constructor for use by unit tests.
|
|
UnitThrowAnalysis(Singletons.Global g)
Constructs a
UnitThrowAnalysis for inclusion in
Soot's global variable manager, G. |
| Modifier and Type | Method and Description |
|---|---|
ThrowableSet |
mightThrow(Unit u)
Returns a set representing the
Throwable types that
the specified unit might throw. |
ThrowableSet |
mightThrowImplicitly(ThrowStmt t)
Returns a set representing the
Throwable types that
the specified throw statement might throw implicitly, that is,
the possible types of errors which might arise in the course
of executing the throw statement, rather than
the type of the throw's operand. |
static UnitThrowAnalysis |
v()
Returns the single instance of
UnitThrowAnalysis. |
mightThrowExplicitlypublic UnitThrowAnalysis(Singletons.Global g)
UnitThrowAnalysis for inclusion in
Soot's global variable manager, G.g - guarantees that the constructor may only be called
from Singletons.protected UnitThrowAnalysis()
public static UnitThrowAnalysis v()
UnitThrowAnalysis.UnitThrowAnalysis.public ThrowableSet mightThrow(Unit u)
ThrowAnalysisThrowable types that
the specified unit might throw.mightThrow in interface ThrowAnalysismightThrow in class AbstractThrowAnalysisu - Unit whose exceptions are to be returned.Throwable types that
u might throw.public ThrowableSet mightThrowImplicitly(ThrowStmt t)
ThrowAnalysisThrowable types that
the specified throw statement might throw implicitly, that is,
the possible types of errors which might arise in the course
of executing the throw statement, rather than
the type of the throw's operand.mightThrowImplicitly in interface ThrowAnalysismightThrowImplicitly in class AbstractThrowAnalysist - ThrowStmt whose implicit exceptions are
to be returned.t might throw implicitly.Copyright © 2012-2019 RoboVM AB. All Rights Reserved.