[Soot-list] check override method
csytang
csytang at comp.polyu.edu.hk
Sun Nov 29 22:09:11 EST 2015
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/20151130/53472a8b/attachment.html
More information about the Soot-list
mailing list