mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ensure var.normalizeDeclaration invoked after readOnly check
This commit is contained in:
+2
-1
@@ -100,7 +100,6 @@ public class ConvertFieldToAtomicIntention extends PsiElementBaseIntentionAction
|
||||
public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
|
||||
final PsiVariable psiVariable = getVariable(element);
|
||||
LOG.assertTrue(psiVariable != null);
|
||||
psiVariable.normalizeDeclaration();
|
||||
|
||||
final Query<PsiReference> refs = ReferencesSearch.search(psiVariable);
|
||||
|
||||
@@ -111,6 +110,8 @@ public class ConvertFieldToAtomicIntention extends PsiElementBaseIntentionAction
|
||||
}
|
||||
if (!FileModificationService.getInstance().preparePsiElementsForWrite(elements)) return;
|
||||
|
||||
psiVariable.normalizeDeclaration();
|
||||
|
||||
final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project);
|
||||
final PsiElementFactory factory = JavaPsiFacade.getElementFactory(project);
|
||||
final PsiType fromType = psiVariable.getType();
|
||||
|
||||
+1
-1
@@ -70,7 +70,6 @@ public class ConvertFieldToThreadLocalIntention extends PsiElementBaseIntentionA
|
||||
public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
|
||||
final PsiField psiField = PsiTreeUtil.getParentOfType(element, PsiField.class);
|
||||
LOG.assertTrue(psiField != null);
|
||||
psiField.normalizeDeclaration();
|
||||
final Query<PsiReference> refs = ReferencesSearch.search(psiField);
|
||||
|
||||
final Set<PsiElement> elements = new HashSet<PsiElement>();
|
||||
@@ -79,6 +78,7 @@ public class ConvertFieldToThreadLocalIntention extends PsiElementBaseIntentionA
|
||||
elements.add(reference.getElement());
|
||||
}
|
||||
if (!FileModificationService.getInstance().preparePsiElementsForWrite(elements)) return;
|
||||
psiField.normalizeDeclaration();
|
||||
|
||||
final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project);
|
||||
final PsiElementFactory factory = JavaPsiFacade.getElementFactory(project);
|
||||
|
||||
Reference in New Issue
Block a user