[devkit] PsiUtil.findNearestMethod: simplify

This commit is contained in:
Yann Cébron
2019-03-25 18:29:59 +01:00
parent 4e78768fd7
commit 496ef13b1c
@@ -141,8 +141,8 @@ public class PsiUtil {
@Nullable
public static PsiMethod findNearestMethod(String name, @Nullable PsiClass cls) {
if (cls == null) return null;
for (PsiMethod method : cls.getMethods()) {
if (method.getParameterList().isEmpty() && method.getName().equals(name)) {
for (PsiMethod method : cls.findMethodsByName(name, false)) {
if (method.getParameterList().isEmpty()) {
return method.getModifierList().hasModifierProperty(PsiModifier.ABSTRACT) ? null : method;
}
}