prefer interface as super method when class extends unrelated class and interface (IDEA-99347)

This commit is contained in:
Anna Kozlova
2013-01-21 19:11:45 +04:00
parent ac8c52cc05
commit 196ed7600d
3 changed files with 15 additions and 2 deletions
@@ -277,8 +277,8 @@ public class PsiSuperMethodImplUtil {
}
if (containingClass != null) {
if (!containingClass.isInterface()) {
return true;
if (containingClass.isInterface()) {
return false;
}
if (!aClass.isInterface() && !InheritanceUtil.isInheritorOrSelf(superClass, containingClass, true)) {
@@ -0,0 +1,12 @@
interface Errors {
java.util.Collection<java.lang.String> getErrorMessages();
}
class Test extends AbstrClass implements Errors {
}
abstract class AbstrClass {
public java.util.Collection getErrorMessages() {return null;}
}
@@ -202,6 +202,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
public void testIDEA57539() { doTest5(false); }
public void testIDEA67570() { doTest5(false); }
public void testIDEA99061() { doTest5(false); }
public void testIDEA99347() { doTest5(false); }
public void testJavaUtilCollections_NoVerify() throws Exception {
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));