|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.brics.string.RuntimeResolver
public class RuntimeResolver
Encapsulation of the analysis of a program using the string analysis runtime library.
This class serves two purposes:Resolver
interface to
identify Strings.cast
calls and tell the string analysis about the assumption.Strings.analyze
and
Strings.check
calls.
Strings.cast
calls,
and the hotspots used in the analysis are the expressions occurring as the first
argument to Strings.analyze
and
Strings.check
calls.
RuntimeResolver rr = new RuntimeResolver(); StringAnalysis.addResolver(rr); StringAnalysis sa = new StringAnalysis(rr.getHotspotExps());The
StringAnalysis
object sa
will now contain
the results of the analysis. Run through the set of RuntimeHotspot
objects returned by the getHotspots
method and compare the result given by the string analysis to the expected result given
for the hotspot.
StringAnalysis.addResolver
,
RuntimeHotspot
,
AnalyzeRuntime
,
InvalidRuntimeUseException
Constructor Summary | |
---|---|
RuntimeResolver()
|
|
RuntimeResolver(BindingAutomatonProvider bindings)
Initializes a RuntimeResolver for the current
application classes. |
Method Summary | |
---|---|
List<ValueBox> |
getHotspotExps()
Returns the string expressions corresponding to the runtime method hotspots for the program. |
List<RuntimeHotspot> |
getHotspots()
Returns the runtime method hotspots for the program. |
FieldResolution |
resolveField(FieldRef expr)
No special fields are resolved. |
MethodResolution |
resolveMethod(InvokeExpr expr,
SootMethod target)
If the given target method is Strings.cast ,
returns the automaton given as a regular expression or automaton URL in the cast. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RuntimeResolver()
public RuntimeResolver(BindingAutomatonProvider bindings)
RuntimeResolver
for the current
application classes.
First, all Strings.bind
calls in the program are collected, so that the regular expressions
occurring in runtime method calls can be correctly resolved.Strings.analyze
and
Strings.check
calls are
internally marked as hotspots. These can be queried using the
getHotspots
and
getHotspotExps
methods.
InvalidRuntimeUseException
- if some invalid use of the runtime
library is encountered.Method Detail |
---|
public List<ValueBox> getHotspotExps()
ValueBox
objects indicating the
expressions marked as hotspots.public List<RuntimeHotspot> getHotspots()
RuntimeHotspot
objects
describing the runtime method hotspots.public FieldResolution resolveField(FieldRef expr)
resolveField
in interface Resolver
expr
- the field to be resolved.
null
.FieldResolution
public MethodResolution resolveMethod(InvokeExpr expr, SootMethod target)
Strings.cast
,
returns the automaton given as a regular expression or automaton URL in the cast.
If the given target method is Strings.analyze
,
returns the value box for the first argument.
resolveMethod
in interface Resolver
expr
- the invocation to be resolved.target
- the target method.
null
.
InvalidRuntimeUseException
- if some invalid use of the runtime
library is encountered.MethodResolution
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |