IDEA-CR-44826 newConfigFolder check must be performed before system directories are locked

This commit is contained in:
Vladimir Krivosheev
2019-03-14 21:36:03 +01:00
parent a0b82a72fb
commit 02dbd03cb2
@@ -127,6 +127,9 @@ public class StartupUtil {
System.exit(Main.JDK_CHECK_FAILED);
}
// this check must be performed before system directories are locked
boolean newConfigFolder = !Main.isHeadless() && !new File(PathManager.getConfigPath()).exists();
Callable<Logger> task = () -> {
Activity activity = ParallelActivity.PREPARE_APP_INIT.start(ActivitySubNames.CHECK_SYSTEM_DIR);
// note: uses config folder!
@@ -179,7 +182,6 @@ public class StartupUtil {
activity.end();
}
boolean newConfigFolder = false;
try {
Activity activity = StartUpMeasurer.start(Phases.WAIT_TASKS);
if (!futures.isEmpty()) {
@@ -188,10 +190,6 @@ public class StartupUtil {
}
}
if (!Main.isHeadless()) {
newConfigFolder = !new File(PathManager.getConfigPath()).exists();
}
if (pooledActivitiesFuture != null) {
log = pooledActivitiesFuture.get();
}