From fd84c1e0c9ddde9a00de3a916b7d36ce53a9ba29 Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko Date: Sat, 15 Apr 2023 18:32:51 +0300 Subject: [PATCH 1/2] 1306: Must not start write action from within read action in the other thread - fix --- .../inspections/php/fix/PhpModuleNameQuickFix.java | 8 +------- .../inspections/xml/fix/XmlModuleNameQuickFix.java | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/com/magento/idea/magento2plugin/inspections/php/fix/PhpModuleNameQuickFix.java b/src/com/magento/idea/magento2plugin/inspections/php/fix/PhpModuleNameQuickFix.java index 02b9b4ba5..30a425a80 100644 --- a/src/com/magento/idea/magento2plugin/inspections/php/fix/PhpModuleNameQuickFix.java +++ b/src/com/magento/idea/magento2plugin/inspections/php/fix/PhpModuleNameQuickFix.java @@ -7,7 +7,6 @@ import com.intellij.codeInspection.LocalQuickFix; import com.intellij.codeInspection.ProblemDescriptor; -import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.project.Project; import com.jetbrains.php.lang.psi.elements.StringLiteralExpression; import com.magento.idea.magento2plugin.bundles.InspectionBundle; @@ -42,11 +41,6 @@ public void applyFix( } private void applyFix(final StringLiteralExpression expression) { - WriteCommandAction.writeCommandAction( - expression.getManager().getProject(), - expression.getContainingFile() - ).run(() -> - expression.updateText(expectedModuleName) - ); + expression.updateText(expectedModuleName); } } diff --git a/src/com/magento/idea/magento2plugin/inspections/xml/fix/XmlModuleNameQuickFix.java b/src/com/magento/idea/magento2plugin/inspections/xml/fix/XmlModuleNameQuickFix.java index f575a3efb..bdd023f1e 100644 --- a/src/com/magento/idea/magento2plugin/inspections/xml/fix/XmlModuleNameQuickFix.java +++ b/src/com/magento/idea/magento2plugin/inspections/xml/fix/XmlModuleNameQuickFix.java @@ -7,7 +7,6 @@ import com.intellij.codeInspection.LocalQuickFix; import com.intellij.codeInspection.ProblemDescriptor; -import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.project.Project; import com.intellij.psi.xml.XmlAttribute; import com.intellij.psi.xml.XmlAttributeValue; @@ -42,12 +41,7 @@ public void applyFix( } private void applyFix(final XmlAttributeValue value) { - WriteCommandAction.writeCommandAction( - value.getManager().getProject(), - value.getContainingFile() - ).run(() -> - doFix(value) - ); + doFix(value); } protected void doFix( From 7c0e1fc5d12977c0514d523c193e3f728c41e11f Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko Date: Sat, 15 Apr 2023 18:43:57 +0300 Subject: [PATCH 2/2] 1306: Updated CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6cc12faa..ed123760c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0). ### Fixed - java.lang.NoClassDefFoundError: org/codehaus/plexus/util/StringUtils [#1530](https://github.com/magento/magento2-phpstorm-plugin/pull/1530) +- java.lang.Throwable: Must not start write action from within read action in the other thread - deadlock is coming [#1531](https://github.com/magento/magento2-phpstorm-plugin/pull/1531) ## 5.1.0