really search for private class inheritors outside the current file (IDEA-167877)

This commit is contained in:
peter
2017-02-14 18:19:33 +01:00
parent 2b674bf37e
commit 4f45117015
5 changed files with 29 additions and 6 deletions
@@ -282,6 +282,18 @@ public class GotoImplementationHandlerTest extends JavaCodeInsightFixtureTestCas
assertEquals(1, impls.length);
}
public void testPrivateClassInheritors() {
PsiFile file = myFixture.addFileToProject("Foo.java",
"class C {\n" +
" private static class Pr<caret>ivate {}\n" +
" public static class Public extends Private {}" +
"}");
myFixture.addClass("class Inheritor extends C.Public {}");
myFixture.configureFromExistingVirtualFile(file.getVirtualFile());
assertSize(2, getTargets(file));
}
private PsiElement[] getTargets(PsiFile file) {
GotoTargetHandler.GotoData gotoData = CodeInsightTestUtil.gotoImplementation(myFixture.getEditor(), file);
assertNotNull(gotoData);