diff --git a/platform/platform-impl/src/com/intellij/idea/IdeaApplication.java b/platform/platform-impl/src/com/intellij/idea/IdeaApplication.java index 8af6dad45c08..3415489112ce 100644 --- a/platform/platform-impl/src/com/intellij/idea/IdeaApplication.java +++ b/platform/platform-impl/src/com/intellij/idea/IdeaApplication.java @@ -89,6 +89,7 @@ public class IdeaApplication { LOG.assertTrue(ourInstance == null); //noinspection AssignmentToStaticFieldFromInstanceMethod ourInstance = this; + myArgs = processProgramArguments(args); boolean isInternal = Boolean.getBoolean(IDEA_IS_INTERNAL_PROPERTY); boolean isUnitTest = Boolean.getBoolean(IDEA_IS_UNIT_TEST); @@ -133,7 +134,7 @@ public class IdeaApplication { */ @NotNull private static String[] processProgramArguments(@NotNull String[] args) { - ArrayList arguments = new ArrayList<>(); + List arguments = new ArrayList<>(); List safeKeys = Arrays.asList(SAFE_JAVA_ENV_PARAMETERS); for (String arg : args) { if (arg.startsWith("-D")) { @@ -154,7 +155,9 @@ public class IdeaApplication { private static void patchSystem(boolean headless) { IdeaForkJoinWorkerThreadFactory.setupForkJoinCommonPool(headless); - LOG.info("CPU cores: " + Runtime.getRuntime().availableProcessors()+"; ForkJoinPool.commonPool: " + ForkJoinPool.commonPool() + "; factory: " + ForkJoinPool.commonPool().getFactory()); + LOG.info("CPU cores: " + Runtime.getRuntime().availableProcessors() + + "; ForkJoinPool.commonPool: " + ForkJoinPool.commonPool() + + "; factory: " + ForkJoinPool.commonPool().getFactory()); System.setProperty("sun.awt.noerasebackground", "true"); @@ -319,8 +322,7 @@ public class IdeaApplication { public void main(String[] args) { SystemDock.updateMenu(); - // if OS has dock, RecentProjectsManager will be already created, but not all OS have dock, so, we trigger creation here to ensure that RecentProjectsManager app listener will be added - RecentProjectsManager.getInstance(); + RecentProjectsManager.getInstance(); // ensures that RecentProjectsManager app listener is added // Event queue should not be changed during initialization of application components. // It also cannot be changed before initialization of application components because IdeEventQueue uses other diff --git a/platform/platform-impl/src/com/intellij/idea/StartupUtil.java b/platform/platform-impl/src/com/intellij/idea/StartupUtil.java index b010a6fa91aa..bc2e3880d09a 100644 --- a/platform/platform-impl/src/com/intellij/idea/StartupUtil.java +++ b/platform/platform-impl/src/com/intellij/idea/StartupUtil.java @@ -133,7 +133,7 @@ public class StartupUtil { // this check must be performed before system directories are locked boolean newConfigFolder = !Main.isHeadless() && !new File(PathManager.getConfigPath()).exists(); - final Logger log = lockDirsAndConfigureLogger(args); + Logger log = lockDirsAndConfigureLogger(args); futures.add(executorService.submit(() -> { Activity activity = ParallelActivity.PREPARE_APP_INIT.start(ActivitySubNames.LOAD_SYSTEM_LIBS); @@ -225,7 +225,10 @@ public class StartupUtil { return initLafTask; } - private static void addInitUiTasks(@NotNull List> futures, @NotNull ExecutorService executorService, @NotNull Logger log, @NotNull Future initLafTask) { + private static void addInitUiTasks(@NotNull List> futures, + @NotNull ExecutorService executorService, + @NotNull Logger log, + @NotNull Future initLafTask) { futures.add(executorService.submit(() -> { // UIUtil.initDefaultLaF must be called before this call try { @@ -239,7 +242,6 @@ public class StartupUtil { } // updateWindowIcon must be after UIUtil.initSystemFontData because uses computed system font data for scale context - if (!Main.isHeadless()) { // no need to wait - doesn't affect other functionality executorService.execute(() -> { diff --git a/platform/platform-impl/src/com/intellij/ui/AppUIUtil.java b/platform/platform-impl/src/com/intellij/ui/AppUIUtil.java index c17651c33548..85df64352b07 100644 --- a/platform/platform-impl/src/com/intellij/ui/AppUIUtil.java +++ b/platform/platform-impl/src/com/intellij/ui/AppUIUtil.java @@ -27,7 +27,6 @@ import com.intellij.openapi.ui.popup.Balloon; import com.intellij.openapi.util.Condition; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.SystemInfo; -import com.intellij.openapi.util.SystemInfoRt; import com.intellij.openapi.wm.ToolWindowManager; import com.intellij.ui.AppIcon.MacAppIcon; import com.intellij.ui.components.JBScrollPane; @@ -69,11 +68,9 @@ public class AppUIUtil { private static boolean ourMacDocIconSet = false; public static void updateWindowIcon(@NotNull Window window) { - if (SystemInfo.isWindows && - SystemProperties.getBooleanProperty("ide.native.launcher", false) && - SystemProperties.getBooleanProperty("jbre.win.app.icon.supported", false)) // todo[tav] defined by JBRE, remove when OpenJDK supports it as well - { - return; // JDK will load icon from the exe resource + // todo[tav] 'jbre.win.app.icon.supported' is defined by JBRE, remove when OpenJDK supports it as well + if (SystemInfo.isWindows && Boolean.getBoolean("ide.native.launcher") && Boolean.getBoolean("jbre.win.app.icon.supported")) { + return; // JDK will load icon from the exe resource } ApplicationInfoEx appInfo = ApplicationInfoImpl.getShadowInstance(); @@ -161,7 +158,7 @@ public class AppUIUtil { } public static void updateFrameClass(@NotNull Toolkit toolkit) { - if (SystemInfoRt.isWindows || SystemInfoRt.isMac) { + if (SystemInfo.isWindows || SystemInfo.isMac) { return; }