[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Method Dispatch



I was wondering how I would take an object that I already have found has a
clone method and attach the clone method to it.

Currently I have found the type and have the method clone

	AssignStmt assign_statement = (JAssignStmt)next_statement;	  
	  Value statement_rhs = assign_statement.getRightOp();
	  Type type = statement_rhs.getType();

I also got the type from SootClass sootclass

String stryingtype = type.toString();
Scene.v().getSootClass(stringtype);

but I am not sure how to get the Object out of an Assignment Statement and
then connect the .clone to the Object.

I have also created a SootMethod

SootMethod sootmethod = sootclass.getMethodByName("clone");

To Sum up, is there anyway to take get an Object from an AssignStmt and
attach a .clone() to it?

Thanks
Chris Howell