TypeBinding originalDeclaringClass = methodBinding.declaringClass .original();
do {
if (type.isCapture()) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=285002
if (TypeBinding.equalsEquals(originalDeclaringClass, type.erasure().original())) return true;
} else {
if (TypeBinding.equalsEquals(originalDeclaringClass, type.original())) return true;
}
if (declaringPackage != type.fPackage) return false;
} while ((type = type.superclass()) != null);
return false;
}