Merge branch 'uta/UDLrename'
[idea/community.git] / platform / testFramework / src / com / intellij / testFramework / fixtures / impl / CodeInsightTestFixtureImpl.java
index cac8e5d6a5ab6174a48850f14d585b351217f27d..cae84db238e3513a593aa22e1d838ee545eda35b 100644 (file)
@@ -340,8 +340,9 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
     InspectionsKt.enableInspectionTools(getProject(), getTestRootDisposable(), inspections);
   }
 
+  @SafeVarargs
   @Override
-  public void enableInspections(@NotNull final Class<? extends LocalInspectionTool>... inspections) {
+  public final void enableInspections(@NotNull final Class<? extends LocalInspectionTool>... inspections) {
     enableInspections(Arrays.asList(inspections));
   }
 
@@ -1358,16 +1359,12 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
 
     EdtTestUtil.runInEdtAndWait(() -> {
       if (!copy.getFileType().isBinary()) {
-        AccessToken token = WriteAction.start();
         try {
-          copy.setBinaryContent(loader.newFileText.getBytes(copy.getCharset()));
+          WriteAction.run(() -> copy.setBinaryContent(loader.newFileText.getBytes(copy.getCharset())));
         }
         catch (IOException e) {
           throw new RuntimeException(e);
         }
-        finally {
-          token.finish();
-        }
       }
       myFile = copy;
       myEditor = createEditor(copy);