mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
don't override protected methods from Object in interfaces (IDEA-140804)
This commit is contained in:
@@ -920,9 +920,12 @@ public class GenericsHighlightUtil {
|
||||
}
|
||||
try {
|
||||
MethodSignatureBackedByPsiMethod superMethod = SuperMethodsSearch.search(method, null, true, false).findFirst();
|
||||
if (superMethod != null && method.getContainingClass().isInterface() && "clone".equals(superMethod.getName())) {
|
||||
final PsiClass containingClass = superMethod.getMethod().getContainingClass();
|
||||
if (containingClass != null && CommonClassNames.JAVA_LANG_OBJECT.equals(containingClass.getQualifiedName())) {
|
||||
if (superMethod != null && method.getContainingClass().isInterface()) {
|
||||
final PsiMethod psiMethod = superMethod.getMethod();
|
||||
final PsiClass containingClass = psiMethod.getContainingClass();
|
||||
if (containingClass != null &&
|
||||
CommonClassNames.JAVA_LANG_OBJECT.equals(containingClass.getQualifiedName()) &&
|
||||
psiMethod.hasModifierProperty(PsiModifier.PROTECTED)) {
|
||||
superMethod = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,4 +16,9 @@ class MyCloneable2 {
|
||||
public Object clone() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
interface MyFinalizable {
|
||||
<error descr="Method does not override method from its superclass">@Override</error> void finalize();
|
||||
@Override int hashCode();
|
||||
}
|
||||
Reference in New Issue
Block a user