diff --git a/platform/lang-impl/src/com/intellij/openapi/module/impl/ModuleImpl.java b/platform/lang-impl/src/com/intellij/openapi/module/impl/ModuleImpl.java index 7f4434a0a8c0..f7bd471b3a92 100644 --- a/platform/lang-impl/src/com/intellij/openapi/module/impl/ModuleImpl.java +++ b/platform/lang-impl/src/com/intellij/openapi/module/impl/ModuleImpl.java @@ -19,6 +19,7 @@ package com.intellij.openapi.module.impl; import com.intellij.ide.highlighter.ModuleFileType; import com.intellij.ide.plugins.IdeaPluginDescriptor; import com.intellij.ide.plugins.PluginManager; +import com.intellij.openapi.application.impl.ApplicationInfoImpl; import com.intellij.openapi.components.impl.ComponentManagerImpl; import com.intellij.openapi.components.impl.ModulePathMacroManager; import com.intellij.openapi.components.impl.stores.IComponentStore; @@ -308,6 +309,11 @@ public class ModuleImpl extends ComponentManagerImpl implements Module { return Extensions.getArea(this).getExtensionPoint(extensionPointName).getExtensions(); } + @Override + protected boolean logSlowComponents() { + return super.logSlowComponents() || ApplicationInfoImpl.getShadowInstance().isEAP(); + } + private class MyVirtualFileListener extends VirtualFileAdapter { public void propertyChanged(VirtualFilePropertyEvent event) { if (!isModuleAdded) return; diff --git a/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java b/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java index ae9c03dc019e..e1de526d9e97 100644 --- a/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java @@ -1319,6 +1319,11 @@ public class ApplicationImpl extends ComponentManagerImpl implements Application return false; } + @Override + protected boolean logSlowComponents() { + return super.logSlowComponents() || ApplicationInfoImpl.getShadowInstance().isEAP(); + } + @Override public String toString() { return "Application" + diff --git a/platform/platform-impl/src/com/intellij/openapi/components/impl/ComponentManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/components/impl/ComponentManagerImpl.java index d755ab623411..be9ff74dbd30 100644 --- a/platform/platform-impl/src/com/intellij/openapi/components/impl/ComponentManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/components/impl/ComponentManagerImpl.java @@ -17,8 +17,6 @@ package com.intellij.openapi.components.impl; import com.intellij.diagnostic.PluginException; import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.application.ex.ApplicationManagerEx; -import com.intellij.openapi.application.impl.ApplicationInfoImpl; import com.intellij.openapi.components.*; import com.intellij.openapi.components.ex.ComponentManagerEx; import com.intellij.openapi.components.impl.stores.IComponentStore; @@ -344,7 +342,7 @@ public abstract class ComponentManagerImpl extends UserDataHolderBase implements } protected boolean isComponentSuitable(Map options) { - return !isTrue(options, "internal") || ApplicationManagerEx.getApplicationEx().isInternal(); + return !isTrue(options, "internal") || ApplicationManager.getApplication().isInternal(); } private static boolean isTrue(Map options, @NonNls final String option) { @@ -446,6 +444,10 @@ public abstract class ComponentManagerImpl extends UserDataHolderBase implements } } + protected boolean logSlowComponents() { + return LOG.isDebugEnabled(); + } + private class ComponentsRegistry { private final Map myInterfaceToLockMap = new HashMap(); private final Map myInterfaceToClassMap = new HashMap(); @@ -670,12 +672,9 @@ public abstract class ComponentManagerImpl extends UserDataHolderBase implements long endTime = System.nanoTime(); long ms = (endTime - startTime) / 1000000; if (ms > 10) { - if (ApplicationInfoImpl.getShadowInstance().isEAP()) { + if (logSlowComponents()) { LOG.info(componentInstance.getClass().getName() + " initialized in " + ms + " ms"); } - else if (LOG.isDebugEnabled()) { - LOG.debug(componentInstance.getClass().getName() + " initialized in " + ms + " ms"); - } } myInitializing = false; myInitialized = true; diff --git a/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectImpl.java b/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectImpl.java index 23256196e8af..454f00bf0bc9 100644 --- a/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectImpl.java @@ -26,6 +26,7 @@ import com.intellij.openapi.application.ApplicationNamesInfo; import com.intellij.openapi.application.PathMacros; import com.intellij.openapi.application.ex.ApplicationEx; import com.intellij.openapi.application.ex.ApplicationManagerEx; +import com.intellij.openapi.application.impl.ApplicationInfoImpl; import com.intellij.openapi.application.impl.PluginsFacade; import com.intellij.openapi.components.ProjectComponent; import com.intellij.openapi.components.StorageScheme; @@ -477,6 +478,11 @@ public class ProjectImpl extends ComponentManagerImpl implements ProjectEx { ; } + @Override + protected boolean logSlowComponents() { + return super.logSlowComponents() || ApplicationInfoImpl.getShadowInstance().isEAP(); + } + public static void dropUnableToSaveProjectNotification(@NotNull final Project project, final VirtualFile[] readOnlyFiles) { final UnableToSaveProjectNotification[] notifications = NotificationsManager.getNotificationsManager().getNotificationsOfType(UnableToSaveProjectNotification.class, project);