[platform] catch (EA-88092)
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>
Thu, 22 Sep 2016 16:06:37 +0000 (19:06 +0300)
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>
Thu, 22 Sep 2016 16:06:37 +0000 (19:06 +0300)
platform/platform-impl/src/com/intellij/openapi/fileChooser/actions/VirtualFileDeleteProvider.java

index c3e00d37f51fb9634ca117ef162c190699727218..233dfb13ef09d09409cadd7d7bf7fbeec76b7229 100644 (file)
@@ -20,8 +20,6 @@ import com.intellij.ide.DeleteProvider;
 import com.intellij.openapi.actionSystem.CommonDataKeys;
 import com.intellij.openapi.actionSystem.DataContext;
 import com.intellij.openapi.application.ApplicationBundle;
-import com.intellij.openapi.application.Result;
-import com.intellij.openapi.application.RunResult;
 import com.intellij.openapi.application.WriteAction;
 import com.intellij.openapi.command.CommandProcessor;
 import com.intellij.openapi.diagnostic.Logger;
@@ -35,6 +33,7 @@ import com.intellij.ui.UIBundle;
 import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 
+import java.io.IOException;
 import java.util.Arrays;
 import java.util.Comparator;
 import java.util.List;
@@ -72,15 +71,11 @@ public final class VirtualFileDeleteProvider implements DeleteProvider {
             indicator.setFraction((double)i / files.length);
             i++;
 
-            RunResult result = new WriteAction() {
-              @Override
-              protected void run(@NotNull Result result) throws Throwable {
-                file.delete(this);
-              }
-            }.execute();
-
-            if (result.hasException()) {
-              LOG.info("Error when deleting " + file, result.getThrowable());
+            try {
+              WriteAction.run(() -> file.delete(this));
+            }
+            catch (IOException e) {
+              LOG.info("Error when deleting " + file, e);
               problems.add(file.getName());
             }
           }