<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Nishant,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>These lines are occasions on which a single Java line was split into multiple Jimple lines. If condition in your Java code accesses a field which is not directly possible in Jimple. Therefore, Soot creates two lines from it: We first read the field value and then compare it. Apparently, only the first line gets the corresponding line number tag, whereas the second one does not. This in turn is quite strange as we have code that propagates on line numbers (see lines 425ff in class soot.dexpler.DexBody. My guess therefore is that some transformer kills the line number tag for some reason.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Can you send me a minimal working example with which I can reproduce the issue?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>  Steven<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> soot-list-bounces@CS.McGill.CA [mailto:soot-list-bounces@CS.McGill.CA] <b>Im Auftrag von </b>Nishant Budhdev<br><b>Gesendet:</b> Freitag, 10. April 2015 09:37<br><b>An:</b> soot-list@cs.mcgill.ca<br><b>Betreff:</b> Re: [Soot-list] Inconsistent Line Number<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><div><p class=MsoNormal>&nbsp;public boolean onOptionsItemSelected(android.view.MenuItem)<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp;{<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; com.example.dcsnsb.testapplicationcp9.MainActivity $r0;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; android.view.MenuItem $r1;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; int $i0;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; boolean $z0;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; $r0 := @this: com.example.dcsnsb.testapplicationcp9.MainActivity;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; $r1 := @parameter0: android.view.MenuItem;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; $i0 = interfaceinvoke $r1.&lt;android.view.MenuItem: int getItemId()&gt;();<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; <b>&nbsp; &nbsp; if $i0 != 2131230787 goto label1;</b> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &lt;--<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; return 1;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp;label1:<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; $z0 = specialinvoke $r0.&lt;android.support.v7.app.ActionBarActivity: boolean onOptionsItemSelected(android.view.MenuItem)&gt;($r1);<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp;<b> &nbsp; return $z0; </b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &lt;--<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp;}<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>On Fri, Apr 10, 2015 at 3:31 PM, Nishant Budhdev &lt;<a href="mailto:nishant.budhdev@gmail.com" target="_blank">nishant.budhdev@gmail.com</a>&gt; wrote:<o:p></o:p></p><div><p class=MsoNormal>Hi,<o:p></o:p></p><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>I have the following method in my android app's main class:<o:p></o:p></p></div><div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp;public boolean onOptionsItemSelected(MenuItem item) {<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp;&nbsp;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; int id = item.getItemId();<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; if (id == R.id.action_settings) {<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return true;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; }<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; return super.onOptionsItemSelected(item);<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; }<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>The Jimple conversion for the same is:<o:p></o:p></p></div><div><div><p class=MsoNormal>&nbsp; &nbsp;public boolean onOptionsItemSelected(android.view.MenuItem)<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp;{<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; com.example.dcsnsb.testapplicationcp9.MainActivity $r0;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; android.view.MenuItem $r1;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; int $i0;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; boolean $z0;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; $r0 := @this: com.example.dcsnsb.testapplicationcp9.MainActivity;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; $r1 := @parameter0: android.view.MenuItem;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; $i0 = interfaceinvoke $r1.&lt;android.view.MenuItem: int getItemId()&gt;();<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; if $i0 != 2131230787 goto label1;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; return 1;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp;label1:<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; $z0 = specialinvoke $r0.&lt;android.support.v7.app.ActionBarActivity: boolean onOptionsItemSelected(android.view.MenuItem)&gt;($r1);<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; return $z0;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp;}<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>I am trying to get source line numbers for refactoring purposes. Usually I have been using&nbsp;getJavaSourceStartLineNumber() for this and it has worked well. However, in this scenario the line number for the lines marked with &quot;// &lt;--&quot; are shown as -1. I tried using tags and trying to go into further debugging but couldn't find anything other than null associated with those lines for line number related attributes. Is there a way in which I could all the line numbers ?<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Thanks,<o:p></o:p></p></div><div><p class=MsoNormal>Nishant<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><p class=MsoNormal><span style='border:solid windowtext 1.0pt;padding:0cm'><img border=0 width=1 height=1 id="_x0000_i1025" src="cid:image001.jpg@01D07372.D072E100" alt="Das Bild wurde vom Absender entfernt."></span><o:p></o:p></p></div></div><p class=MsoNormal><br><br clear=all><o:p></o:p></p><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><p class=MsoNormal>-- <o:p></o:p></p><div><div><p class=MsoNormal><span style='font-size:13.5pt;font-family:"Verdana","sans-serif";background:white'>Nishant Shyamal Budhdev</span><o:p></o:p></p><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal><span style='font-family:"Trebuchet MS","sans-serif";color:#999999'>Research Assistant</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Trebuchet MS","sans-serif";color:#999999'>Embedded Systems and Networking Lab</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Trebuchet MS","sans-serif";color:#999999'>School Of Computing</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Trebuchet MS","sans-serif";color:#999999'>National University of Singapore</span><o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif";color:#999999'>Contact : +65 9050 6084</span><o:p></o:p></p></div></div></div></div></div></body></html>