mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
IDEA-357785 Internal error when I use stream debugger
GitOrigin-RevId: 4e7c840c21ffe317b94f3e0dde49ec8fa66a3521
This commit is contained in:
committed by
intellij-monorepo-bot
parent
05a25190f1
commit
d4f875f8c3
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||||
package com.intellij.refactoring.extractMethodObject;
|
package com.intellij.refactoring.extractMethodObject;
|
||||||
|
|
||||||
import com.intellij.ide.highlighter.JavaFileType;
|
import com.intellij.ide.highlighter.JavaFileType;
|
||||||
@@ -88,9 +88,16 @@ final class ExtractGeneratedClassUtil {
|
|||||||
private static boolean isPublic(@NotNull PsiImportStaticStatement staticImport) {
|
private static boolean isPublic(@NotNull PsiImportStaticStatement staticImport) {
|
||||||
PsiClass targetClass = staticImport.resolveTargetClass();
|
PsiClass targetClass = staticImport.resolveTargetClass();
|
||||||
if (targetClass != null && isPublicClass(targetClass)) {
|
if (targetClass != null && isPublicClass(targetClass)) {
|
||||||
PsiElement importedElement = staticImport.resolve();
|
PsiJavaCodeReferenceElement reference = staticImport.getImportReference();
|
||||||
if (importedElement instanceof PsiModifierListOwner) {
|
if (reference != null) {
|
||||||
return ((PsiModifierListOwner)importedElement).hasModifierProperty(PsiModifier.PUBLIC);
|
JavaResolveResult[] targets = reference.multiResolve(false);
|
||||||
|
for (JavaResolveResult target : targets) {
|
||||||
|
PsiElement importedElement = target.getElement();
|
||||||
|
if (importedElement instanceof PsiModifierListOwner &&
|
||||||
|
((PsiModifierListOwner)importedElement).hasModifierProperty(PsiModifier.PUBLIC)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user