OPENIDE fix some problems from static analyser

(cherry picked from commit 0f1d91d293)
(cherry picked from commit 49cd46e3b3)
This commit is contained in:
Nikita Iarychenko
2025-12-15 12:54:03 +04:00
parent c4076eca4c
commit 5365eb173a
11 changed files with 57 additions and 6 deletions
@@ -1,4 +1,7 @@
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
//
// Modified by Nikita Iarychenko at 2025 as part of the OpenIDE project(https://openide.ru).
// Any modifications are available on the same license terms as the original source code.
package com.intellij.refactoring.introduceVariable;
import com.intellij.codeInsight.CodeInsightUtil;
@@ -372,6 +375,7 @@ public abstract class IntroduceVariableBase extends IntroduceHandlerBase {
final PsiFile file = anchorStatement.getContainingFile();
IntroduceVariableUtil.LOG.assertTrue(file != null, "expr.getContainingFile() == null");
final PsiElement nameSuggestionContext = editor == null ? null : file.findElementAt(editor.getCaretModel().getOffset());
if (editor == null) return false;
final RefactoringSupportProvider supportProvider = LanguageRefactoringSupport.getInstance().forContext(expr);
final boolean isInplaceAvailableOnDataContext =
supportProvider != null &&