mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[Java. Intention Actions] Do not add implicitly declared class to import list
^IDEA-370603 fixed GitOrigin-RevId: 0cfcef57e1b1dbccea05ab68a57c8906df0e753c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
741a56017c
commit
1192817c91
@@ -1186,6 +1186,9 @@ public final class ImportHelper {
|
||||
}
|
||||
|
||||
if (refElement instanceof PsiClass psiClass) {
|
||||
// Implicitly declared classed are not accessible outside the file, so it is not possible to have import statement on them.
|
||||
if (refElement.getParent() instanceof PsiImplicitClass) continue;
|
||||
|
||||
String qName = psiClass.getQualifiedName();
|
||||
if (qName == null || hasPackage(qName, thisPackageName)) continue;
|
||||
imports.add(new Import(qName, false));
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package B;
|
||||
|
||||
public class A extends <A> {
|
||||
public A() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package B;
|
||||
|
||||
public class A extends <A> {
|
||||
public A() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -772,6 +772,8 @@ public class OptimizeImportsTest extends OptimizeImportsTestCase {
|
||||
public void testUnresolvedReferenceAfterParenthesis() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInvalidExtendsList() { doTest(); }
|
||||
|
||||
private void doTest() {
|
||||
doTest(".java");
|
||||
|
||||
Reference in New Issue
Block a user