mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 10:48:09 +07:00
empty method: ensure super call is not removed if unrelated defaults are present (IDEA-202410)
This commit is contained in:
@@ -566,11 +566,18 @@ public class RefJavaUtilImpl extends RefJavaUtil {
|
||||
|
||||
if (hasStatements) {
|
||||
final PsiMethod[] superMethods = javaMethod.findSuperMethods();
|
||||
int defaultCount = 0;
|
||||
for (PsiMethod superMethod : superMethods) {
|
||||
if (VisibilityUtil.compare(VisibilityUtil.getVisibilityModifier(superMethod.getModifierList()),
|
||||
VisibilityUtil.getVisibilityModifier(javaMethod.getModifierList())) > 0) {
|
||||
return false;
|
||||
}
|
||||
if (superMethod.hasModifierProperty(PsiModifier.DEFAULT)) {
|
||||
defaultCount++;
|
||||
}
|
||||
}
|
||||
if (defaultCount > 1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return hasStatements;
|
||||
|
||||
Reference in New Issue
Block a user