From ee8d5d63e73054cf59ec7797c379092028658b02 Mon Sep 17 00:00:00 2001 From: Alexandr Suhinin Date: Mon, 7 Feb 2022 16:07:01 +0200 Subject: [PATCH] CR-17727: clean GitOrigin-RevId: cf0ec2f34ac4195833c3be97c7751070ece9fb16 --- .../testFramework/propertyBased/MadTestingUtil.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/testFramework/src/com/intellij/testFramework/propertyBased/MadTestingUtil.java b/platform/testFramework/src/com/intellij/testFramework/propertyBased/MadTestingUtil.java index eb860049690f..e9ff865fac92 100644 --- a/platform/testFramework/src/com/intellij/testFramework/propertyBased/MadTestingUtil.java +++ b/platform/testFramework/src/com/intellij/testFramework/propertyBased/MadTestingUtil.java @@ -33,6 +33,7 @@ import com.intellij.profile.codeInspection.InspectionProjectProfileManager; import com.intellij.profile.codeInspection.ProjectInspectionProfileManager; import com.intellij.psi.*; import com.intellij.psi.impl.source.PostprocessReformattingAspect; +import com.intellij.testFramework.InspectionsKt; import com.intellij.testFramework.PlatformTestUtil; import com.intellij.testFramework.RunAll; import com.intellij.testFramework.UsefulTestCase; @@ -184,9 +185,11 @@ public final class MadTestingUtil { } public static void enableDefaultInspections(@NotNull Project project) { - InspectionProfileImpl.INIT_INSPECTIONS = true; InspectionProfileImpl profile = new InspectionProfileImpl("defaultInspections"); - replaceProfile(project, profile); + InspectionsKt.runInInitMode(() -> { + replaceProfile(project, profile); + return null; + }); } private static void replaceProfile(@NotNull Project project, InspectionProfileImpl profile) {