mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-02 10:14:57 +07:00
[Java. Intention Actions] IDEA-378080 Fix exception when renaming unnamed variables as lambda parameters
GitOrigin-RevId: 2e6173d4b11962c6197ff3216b68d11bcc1b7751
This commit is contained in:
committed by
intellij-monorepo-bot
parent
740cb8a5bf
commit
84526c727c
+1
@@ -151,6 +151,7 @@ public class JavaRefactoringSupportProvider extends JavaBaseRefactoringSupportPr
|
||||
SearchScope useScope = PsiSearchHelper.getInstance(elementToRename.getProject()).getUseScope(elementToRename);
|
||||
if (!(useScope instanceof LocalSearchScope)) return false;
|
||||
PsiElement[] scopeElements = ((LocalSearchScope)useScope).getScope();
|
||||
if (scopeElements.length == 0 && elementToRename instanceof PsiVariable variable && variable.isUnnamed()) return true;
|
||||
if (scopeElements.length > 1 && // assume there are no elements with use scopes with holes in them
|
||||
!isElementWithComment(scopeElements) && // ... except a case of element and it's doc comment
|
||||
!isResourceVariable(scopeElements)) {
|
||||
|
||||
Reference in New Issue
Block a user