public static void methodPartialUpdate(Graph graph, MethodDefNode node, DynamicMethod newMethod, DynamicMethod oldMethod, IRubyObject receiver) {
if (newMethod instanceof Method && oldMethod instanceof Method) {
Method newmeth = (Method) newMethod;
Method oldmeth = (Method) oldMethod;
NodeDiff nodeDiff = graph.getNodeDiff();
if (nodeDiff != null
&& nodeDiff.noDiff(node.getArgsNode(), oldmeth.getArgsNode())
&& nodeDiff.noDiff(node.getBodyNode(), oldmeth.getBodyNode())) { // XXX nested class, defn
// FIXME annotation diff
newmeth.shareTemplates(oldmeth);
} else {
Logger.debug(SourceLocation.of(node), "templates not shared: %s", newmeth);
}