mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-224600 Order of Types in Method Hierarchy is not correct.
GitOrigin-RevId: e8f9ae4f9406f9ce513bd396cfc3078a2d7268f9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b5044991da
commit
e9e57efef9
+1
-1
@@ -58,7 +58,7 @@ public final class MethodHierarchyTreeStructure extends HierarchyTreeStructure {
|
||||
while (true) {
|
||||
PsiMethod superMethod = ArrayUtil.getFirstElement(method.findSuperMethods());
|
||||
if (superMethod == null || superClasses.contains(superMethod.getContainingClass())) break;
|
||||
superClasses.addAll(findInheritanceChain(method.getContainingClass(), superMethod.getContainingClass()));
|
||||
superClasses.addAll(0, findInheritanceChain(method.getContainingClass(), superMethod.getContainingClass()));
|
||||
method = superMethod;
|
||||
}
|
||||
return superClasses;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
<node text="C ()">
|
||||
<node text="A ()">
|
||||
<node text="B ()">
|
||||
<node text="A ()">
|
||||
<node text="C ()">
|
||||
<node text="D ()" base="true"/>
|
||||
</node>
|
||||
</node>
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<node text="A ()">
|
||||
<node text="B ()">
|
||||
<node text="C ()" base="true"/>
|
||||
</node>
|
||||
</node>
|
||||
@@ -0,0 +1,14 @@
|
||||
interface A {
|
||||
public void foo();
|
||||
}
|
||||
class B implements A {
|
||||
@Override
|
||||
public void foo() {}
|
||||
}
|
||||
|
||||
class C extends B {
|
||||
@Override
|
||||
public void foo() {
|
||||
System.out.println("C.foo");
|
||||
}
|
||||
}
|
||||
@@ -72,6 +72,10 @@ public class JavaMethodHierarchyTest extends HierarchyViewTestBase {
|
||||
doTest("D", "foo", "X.java");
|
||||
}
|
||||
|
||||
public void testExtendsImplementsChain() throws Exception {
|
||||
doTest("C", "foo", "X.java");
|
||||
}
|
||||
|
||||
private void doTest(final String classFqn, final String methodName, final String... fileNames) throws Exception {
|
||||
doHierarchyTest(() -> {
|
||||
final PsiClass psiClass = JavaPsiFacade.getInstance(getProject()).findClass(classFqn, ProjectScope.getProjectScope(getProject()));
|
||||
|
||||
Reference in New Issue
Block a user