public boolean equals(MethodSignature method1, MethodSignature method2) {
if (!method1.getName().equals(method2.getName())) return false;
final PsiType[] parameterTypes1 = method1.getParameterTypes();
final PsiType[] parameterTypes2 = method2.getParameterTypes();
if (parameterTypes1.length != parameterTypes2.length) return false;
<BUG>PsiSubstitutor superSubstitutor = getSuperMethodSignatureSubstitutorImpl(method1, method2);
if (superSubstitutor == null) superSubstitutor = method2.getSubstitutor();
</BUG>
for (int i = 0; i < parameterTypes1.length; i++) {
<BUG>final PsiType type1 = TypeConversionUtil.erasure(method1.getSubstitutor().substitute(parameterTypes1[i]));
final PsiType type2 = TypeConversionUtil.erasure(superSubstitutor.substitute(parameterTypes2[i]));

if (!Comparing.equal(type1, type2)) return false;</BUG>
}

public boolean equals(MethodSignature method1, MethodSignature method2) {
if (!method1.getName().equals(method2.getName())) return false;
final PsiType[] parameterTypes1 = method1.getParameterTypes();
final PsiType[] parameterTypes2 = method2.getParameterTypes();
if (parameterTypes1.length != parameterTypes2.length) return false;
final PsiSubstitutor substitutor1 = method1.getSubstitutor();
final PsiSubstitutor substitutor2 = method2.getSubstitutor();
for (int i = 0; i < parameterTypes1.length; i++) {
final PsiType type1 = TypeConversionUtil.erasure(substitutor1.substitute(parameterTypes1[i]));
final PsiType type2 = TypeConversionUtil.erasure(substitutor2.substitute(parameterTypes2[i]), substitutor2);
if (!Comparing.equal(type1, type2)) return false;
}
