diff --git a/java/java-psi-impl/src/com/intellij/codeInsight/completion/scope/CompletionElement.java b/java/java-psi-impl/src/com/intellij/codeInsight/completion/scope/CompletionElement.java index dbfaaf2a9d22..db56f2aa759e 100644 --- a/java/java-psi-impl/src/com/intellij/codeInsight/completion/scope/CompletionElement.java +++ b/java/java-psi-impl/src/com/intellij/codeInsight/completion/scope/CompletionElement.java @@ -97,15 +97,14 @@ public class CompletionElement{ Object anotherElement = another.getElement(); if (!(anotherElement instanceof PsiMethod && myElement instanceof PsiMethod)) return false; - if (isInterfaceMethod((PsiMethod)myElement) && !isInterfaceMethod((PsiMethod)anotherElement)) return false; + if (((PsiMethod)myElement).hasModifierProperty(PsiModifier.ABSTRACT) && + !((PsiMethod)anotherElement).hasModifierProperty(PsiModifier.ABSTRACT)) { + return false; + } PsiType prevType = another.getSubstitutor().substitute(((PsiMethod)anotherElement).getReturnType()); PsiType candidateType = mySubstitutor.substitute(((PsiMethod)myElement).getReturnType()); return prevType != null && candidateType != null && !prevType.equals(candidateType) && prevType.isAssignableFrom(candidateType); } - private static boolean isInterfaceMethod(PsiMethod anotherElement) { - PsiClass aClass = anotherElement.getContainingClass(); - return aClass != null && aClass.isInterface(); - } }