mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-highlighting] IDEA-340074 Return name for classes inside implicit classes
- fix Make static incorrect works with classes inside implicitly declared classes GitOrigin-RevId: a16063a97735065761868d4e3da68220293a4d51
This commit is contained in:
committed by
intellij-monorepo-bot
parent
91cf1947e4
commit
6a7355dae7
@@ -156,6 +156,8 @@ public class PsiClassImpl extends JavaStubPsiElement<PsiClassStub<?>> implements
|
||||
return StringUtil.getQualifiedName(((PsiJavaFile)parent).getPackageName(), StringUtil.notNullize(getName()));
|
||||
}
|
||||
if (parent instanceof PsiClass) {
|
||||
//it cannot be referenced outside ImplicitClass
|
||||
if (parent instanceof PsiImplicitClass) return StringUtil.notNullize(getName());
|
||||
String parentQName = ((PsiClass)parent).getQualifiedName();
|
||||
if (parentQName == null) return null;
|
||||
return StringUtil.getQualifiedName(parentQName, StringUtil.notNullize(getName()));
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
private static class Nested {
|
||||
}
|
||||
|
||||
void main() {
|
||||
new Nested();
|
||||
}
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
private class <warning descr="Inner class 'Nested' may be 'static'">N<caret>ested</warning> {
|
||||
}
|
||||
|
||||
void main() {
|
||||
new Nested();
|
||||
}
|
||||
|
||||
@@ -30,6 +30,13 @@ public class InnerClassMayBeStaticInspectionTest extends LightJavaInspectionTest
|
||||
});
|
||||
}
|
||||
|
||||
public void testImplicitClassNoFix() {
|
||||
IdeaTestUtil.withLevel(getModule(), LanguageLevel.JDK_21_PREVIEW, () -> {
|
||||
doTest();
|
||||
checkQuickFixAll();
|
||||
});
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected InspectionProfileEntry getInspection() {
|
||||
|
||||
Reference in New Issue
Block a user