mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
skip inaccessible duplicates (IDEA-75520)
This commit is contained in:
@@ -583,7 +583,7 @@ public class DuplicatesFinder {
|
||||
}
|
||||
}
|
||||
|
||||
if (class2 != null) {
|
||||
if (class2 != null && PsiUtil.isAccessible(method1, class2, null)) {
|
||||
final PsiMethod[] methods = class2.getAllMethods();
|
||||
if (ArrayUtil.find(methods, method1) != -1) return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
class B {
|
||||
private void <caret>g() {
|
||||
f();
|
||||
}
|
||||
|
||||
private void f() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class C extends B {
|
||||
private void g() {
|
||||
f();
|
||||
}
|
||||
|
||||
private void f() {
|
||||
}
|
||||
}
|
||||
@@ -85,4 +85,8 @@ public class FindMethodDuplicatesMiscTest extends FindMethodDuplicatesBaseTest {
|
||||
public void testVarVarargsAccess() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSkipNotAccessible() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user