<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)"><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;}
/* 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;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.apple-tab-span
        {mso-style-name:apple-tab-span;}
span.E-MailFormatvorlage19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@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 Chris,<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> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>That method is apparently not implemented yet. The structure of that class is a bit strange anyway. Use getSuperclassesOf() instead, that should work and give you the same data.<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> </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> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><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>csytang<br><b>Gesendet:</b> Montag, 30. November 2015 04:09<br><b>An:</b> Soot list<br><b>Betreff:</b> [Soot-list] check override method<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>Dear all, <br> I write following piece of code to check whether a method is an override method.<o:p></o:p></span></p></div><blockquote style='border:none;border-left:solid #1010FF 1.5pt;padding:0cm 0cm 0cm 5.0pt;margin-left:0cm;margin-right:0cm'><div><p><span style='font-size:10.0pt;font-family:"Courier New"'>private boolean isoverride(SootMethod smethod, SootClass declaringClass) {<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>Hierarchy hierarchy = Scene.v().getActiveHierarchy();<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>List<SootClass> superclasses = hierarchy.getDirectSuperclassesOf(declaringClass);<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>List<SootClass> superinterfaces = hierarchy.getSuperinterfacesOf(declaringClass);<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>if(smethod.getName().equals("<init>")){<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>if(superclasses!=null){<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>if(superclasses.size()==0)<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>return false;<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>else<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>return true;<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>}<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>if(superinterfaces!=null){<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>if(superinterfaces.size()==0)<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>return false;<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>else<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>return true;<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>}<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>return false;<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>}<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>if(superclasses!=null){<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>for(SootClass cls:superclasses){<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>if(cls.getMethodByName(smethod.getName()) != null){<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>return true;<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>}<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>}<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>}<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>if(superinterfaces!=null){<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>for(SootClass cls:superinterfaces){<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>if(cls.getMethodByName(smethod.getName()) != null){<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>return true;<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>}<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>}<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>}<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>return false;<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>}<o:p></o:p></span></p></div></blockquote><div><p><span style='font-size:10.0pt;font-family:"Courier New"'>When I run this code, <o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>It crashed with annotation:<o:p></o:p></span></p><blockquote style='border:none;border-left:solid #1010FF 1.5pt;padding:0cm 0cm 0cm 5.0pt;margin-left:0cm;margin-right:0cm'><p><span style='font-size:10.0pt;font-family:"Courier New"'>java.lang.RuntimeException: Not implemented yet!<o:p></o:p></span></p></blockquote><p><span style='font-size:10.0pt;font-family:"Courier New"'>for statment List<SootClass> superclasses = hierarchy.getDirectSuperclassesOf(declaringClass);<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>Thanks<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>Best<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>Chris.<o:p></o:p></span></p></div></div></body></html>