mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inspection view: should not return OpenFileDescriptor when psiElement is requested (EA-97956)
This commit is contained in:
@@ -967,25 +967,24 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren
|
||||
if (psiElement == null) return null;
|
||||
|
||||
final CommonProblemDescriptor problem = refElementNode.getDescriptor();
|
||||
if (problem != null) {
|
||||
if (problem instanceof ProblemDescriptor) {
|
||||
PsiElement elementFromDescriptor = ((ProblemDescriptor)problem).getPsiElement();
|
||||
if (elementFromDescriptor == null) {
|
||||
final InspectionTreeNode node = (InspectionTreeNode)refElementNode.getChildAt(0);
|
||||
if (node.isValid()) {
|
||||
return InspectionResultsViewUtil.getNavigatableForInvalidNode((ProblemDescriptionNode)node);
|
||||
}
|
||||
} else {
|
||||
psiElement = elementFromDescriptor;
|
||||
if (problem instanceof ProblemDescriptor) {
|
||||
PsiElement elementFromDescriptor = ((ProblemDescriptor)problem).getPsiElement();
|
||||
if (elementFromDescriptor == null && CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
final InspectionTreeNode node = (InspectionTreeNode)refElementNode.getChildAt(0);
|
||||
if (node.isValid()) {
|
||||
return InspectionResultsViewUtil.getNavigatableForInvalidNode((ProblemDescriptionNode)node);
|
||||
}
|
||||
}
|
||||
else {
|
||||
psiElement = elementFromDescriptor;
|
||||
}
|
||||
}
|
||||
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
return getSelectedNavigatable(problem, psiElement);
|
||||
}
|
||||
else if (CommonDataKeys.PSI_ELEMENT.is(dataId)) {
|
||||
return psiElement.isValid() ? psiElement : null;
|
||||
return psiElement != null && psiElement.isValid() ? psiElement : null;
|
||||
}
|
||||
}
|
||||
else if (selectedNode instanceof ProblemDescriptionNode && CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
|
||||
Reference in New Issue
Block a user