import edu.neu.ccs.demeterf.*; import edu.neu.ccs.demeter.Ident; public class MethodCheck extends IDb{ ClassDefList cdl; MethodCheck(ClassDefList c){ cdl = c; } Boolean combine(MethodDef m, TypeName ret, TypeName arg){ // Your code replaces the following line // Your code will use the ClassDefList // which is the class graph information return true; } // r for MethodList Boolean combine(FuncDef f, Boolean r){ return r; } // f for first, r for rest Boolean combine(MethodCons c, Boolean f, Boolean r){ return f&&r; } // default if MethodList-object is empty Boolean combine(MethodEmpty e){ return true; } } // your code: for checking the transformation X->Y: // implement the following pseudo code // Find all fields -> *,*,S // help: a "universal" traversal that goes everywhere will do this // use above: new Traversal(new ApplyCheck(...) .traverse(cdl) // use the following combine method in ApplyCheck: // Boolean combine(Field f, Object id, TypeName type){ // // If (X <= "class with name type") // // return (Y <= "class with name type"); // // return true; // on other nodes let the Booleans bubble up.