sortMethodsByInheritance(l, baseClassToChild);
// Set methodDependedUpon accordingly
if (baseClassToChild) {
for (int i = 1; i < l.size(); i++) {
ITestNGMethod m1 = l.get(i - 1);
ITestNGMethod m2 = l.get(i);
if (! equalsEffectiveClass(m1, m2)) {
Utils.log("MethodInheritance", 4, m2 + " DEPENDS ON " + m1);
m2.addMethodDependedUpon(MethodHelper.calculateMethodCanonicalName(m1));
}
}
}
else {
for (int i = 0; i < l.size() - 1; i++) {
ITestNGMethod m1 = l.get(i);
ITestNGMethod m2 = l.get(i + 1);
if (! equalsEffectiveClass(m1, m2)) {
m2.addMethodDependedUpon(MethodHelper.calculateMethodCanonicalName(m1));
Utils.log("MethodInheritance", 4, m2 + " DEPENDS ON " + m1);
}
}
}
}