SootMethod method = concreteType.getMethodUnsafe(methodSig); if (method != null) { if (isVisible(concreteType, m)) { if (method.isAbstract()) { throw new RuntimeException("abstract dispatch resolved to abstract method!\nAbstract Type: " + abstractType
/** * Given an object of actual type C (o = new C()), returns the method which will be called on an o.f() invocation. */ public SootMethod resolveConcreteDispatch(SootClass concreteType, SootMethod m) { concreteType.checkLevel(SootClass.HIERARCHY); if (concreteType.isInterface()) { throw new RuntimeException("A concrete type cannot be an interface: " + concreteType); } String methodSig = m.getSubSignature(); while (true) { SootMethod method = concreteType.getMethodUnsafe(methodSig); if (method != null) { if (isVisible(concreteType, m)) { if (method.isAbstract()) { throw new RuntimeException("Error: Method call resolves to abstract method!"); } return method; } } concreteType = concreteType.getSuperclassUnsafe(); if (concreteType == null) { break; } } // When there is no proper dispatch found, we simply return null to let // the caller decide what to do return null; // throw new RuntimeException("could not resolve concrete // dispatch!\nType: "+concreteType+"\nMethod: "+m); }
throw new RuntimeException("abstract dispatch resolved to abstract method!\nAbstract Type: "+abstractType+"\nConcrete Type: "+savedConcreteType+"\nMethod: "+m); if( isVisible( concreteType, m ) ) { ret.add( concreteType.getMethod( methodSig ) ); break;
throw new RuntimeException("abstract dispatch resolved to abstract method!\nAbstract Type: "+abstractType+"\nConcrete Type: "+savedConcreteType+"\nMethod: "+m); if( isVisible( concreteType, m ) ) { ret.add( concreteType.getMethod( methodSig ) ); break;
/** Given an object of actual type C (o = new C()), returns the method which will be called on an o.f() invocation. */ public SootMethod resolveConcreteDispatch(SootClass concreteType, SootMethod m) { concreteType.checkLevel(SootClass.HIERARCHY); if( concreteType.isInterface() ) { throw new RuntimeException( "A concrete type cannot be an interface: "+concreteType ); } String methodSig = m.getSubSignature(); while( true ) { if( concreteType.declaresMethod( methodSig ) ) { if( isVisible( concreteType, m ) ) { SootMethod method = concreteType.getMethod( methodSig ); if(method.isAbstract()) { throw new RuntimeException("Error: Method call resolves to abstract method!"); } return method; } } if( !concreteType.hasSuperclass() ) break; concreteType = concreteType.getSuperclass(); } // When there is no proper dispatch found, we simply return null to let the caller decide what to do return null; // throw new RuntimeException("could not resolve concrete dispatch!\nType: "+concreteType+"\nMethod: "+m); }
/** Given an object of actual type C (o = new C()), returns the method which will be called on an o.f() invocation. */ public SootMethod resolveConcreteDispatch(SootClass concreteType, SootMethod m) { concreteType.checkLevel(SootClass.HIERARCHY); if( concreteType.isInterface() ) { throw new RuntimeException( "A concrete type cannot be an interface: "+concreteType ); } String methodSig = m.getSubSignature(); while( true ) { if( concreteType.declaresMethod( methodSig ) ) { if( isVisible( concreteType, m ) ) { SootMethod method = concreteType.getMethod( methodSig ); if(method.isAbstract()) { throw new RuntimeException("Error: Method call resolves to abstract method!"); } return method; } } if( !concreteType.hasSuperclass() ) break; concreteType = concreteType.getSuperclass(); } // When there is no proper dispatch found, we simply return null to let the caller decide what to do return null; // throw new RuntimeException("could not resolve concrete dispatch!\nType: "+concreteType+"\nMethod: "+m); }