[Soot-list] declared methods

Eugen Zalinescu eugen.zalinescu at gmail.com
Thu Sep 15 11:41:15 EDT 2016


Hello,

I have the following file Goo.java:
class A {
    public String m() { return "aa"; }
}
class B extends A {}
class C extends B  {
    public String m() { return "cc"; }
}
public class Goo extends C {}

I have a small Soot based application in which I make A, B, C, and Goo
application classes, and for each of them I call
c.declaresMethodByName("m"), and if it returns true, then I print its
units. I obtain the following output:

Goo: is declared? true
Units: (soot.jimple.internal.JIdentityStmt):  r0 := @this: Goo
Units: (soot.jimple.internal.JAssignStmt):  $r1 = specialinvoke r0.<C:
java.lang.String m()>()
Units: (soot.jimple.internal.JReturnStmt):  return $r1
A: is declared? true
Units: (soot.jimple.internal.JIdentityStmt):  r0 := @this: A
Units: (soot.jimple.internal.JReturnStmt):  return "aa"
B: is declared? false
C: is declared? true
Units: (soot.jimple.internal.JIdentityStmt):  r0 := @this: C
Units: (soot.jimple.internal.JReturnStmt):  return "cc"


My question is then why it is considered that m is declared in Goo but not
in B?

Thank you,
Eugen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20160915/56bc4ccd/attachment.html 


More information about the Soot-list mailing list