From 33ab2e75beb28a33bfb1c593a2e601e83dc50e7c Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Wed, 9 Nov 2016 16:36:55 +0100 Subject: [PATCH] =?UTF-8?q?do=20not=20init=20project=20inspection=20profil?= =?UTF-8?q?e=20on=20updateProfile=20=E2=80=94=20it=20will=20be=20done=20in?= =?UTF-8?q?=20any=20case=20(was=20already=20discussed=20and=20confirmed,?= =?UTF-8?q?=20this=20part=20of=20code=20was=20not=20updated)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../util/SpecialAnnotationsUtilBase.java | 5 +---- .../javaDoc/JavaDocLocalInspection.java | 9 +++++---- .../highlighting/MisspelledHeaderInspection.java | 9 +++++---- .../intellij/codeInspection/ModifiableModel.java | 9 +++++---- .../codeInspection/ex/InspectionProfileImpl.java | 8 ++++---- .../BaseInspectionProfileManager.kt | 6 ++---- .../codeInspection/InspectionProfileManager.java | 2 +- .../ProjectInspectionProfileManager.kt | 6 ------ .../ex/ApplicationInspectionProfileManager.java | 13 +------------ .../ui/SingleInspectionProfilePanel.java | 8 ++++---- .../SuppressionAnnotationInspection.java | 13 +++++-------- .../inspection/DependsOnGroupsInspection.java | 11 +++++++---- .../actions/CCChangeCourseInfo.java | 4 +--- .../rest/quickfixes/AddIgnoredRoleFix.java | 5 +---- .../PyPackageRequirementsInspection.java | 16 ++++++---------- 15 files changed, 48 insertions(+), 76 deletions(-) diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/util/SpecialAnnotationsUtilBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/util/SpecialAnnotationsUtilBase.java index dff7bdb91b7d..652d3dc5c2ca 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/util/SpecialAnnotationsUtilBase.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/util/SpecialAnnotationsUtilBase.java @@ -16,13 +16,11 @@ package com.intellij.codeInspection.util; import com.intellij.codeInsight.AnnotationUtil; -import com.intellij.codeInspection.InspectionProfile; import com.intellij.codeInspection.LocalQuickFix; import com.intellij.codeInspection.ProblemDescriptor; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.text.StringUtil; import com.intellij.profile.codeInspection.InspectionProfileManager; -import com.intellij.profile.codeInspection.InspectionProjectProfileManager; import com.intellij.psi.PsiAnnotation; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiModifierList; @@ -63,11 +61,10 @@ public class SpecialAnnotationsUtilBase { static void doQuickFixInternal(@NotNull Project project, @NotNull List targetList, @NotNull String qualifiedName) { targetList.add(qualifiedName); Collections.sort(targetList); - final InspectionProfile inspectionProfile = InspectionProjectProfileManager.getInstance(project).getCurrentProfile(); //correct save settings //TODO lesya - InspectionProfileManager.getInstance().fireProfileChanged(inspectionProfile); + InspectionProfileManager.getInstance().fireProfileChanged(InspectionProfileManager.getInstance(project).getCurrentProfile()); /* try { inspectionProfile.save(); diff --git a/java/java-impl/src/com/intellij/codeInspection/javaDoc/JavaDocLocalInspection.java b/java/java-impl/src/com/intellij/codeInspection/javaDoc/JavaDocLocalInspection.java index ad65bed44e79..9be4a0ae5ea6 100644 --- a/java/java-impl/src/com/intellij/codeInspection/javaDoc/JavaDocLocalInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/javaDoc/JavaDocLocalInspection.java @@ -6,13 +6,15 @@ package com.intellij.codeInspection.javaDoc; import com.intellij.codeInsight.FileModificationService; import com.intellij.codeInsight.daemon.QuickFixBundle; import com.intellij.codeInsight.intention.impl.AddJavadocIntention; -import com.intellij.codeInspection.*; +import com.intellij.codeInspection.InspectionsBundle; +import com.intellij.codeInspection.LocalQuickFix; +import com.intellij.codeInspection.LocalQuickFixAndIntentionActionOnPsiElement; +import com.intellij.codeInspection.ProblemDescriptor; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; import com.intellij.pom.Navigatable; import com.intellij.profile.codeInspection.InspectionProfileManager; -import com.intellij.profile.codeInspection.InspectionProjectProfileManager; import com.intellij.psi.*; import com.intellij.psi.javadoc.PsiDocComment; import com.intellij.psi.javadoc.PsiDocTag; @@ -397,8 +399,7 @@ public class JavaDocLocalInspection extends JavaDocLocalInspectionBase { @Override public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) { myInspection.registerAdditionalTag(myTag); - InspectionProfile profile = InspectionProjectProfileManager.getInstance(project).getCurrentProfile(); - InspectionProfileManager.getInstance().fireProfileChanged(profile); + InspectionProfileManager.getInstance().fireProfileChanged(InspectionProfileManager.getInstance(project).getCurrentProfile()); } @Override diff --git a/java/manifest/src/org/jetbrains/lang/manifest/highlighting/MisspelledHeaderInspection.java b/java/manifest/src/org/jetbrains/lang/manifest/highlighting/MisspelledHeaderInspection.java index 868675c186b9..ef8b228f4399 100644 --- a/java/manifest/src/org/jetbrains/lang/manifest/highlighting/MisspelledHeaderInspection.java +++ b/java/manifest/src/org/jetbrains/lang/manifest/highlighting/MisspelledHeaderInspection.java @@ -24,11 +24,13 @@ */ package org.jetbrains.lang.manifest.highlighting; -import com.intellij.codeInspection.*; +import com.intellij.codeInspection.LocalInspectionTool; +import com.intellij.codeInspection.LocalQuickFix; +import com.intellij.codeInspection.ProblemHighlightType; +import com.intellij.codeInspection.ProblemsHolder; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.text.StringUtil; import com.intellij.profile.codeInspection.InspectionProfileManager; -import com.intellij.profile.codeInspection.InspectionProjectProfileManager; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.PsiFile; @@ -184,8 +186,7 @@ public class MisspelledHeaderInspection extends LocalInspectionTool { public void invoke(@NotNull Project project, @NotNull PsiFile file, @NotNull PsiElement startElement, @NotNull PsiElement endElement) { myHeaders.add(myHeaderName); - InspectionProfile profile = InspectionProjectProfileManager.getInstance(project).getCurrentProfile(); - InspectionProfileManager.getInstance().fireProfileChanged(profile); + InspectionProfileManager.getInstance().fireProfileChanged(InspectionProfileManager.getInstance(project).getCurrentProfile()); } } } diff --git a/platform/analysis-api/src/com/intellij/codeInspection/ModifiableModel.java b/platform/analysis-api/src/com/intellij/codeInspection/ModifiableModel.java index b000935f828d..fd14a1c315da 100644 --- a/platform/analysis-api/src/com/intellij/codeInspection/ModifiableModel.java +++ b/platform/analysis-api/src/com/intellij/codeInspection/ModifiableModel.java @@ -25,8 +25,6 @@ import com.intellij.psi.search.scope.packageSet.NamedScope; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.io.IOException; - /** * User: anna * Date: 15-Feb-2006 @@ -39,10 +37,13 @@ public interface ModifiableModel extends InspectionProfile { void setErrorLevel(HighlightDisplayKey key, @NotNull HighlightDisplayLevel level, Project project); + @Override HighlightDisplayLevel getErrorLevel(HighlightDisplayKey inspectionToolKey, PsiElement element); + @Override boolean isToolEnabled(HighlightDisplayKey key); + @Override boolean isToolEnabled(@Nullable HighlightDisplayKey key, @Nullable PsiElement element); void commit(); @@ -57,8 +58,10 @@ public interface ModifiableModel extends InspectionProfile { void resetToEmpty(Project project); + @Override InspectionProfileEntry getUnwrappedTool(@NotNull String shortName, @NotNull PsiElement element); + @Override InspectionToolWrapper[] getInspectionTools(PsiElement element); /** @@ -66,8 +69,6 @@ public interface ModifiableModel extends InspectionProfile { */ void setSingleTool(@NotNull String toolShortName); - void save() throws IOException; - boolean isProfileLocked(); void lockProfile(boolean isLocked); diff --git a/platform/analysis-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java b/platform/analysis-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java index 93dbcf49ceaa..c68be92f8f9f 100644 --- a/platform/analysis-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java +++ b/platform/analysis-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java @@ -458,10 +458,10 @@ public class InspectionProfileImpl extends NewInspectionProfile { return result; } - @Override - public void save() { - InspectionProfileManager.getInstance().fireProfileChanged(this); - } + //@Override + //public void save() { + // InspectionProfileManager.getInstance().fireProfileChanged(this); + //} @Nullable @Override diff --git a/platform/analysis-impl/src/com/intellij/profile/codeInspection/BaseInspectionProfileManager.kt b/platform/analysis-impl/src/com/intellij/profile/codeInspection/BaseInspectionProfileManager.kt index 1979c646b181..3acb78ac4e26 100644 --- a/platform/analysis-impl/src/com/intellij/profile/codeInspection/BaseInspectionProfileManager.kt +++ b/platform/analysis-impl/src/com/intellij/profile/codeInspection/BaseInspectionProfileManager.kt @@ -51,10 +51,8 @@ abstract class BaseInspectionProfileManager(messageBus: MessageBus) : Inspectio } } - override final fun fireProfileChanged(profile: InspectionProfile?) { - if (profile is InspectionProfileImpl) { - profile.profileChanged() - } + override final fun fireProfileChanged(profile: InspectionProfileImpl?) { + profile?.profileChanged() for (adapter in profileListeners) { adapter.profileChanged(profile) } diff --git a/platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProfileManager.java b/platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProfileManager.java index 8e7d69e9c9d5..95a4ea3bc883 100644 --- a/platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProfileManager.java +++ b/platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProfileManager.java @@ -48,7 +48,7 @@ public interface InspectionProfileManager { return InspectionProjectProfileManager.getInstance(project); } - void fireProfileChanged(@Nullable InspectionProfile profile); + void fireProfileChanged(@Nullable InspectionProfileImpl profile); void fireProfileChanged(@Nullable InspectionProfile oldProfile, @NotNull InspectionProfile profile); diff --git a/platform/analysis-impl/src/com/intellij/profile/codeInspection/ProjectInspectionProfileManager.kt b/platform/analysis-impl/src/com/intellij/profile/codeInspection/ProjectInspectionProfileManager.kt index 65aca91ca031..d5bdc1713438 100644 --- a/platform/analysis-impl/src/com/intellij/profile/codeInspection/ProjectInspectionProfileManager.kt +++ b/platform/analysis-impl/src/com/intellij/profile/codeInspection/ProjectInspectionProfileManager.kt @@ -161,12 +161,6 @@ class ProjectInspectionProfileManager(val project: Project, fun isCurrentProfileInitialized() = currentProfile.wasInitialized() - @Synchronized override fun updateProfile(profile: InspectionProfileImpl) { - super.updateProfile(profile) - - profile.initInspectionTools(project) - } - override fun schemeRemoved(scheme: InspectionProfile) { scheme.cleanup(project) } diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/ApplicationInspectionProfileManager.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/ApplicationInspectionProfileManager.java index 5369ddebe335..b9c0b001ee75 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/ApplicationInspectionProfileManager.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/ApplicationInspectionProfileManager.java @@ -93,6 +93,7 @@ public class ApplicationInspectionProfileManager extends BaseInspectionProfileMa return fileNameWithoutExtension; } + @Override @NotNull public InspectionProfileImpl createScheme(@NotNull SchemeDataHolder dataHolder, @NotNull String name, @@ -203,18 +204,6 @@ public class ApplicationInspectionProfileManager extends BaseInspectionProfileMa return getProfile(path, false); } - @Override - public void updateProfile(@NotNull InspectionProfileImpl profile) { - super.updateProfile(profile); - updateProfileImpl(profile); - } - - private static void updateProfileImpl(@NotNull InspectionProfileImpl profile) { - for (Project project : ProjectManager.getInstance().getOpenProjects()) { - profile.initInspectionTools(project); - } - } - @Nullable @Override public Element getState() { diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java index 99be2c516e2f..478384155d97 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java @@ -1126,12 +1126,12 @@ public class SingleInspectionProfilePanel extends JPanel { if (parentProfile.getProfileManager().getProfile(parentProfile.getName(), false) == parentProfile) { parentProfile.getProfileManager().deleteProfile(parentProfile.getName()); } - if (selectedProfile.getProfileManager() != profileManager) { - copyUsedSeveritiesIfUndefined(selectedProfile, profileManager); - selectedProfile.setProfileManager(profileManager); + if (selectedProfile.getProfileManager() == profileManager) { + profileManager.updateProfile(selectedProfile); } else { - selectedProfile.getProfileManager().updateProfile(selectedProfile); + copyUsedSeveritiesIfUndefined(selectedProfile, profileManager); + selectedProfile.setProfileManager(profileManager); } selectedProfile.commit(); diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/maturity/SuppressionAnnotationInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/maturity/SuppressionAnnotationInspection.java index 2a42fa12610a..aa987c7db9ae 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/maturity/SuppressionAnnotationInspection.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/maturity/SuppressionAnnotationInspection.java @@ -15,12 +15,14 @@ */ package com.siyeh.ig.maturity; -import com.intellij.codeInspection.*; +import com.intellij.codeInspection.JavaSuppressionUtil; +import com.intellij.codeInspection.ProblemDescriptor; +import com.intellij.codeInspection.RemoveAnnotationQuickFix; +import com.intellij.codeInspection.SuppressionUtilCore; import com.intellij.codeInspection.ui.ListEditForm; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.text.StringUtil; import com.intellij.profile.codeInspection.InspectionProfileManager; -import com.intellij.profile.codeInspection.InspectionProjectProfileManager; import com.intellij.psi.PsiAnnotation; import com.intellij.psi.PsiComment; import com.intellij.psi.PsiElement; @@ -98,12 +100,7 @@ public class SuppressionAnnotationInspection extends SuppressionAnnotationInspec myAllowedSuppressions.add(id); } } - saveProfile(project); - } - - private void saveProfile(Project project) { - final InspectionProfile inspectionProfile = InspectionProjectProfileManager.getInstance(project).getCurrentProfile(); - InspectionProfileManager.getInstance().fireProfileChanged(inspectionProfile); + InspectionProfileManager.getInstance().fireProfileChanged(InspectionProfileManager.getInstance(project).getCurrentProfile()); } @NotNull diff --git a/plugins/testng/src/com/theoryinpractice/testng/inspection/DependsOnGroupsInspection.java b/plugins/testng/src/com/theoryinpractice/testng/inspection/DependsOnGroupsInspection.java index ee36c773d45e..04e8c51a8168 100644 --- a/plugins/testng/src/com/theoryinpractice/testng/inspection/DependsOnGroupsInspection.java +++ b/plugins/testng/src/com/theoryinpractice/testng/inspection/DependsOnGroupsInspection.java @@ -22,7 +22,6 @@ import com.intellij.openapi.ui.LabeledComponent; import com.intellij.openapi.util.JDOMExternalizableStringList; import com.intellij.openapi.util.text.StringUtil; import com.intellij.profile.codeInspection.InspectionProfileManager; -import com.intellij.profile.codeInspection.InspectionProjectProfileManager; import com.intellij.psi.*; import com.intellij.ui.DocumentAdapter; import com.intellij.util.ArrayUtil; @@ -65,16 +64,19 @@ public class DependsOnGroupsInspection extends BaseJavaLocalInspectionTool { return SHORT_NAME; } + @Override public boolean isEnabledByDefault() { return true; } + @Override @Nullable public JComponent createOptionsPanel() { final LabeledComponent definedGroups = new LabeledComponent<>(); definedGroups.setText("&Defined Groups"); final JTextField textField = new JTextField(StringUtil.join(ArrayUtil.toStringArray(groups), ",")); textField.getDocument().addDocumentListener(new DocumentAdapter() { + @Override protected void textChanged(final DocumentEvent e) { groups.clear(); String text = textField.getText(); @@ -152,22 +154,23 @@ public class DependsOnGroupsInspection extends BaseJavaLocalInspectionTool { myGroupName = groupName; } + @Override @NotNull public String getName() { return "Add '" + myGroupName + "' as a defined test group."; } + @Override @NotNull public String getFamilyName() { return "TestNG"; } + @Override public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor problemDescriptor) { groups.add(myGroupName); - final InspectionProfile inspectionProfile = - InspectionProjectProfileManager.getInstance(project).getCurrentProfile(); //correct save settings - InspectionProfileManager.getInstance().fireProfileChanged(inspectionProfile); + InspectionProfileManager.getInstance().fireProfileChanged(InspectionProfileManager.getInstance(project).getCurrentProfile()); //TODO lesya /* try { diff --git a/python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/actions/CCChangeCourseInfo.java b/python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/actions/CCChangeCourseInfo.java index 145f7ee7e4e7..6339fccef5ea 100644 --- a/python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/actions/CCChangeCourseInfo.java +++ b/python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/actions/CCChangeCourseInfo.java @@ -1,6 +1,5 @@ package com.jetbrains.edu.coursecreator.actions; -import com.intellij.codeInspection.InspectionProfile; import com.intellij.ide.IdeView; import com.intellij.ide.projectView.ProjectView; import com.intellij.openapi.actionSystem.AnActionEvent; @@ -71,8 +70,7 @@ public class CCChangeCourseInfo extends DumbAwareAction { course.setDescription(panel.getDescription()); setVersion(course, panel); ProjectView.getInstance(project).refresh(); - final InspectionProfile profile = InspectionProjectProfileManager.getInstance(project).getCurrentProfile(); - InspectionProfileManager.getInstance().fireProfileChanged(profile); + InspectionProfileManager.getInstance().fireProfileChanged(InspectionProjectProfileManager.getInstance(project).getCurrentProfile()); } } diff --git a/python/python-rest/src/com/jetbrains/rest/quickfixes/AddIgnoredRoleFix.java b/python/python-rest/src/com/jetbrains/rest/quickfixes/AddIgnoredRoleFix.java index a2ae18f44195..5cbadc0122c1 100644 --- a/python/python-rest/src/com/jetbrains/rest/quickfixes/AddIgnoredRoleFix.java +++ b/python/python-rest/src/com/jetbrains/rest/quickfixes/AddIgnoredRoleFix.java @@ -16,12 +16,10 @@ package com.jetbrains.rest.quickfixes; import com.intellij.codeInsight.intention.LowPriorityAction; -import com.intellij.codeInspection.InspectionProfile; import com.intellij.codeInspection.LocalQuickFix; import com.intellij.codeInspection.ProblemDescriptor; import com.intellij.openapi.project.Project; import com.intellij.profile.codeInspection.InspectionProfileManager; -import com.intellij.profile.codeInspection.InspectionProjectProfileManager; import com.jetbrains.rest.RestBundle; import com.jetbrains.rest.inspections.RestRoleInspection; import org.jetbrains.annotations.NotNull; @@ -54,8 +52,7 @@ public class AddIgnoredRoleFix implements LocalQuickFix, LowPriorityAction { public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) { if (!myInspection.ignoredRoles.contains(myRole)) { myInspection.ignoredRoles.add(myRole); - final InspectionProfile profile = InspectionProjectProfileManager.getInstance(project).getCurrentProfile(); - InspectionProfileManager.getInstance().fireProfileChanged(profile); + InspectionProfileManager.getInstance().fireProfileChanged(InspectionProfileManager.getInstance(project).getCurrentProfile()); } } } diff --git a/python/src/com/jetbrains/python/inspections/PyPackageRequirementsInspection.java b/python/src/com/jetbrains/python/inspections/PyPackageRequirementsInspection.java index 1ef59b9e7e99..9cc7a0f3dc9e 100644 --- a/python/src/com/jetbrains/python/inspections/PyPackageRequirementsInspection.java +++ b/python/src/com/jetbrains/python/inspections/PyPackageRequirementsInspection.java @@ -21,7 +21,6 @@ import com.intellij.codeInspection.ui.ListEditForm; import com.intellij.execution.ExecutionException; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.command.CommandProcessor; -import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleUtilCore; @@ -50,8 +49,6 @@ import java.util.*; * @author vlan */ public class PyPackageRequirementsInspection extends PyInspection { - private static final Logger LOG = Logger.getInstance(PyPackageRequirementsInspection.class); - public JDOMExternalizableStringList ignoredPackages = new JDOMExternalizableStringList(); @NotNull @@ -331,7 +328,7 @@ public class PyPackageRequirementsInspection extends PyInspection { private void installRequirements(Project project, List requirements) { final PyPackageManagerUI ui = new PyPackageManagerUI(project, mySdk, new UIListener(myModule)); - ui.install(requirements, Collections.emptyList()); + ui.install(requirements, Collections.emptyList()); } } @@ -353,11 +350,13 @@ public class PyPackageRequirementsInspection extends PyInspection { mySdk = PythonSdkType.findPythonSdk(myModule); } + @Override @NotNull public String getFamilyName() { return "Install and import package " + myPackageName; } + @Override public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) { final PyPackageManagerUI ui = new PyPackageManagerUI(project, mySdk, new UIListener(myModule) { @Override @@ -375,7 +374,7 @@ public class PyPackageRequirementsInspection extends PyInspection { } } }); - ui.install(Collections.singletonList(new PyRequirement(myPackageName)), Collections.emptyList()); + ui.install(Collections.singletonList(new PyRequirement(myPackageName)), Collections.emptyList()); } } @@ -427,8 +426,7 @@ public class PyPackageRequirementsInspection extends PyInspection { } } if (changed) { - final InspectionProfile profile = InspectionProjectProfileManager.getInstance(project).getCurrentProfile(); - InspectionProfileManager.getInstance().fireProfileChanged(profile); + InspectionProfileManager.getInstance().fireProfileChanged(InspectionProfileManager.getInstance(project).getCurrentProfile()); } } } @@ -454,9 +452,7 @@ public class PyPackageRequirementsInspection extends PyInspection { @Override public void applyFix(@NotNull final Project project, @NotNull ProblemDescriptor descriptor) { - CommandProcessor.getInstance().executeCommand(project, () -> ApplicationManager.getApplication().runWriteAction(() -> { - PyPackageUtil.addRequirementToTxtOrSetupPy(myModule, myPackageName, myLanguageLevel); - }), getName(), null); + CommandProcessor.getInstance().executeCommand(project, () -> ApplicationManager.getApplication().runWriteAction(() -> PyPackageUtil.addRequirementToTxtOrSetupPy(myModule, myPackageName, myLanguageLevel)), getName(), null); } @NotNull