mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[devkit] PsiUtil.findNearestMethod: simplify
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user