<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
</head>
<body style="font-family:Arial;font-size:14px">
<p>Hi Nikhil,<br>
<br>
Yes, of course, it is there in Soot. The best way to go about is to simply convert your class to jimple which would give you a perfect outlook of how Soot will actually process your code. At least that's the thumb rule I followed and it was the fastest and most efficient way of understanding Soot.<br>
<br>
Regards,<br>
Pallavi<br>
Quoting Nikhil <<a href="mailto:cs16m028@smail.iitm.ac.in">cs16m028@smail.iitm.ac.in</a>>:</p>
<blockquote style="border-left:2px solid blue;margin-left:2px;padding-left:12px;" type="cite">
<div dir="ltr"><br>
<span style="font-family: georgia, serif;">          Hi,</span><br>
<br>
<div style="margin-left: 40px;"><span style="font-family: georgia, serif;">I just started using soot. I want to know that whatever I am looking for is already there in soot? </span></div>
<br>
<div style="margin-left: 40px;"><span style="font-family: georgia, serif;">Consider the following example program.</span><br>
<br>
<div class="prettyprint" style="background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; overflow-wrap: break-word;">
<div class="subprettyprint"><code class="prettyprint"><span class="styled-by-prettify" style="color: #008;">class</span> <span class="styled-by-prettify" style="color: #606;">Example</span> <span class="styled-by-prettify" style="color: #660;">{</span><br>
<span class="styled-by-prettify" style="color: #000;">   </span> <span class="styled-by-prettify" style="color: #008;">public</span> <span class="styled-by-prettify" style="color: #008;">static</span> <span class="styled-by-prettify" style="color: #008;">void</span> <span class="styled-by-prettify" style="color: #000;">main</span><span class="styled-by-prettify" style="color: #660;">(</span><span class="styled-by-prettify" style="color: #606;">String</span><span class="styled-by-prettify" style="color: #660;">[]</span> <span class="styled-by-prettify" style="color: #000;">args</span><span class="styled-by-prettify" style="color: #660;">)</span> <span class="styled-by-prettify" style="color: #660;">{</span><br>
<span class="styled-by-prettify" style="color: #000;">       </span> <span class="styled-by-prettify" style="color: #606;">Scanner</span> <span class="styled-by-prettify" style="color: #000;">sc</span> <span class="styled-by-prettify" style="color: #660;">=</span> <span class="styled-by-prettify" style="color: #008;">new</span> <span class="styled-by-prettify" style="color: #606;">Scanner</span><span class="styled-by-prettify" style="color: #660;">(</span><span class="styled-by-prettify" style="color: #606;">System</span><span class="styled-by-prettify" style="color: #660;">.</span><span class="styled-by-prettify" style="color: #008;">in</span><span class="styled-by-prettify" style="color: #660;">);</span><br>
<span class="styled-by-prettify" style="color: #000;">       </span> <span class="styled-by-prettify" style="color: #008;">int</span> <span class="styled-by-prettify" style="color: #000;">x</span> <span class="styled-by-prettify" style="color: #660;">=</span> <span class="styled-by-prettify" style="color: #000;">sc</span><span class="styled-by-prettify" style="color: #660;">.</span><span class="styled-by-prettify" style="color: #000;">nextInt</span><span class="styled-by-prettify" style="color: #660;">();</span><br>
<span class="styled-by-prettify" style="color: #000;">       </span> <span class="styled-by-prettify" style="color: #606;">List</span><span class="styled-by-prettify" style="color: #660;"><</span><span class="styled-by-prettify" style="color: #606;">Integer</span><span class="styled-by-prettify" style="color: #660;">></span> <span class="styled-by-prettify" style="color: #000;">l</span> <span class="styled-by-prettify" style="color: #660;">=</span> <span class="styled-by-prettify" style="color: #008;">null</span><span class="styled-by-prettify" style="color: #660;">;</span><br>
<br>
<span class="styled-by-prettify" style="color: #000;">       </span> <span class="styled-by-prettify" style="color: #800;">// x will be in between 1 and 3 only.</span><br>
<br>
<span class="styled-by-prettify" style="color: #000;">       </span> <span class="styled-by-prettify" style="color: #008;">switch</span> <span class="styled-by-prettify" style="color: #660;">(</span><span class="styled-by-prettify" style="color: #000;">x</span><span class="styled-by-prettify" style="color: #660;">)</span> <span class="styled-by-prettify" style="color: #660;">{</span><br>
<span class="styled-by-prettify" style="color: #000;">           </span> <span class="styled-by-prettify" style="color: #008;">case</span> <span class="styled-by-prettify" style="color: #066;">1</span><span class="styled-by-prettify" style="color: #660;">:</span><br>
<span class="styled-by-prettify" style="color: #000;">                    l</span> <span class="styled-by-prettify" style="color: #660;">=</span> <span class="styled-by-prettify" style="color: #008;">new</span> <span class="styled-by-prettify" style="color: #606;">ArrayList</span><span class="styled-by-prettify" style="color: #660;"><>();</span><br>
<span class="styled-by-prettify" style="color: #000;">                   </span> <span class="styled-by-prettify" style="color: #008;">break</span><span class="styled-by-prettify" style="color: #660;">;</span><br>
<span class="styled-by-prettify" style="color: #000;">           </span> <span class="styled-by-prettify" style="color: #008;">case</span> <span class="styled-by-prettify" style="color: #066;">2</span> <span class="styled-by-prettify" style="color: #660;">:</span><br>
<span class="styled-by-prettify" style="color: #000;">                    l</span> <span class="styled-by-prettify" style="color: #660;">=</span> <span class="styled-by-prettify" style="color: #008;">new</span> <span class="styled-by-prettify" style="color: #606;">LinkedList</span><span class="styled-by-prettify" style="color: #660;"><>();</span><br>
<span class="styled-by-prettify" style="color: #000;">                   </span> <span class="styled-by-prettify" style="color: #008;">break</span><span class="styled-by-prettify" style="color: #660;">;</span><br>
<span class="styled-by-prettify" style="color: #000;">           </span> <span class="styled-by-prettify" style="color: #008;">case</span> <span class="styled-by-prettify" style="color: #066;">3</span> <span class="styled-by-prettify" style="color: #660;">:</span><br>
<span class="styled-by-prettify" style="color: #000;">                    l</span> <span class="styled-by-prettify" style="color: #660;">=</span> <span class="styled-by-prettify" style="color: #008;">new</span> <span class="styled-by-prettify" style="color: #606;">Vector</span><span class="styled-by-prettify" style="color: #660;"><>();</span><br>
<span class="styled-by-prettify" style="color: #000;">                   </span> <span class="styled-by-prettify" style="color: #008;">break</span><span class="styled-by-prettify" style="color: #660;">;</span><br>
<span class="styled-by-prettify" style="color: #000;">               </span> <span class="styled-by-prettify" style="color: #660;">}</span> <span class="styled-by-prettify" style="color: #000;">       <br>
       <br>
       </span> <span class="styled-by-prettify" style="color: #800;">//At this point l might take one of this [ArrayList, LinkedList, Vector]        </span><br>
<span class="styled-by-prettify" style="color: #000;">       </span> <span class="styled-by-prettify" style="color: #800;">//Is this any analysis in Soot to get the above information?</span><br>
<span class="styled-by-prettify" style="color: #000;">       <br>
       </span> <span class="styled-by-prettify" style="color: #606;">ArrayList</span><span class="styled-by-prettify" style="color: #660;"><</span><span class="styled-by-prettify" style="color: #606;">Integer</span><span class="styled-by-prettify" style="color: #660;">></span> <span class="styled-by-prettify" style="color: #000;">al</span> <span class="styled-by-prettify" style="color: #660;">=</span> <span class="styled-by-prettify" style="color: #008;">new</span> <span class="styled-by-prettify" style="color: #606;">ArrayList</span><span class="styled-by-prettify" style="color: #660;"><>();</span><br>
<span class="styled-by-prettify" style="color: #000;">       </span> <span class="styled-by-prettify" style="color: #008;">for</span> <span class="styled-by-prettify" style="color: #660;">(</span><span class="styled-by-prettify" style="color: #008;">int</span> <span class="styled-by-prettify" style="color: #000;">i</span><span class="styled-by-prettify" style="color: #660;">=</span><span class="styled-by-prettify" style="color: #066;">0</span><span class="styled-by-prettify" style="color: #660;">;</span><span class="styled-by-prettify" style="color: #000;">i</span><span class="styled-by-prettify" style="color: #660;"><</span><span class="styled-by-prettify" style="color: #066;">4</span> <span class="styled-by-prettify" style="color: #660;">;</span><span class="styled-by-prettify" style="color: #000;">i</span><span class="styled-by-prettify" style="color: #660;">++</span> <span class="styled-by-prettify" style="color: #660;">)</span> <span class="styled-by-prettify" style="color: #660;">{</span><br>
<span class="styled-by-prettify" style="color: #000;">                al</span><span class="styled-by-prettify" style="color: #660;">.</span><span class="styled-by-prettify" style="color: #000;">add</span><span class="styled-by-prettify" style="color: #660;">(</span><span class="styled-by-prettify" style="color: #000;">i</span><span class="styled-by-prettify" style="color: #660;">);</span><br>
<span class="styled-by-prettify" style="color: #000;">           </span> <span class="styled-by-prettify" style="color: #660;">}</span> <span class="styled-by-prettify" style="color: #000;">   <br>
        l</span><span class="styled-by-prettify" style="color: #660;">.</span><span class="styled-by-prettify" style="color: #000;">addAll</span><span class="styled-by-prettify" style="color: #660;">(</span><span class="styled-by-prettify" style="color: #000;">al</span><span class="styled-by-prettify" style="color: #660;">);</span> <span class="styled-by-prettify" style="color: #000;">       <br>
       </span> <span class="styled-by-prettify" style="color: #606;">System</span><span class="styled-by-prettify" style="color: #660;">.</span><span class="styled-by-prettify" style="color: #008;">out</span><span class="styled-by-prettify" style="color: #660;">.</span><span class="styled-by-prettify" style="color: #000;">println</span><span class="styled-by-prettify" style="color: #660;">(</span><span class="styled-by-prettify" style="color: #000;">l</span><span class="styled-by-prettify" style="color: #660;">);</span><br>
<span class="styled-by-prettify" style="color: #000;">   </span> <span class="styled-by-prettify" style="color: #660;">}</span><br>
<span class="styled-by-prettify" style="color: #660;">}</span></code></div>
</div>
<br>
<br>
<br>
<br>
<span style="font-family: georgia, serif;">If some analysis is there, an explanation with a code will be very helpful.<br>
Thanks in advance.</span><br>
<br>
Cheers,<br>
--Nikhil<br>
 </div>
</div>
</blockquote>
<p><br>
<br></p>
</body>
</html>