<html><head><meta http-equiv="content-type" content="text/html; charset=GB2312"><style>body { line-height: 1.5; }body { font-size: 10.5pt; font-family: 'Microsoft YaHei UI'; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span microsoft="" yahei="" ui';="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'="">Dear all,<br><br>Given the method <i><b>getX</b></i> in class <b><i>C3</i></b> (in the figure shown below), I want to trace the set of methods which affect it based on the data (i.e., the variables used in <i><b>getX</b></i>).<br><br>I think this is a reverse data flow problem. First <i><b>getX</b></i> use the props , and <b><i>props</i></b> is a class variable of <i><b>C3</b></i>. Then the <i><b>props</b></i> is set value by the constructor of <i><b>C3</b></i>.<br>Finally, for the constructor, it receives the returned value of the method <i><b>load</b></i> to set the <i><b>props</b></i> considering the method <i><b>main</b></i>. </span></div><div><span microsoft="" yahei="" ui';="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'=""><br></span></div><div><span microsoft="" yahei="" ui';="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'="">So I can get the value dependency path of the variable <i><b>props</b></i> in <b><i>getX</i></b>: C3.getX() ¡ª¡ª> C3.C3() ¡ª¡ª> C2.load(). <br><br>I think the aforcementioned analysis is similar to the backward thin slicing analysis or taint analysis. Does soot provide the implemntation?</span><span></span></div><div><span microsoft="" yahei="" ui';="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'=""><br></span></div><div><span microsoft="" yahei="" ui';="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'=""><div style="color: rgb(51, 51, 51); font-family: Consolas, 'Courier New', monospace; line-height: 19px; white-space: pre; background-color: rgb(253, 246, 227);"><div><span style="color: #93a1a1;font-style: italic;">// File: C1.java</span></div><div><span style="color: #073642;font-weight: bold;">public</span> <span style="color: #073642;font-weight: bold;">class</span> <span style="color: #268bd2;">C1</span>(){</div><div>    <span style="color: #073642;font-weight: bold;">public</span> <span style="color: #073642;font-weight: bold;">static</span> <span style="color: #073642;font-weight: bold;">void</span> <span style="color: #268bd2;">main</span>(<span style="color: #073642;font-weight: bold;">String</span>[] args) {</div><div>        <span style="color: #073642;font-weight: bold;">C2</span> <span style="color: #268bd2;">c2</span> <span style="color: #859900;">=</span> <span style="color: #859900;">new</span> <span style="color: #268bd2;">C2</span>();</div><div>        <span style="color: #073642;font-weight: bold;">Properties</span> <span style="color: #268bd2;">props</span> <span style="color: #859900;">=</span> <span style="color: #268bd2;">c2</span>.<span style="color: #268bd2;">load</span>();</div><div>        <span style="color: #073642;font-weight: bold;">C3</span> <span style="color: #268bd2;">c3</span> <span style="color: #859900;">=</span> <span style="color: #859900;">new</span> <span style="color: #268bd2;">C3</span>(props);</div><div>        <span style="color: #268bd2;">System</span>.<span style="color: #268bd2;">out</span>.<span style="color: #268bd2;">println</span>(<span style="color: #268bd2;">c3</span>.<span style="color: #268bd2;">getX</span>(<span style="color: #2aa198;">"ccc"</span>));</div><div>    }</div><div>}</div><br><div><span style="color: #93a1a1;font-style: italic;">// File: C2.java</span></div><div><span style="color: #073642;font-weight: bold;">public</span> <span style="color: #073642;font-weight: bold;">class</span> <span style="color: #268bd2;">C2</span>(){</div><div>    <span style="color: #073642;font-weight: bold;">public</span> <span style="color: #073642;font-weight: bold;">static</span> <span style="color: #073642;font-weight: bold;">Properties</span> <span style="color: #268bd2;">load</span>() {</div><div>        ...</div><div>    }</div><div>}</div><br><div><span style="color: #93a1a1;font-style: italic;">// File: C3.java</span></div><div><span style="color: #073642;font-weight: bold;">public</span> <span style="color: #073642;font-weight: bold;">class</span> <span style="color: #268bd2;">C3</span>(){</div><div>    <span style="color: #073642;font-weight: bold;">Properties</span> <span style="color: #268bd2;">props</span>;</div><div>    <span style="color: #073642;font-weight: bold;">public</span> <span style="color: #073642;font-weight: bold;">void</span> <span style="color: #268bd2;">C3</span>(<span style="color: #073642;font-weight: bold;">Properties</span> props){</div><div>        <span style="color: #268bd2;">this</span>.<span style="color: #268bd2;">props</span> <span style="color: #859900;">=</span> props;</div><div>    }</div><br><div>    <span style="color: #073642;font-weight: bold;">public</span> <span style="color: #073642;font-weight: bold;">static</span> <span style="color: #073642;font-weight: bold;">Object</span> <span style="color: #268bd2;">getX</span>(<span style="color: #073642;font-weight: bold;">String</span> key) {</div><div>        <span style="color: #859900;">return</span> <span style="color: #268bd2;">props</span>.<span style="color: #268bd2;">getProperty</span>(key);</div><div>    }</div><div>}</div></div></span></div><div><span microsoft="" yahei="" ui';="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'=""><br></span></div><div><span microsoft="" yahei="" ui';="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'="">Best,</span></div><div><span microsoft="" yahei="" ui';="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'="">Yuan</span></div>
</body></html>