mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inline method: search all overriding methods
GitOrigin-RevId: 2c561e3a4a86bf6eedb69f2177ca310b2d8b1590
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d462bc773f
commit
36761cbb63
@@ -147,8 +147,14 @@ public class InlineMethodProcessor extends BaseRefactoringProcessor {
|
||||
usages.add(new UsageInfo(reference.getElement()));
|
||||
}
|
||||
|
||||
OverridingMethodsSearch.search(myMethod, myRefactoringScope, false).forEach(method -> {
|
||||
usages.add(new UsageInfo(method));
|
||||
OverridingMethodsSearch.search(myMethod, myRefactoringScope, true).forEach(method -> {
|
||||
for (HierarchicalMethodSignature signature : method.getHierarchicalMethodSignature().getSuperSignatures()) {
|
||||
if (signature.getMethod() == myMethod) {
|
||||
usages.add(new UsageInfo(method));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
+3
@@ -45,6 +45,9 @@ public final class OverridingMethodsSearch extends ExtensibleQueryFactory<PsiMet
|
||||
super(EP_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param checkDeep false means that processing would be stopped after the first found item
|
||||
*/
|
||||
@NotNull
|
||||
public static Query<PsiMethod> search(@NotNull PsiMethod method, @NotNull SearchScope scope, final boolean checkDeep) {
|
||||
if (ReadAction.compute(() -> !PsiUtil.canBeOverridden(method))) return EmptyQuery.getEmptyQuery(); // Optimization
|
||||
|
||||
@@ -14,4 +14,13 @@ class B extends A {
|
||||
class C extends B {
|
||||
@Override
|
||||
void foo() {}
|
||||
}
|
||||
|
||||
class B1 extends A {
|
||||
@Override
|
||||
void foo() {}
|
||||
|
||||
void err() {
|
||||
super.foo();
|
||||
}
|
||||
}
|
||||
@@ -11,4 +11,11 @@ class B extends A {
|
||||
class C extends B {
|
||||
@Override
|
||||
void foo() {}
|
||||
}
|
||||
|
||||
class B1 extends A {
|
||||
void foo() {}
|
||||
|
||||
void err() {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user