From f600f8cdf0a6cc219af1babb594ef38f14d17748 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Fri, 19 Jun 2020 19:29:23 +0200 Subject: [PATCH] [updater] IAE on poor man's single core agents GitOrigin-RevId: 89d4e4bc076b19e4d388ecb95e3db1645f483fcf --- updater/src/com/intellij/updater/PatchFileCreator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/updater/src/com/intellij/updater/PatchFileCreator.java b/updater/src/com/intellij/updater/PatchFileCreator.java index 679e6d8de215..8e7090e72586 100644 --- a/updater/src/com/intellij/updater/PatchFileCreator.java +++ b/updater/src/com/intellij/updater/PatchFileCreator.java @@ -30,7 +30,7 @@ public class PatchFileCreator { List actions = patchInfo.getActions(); File olderDir = new File(spec.getOldFolder()); File newerDir = new File(spec.getNewFolder()); - ExecutorService executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() - 1); + ExecutorService executor = Executors.newFixedThreadPool(Math.max(Runtime.getRuntime().availableProcessors() - 1, 1)); Map> tasks = new ConcurrentHashMap<>(); for (int i = 0; i < actions.size(); i++) {