[Soot-list] check override method
Steven Arzt
Steven.Arzt at cased.de
Fri Dec 11 10:49:16 EST 2015
Hi Chris,
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.
Best regards,
Steven
Von: soot-list-bounces at CS.McGill.CA [mailto:soot-list-bounces at CS.McGill.CA] Im Auftrag von csytang
Gesendet: Montag, 30. November 2015 04:09
An: Soot list
Betreff: [Soot-list] check override method
Dear all,
I write following piece of code to check whether a method is an override method.
private boolean isoverride(SootMethod smethod, SootClass declaringClass) {
Hierarchy hierarchy = Scene.v().getActiveHierarchy();
List<SootClass> superclasses = hierarchy.getDirectSuperclassesOf(declaringClass);
List<SootClass> superinterfaces = hierarchy.getSuperinterfacesOf(declaringClass);
if(smethod.getName().equals("<init>")){
if(superclasses!=null){
if(superclasses.size()==0)
return false;
else
return true;
}
if(superinterfaces!=null){
if(superinterfaces.size()==0)
return false;
else
return true;
}
return false;
}
if(superclasses!=null){
for(SootClass cls:superclasses){
if(cls.getMethodByName(smethod.getName()) != null){
return true;
}
}
}
if(superinterfaces!=null){
for(SootClass cls:superinterfaces){
if(cls.getMethodByName(smethod.getName()) != null){
return true;
}
}
}
return false;
}
When I run this code,
It crashed with annotation:
java.lang.RuntimeException: Not implemented yet!
for statment List<SootClass> superclasses = hierarchy.getDirectSuperclassesOf(declaringClass);
Thanks
Best
Chris.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20151211/78128682/attachment.html
More information about the Soot-list
mailing list