diff --git a/platform/lang-impl/src/com/intellij/openapi/components/impl/stores/ModuleStoreImpl.java b/platform/lang-impl/src/com/intellij/openapi/components/impl/stores/ModuleStoreImpl.java index 2f188fe505be..f7f2c3c6df04 100644 --- a/platform/lang-impl/src/com/intellij/openapi/components/impl/stores/ModuleStoreImpl.java +++ b/platform/lang-impl/src/com/intellij/openapi/components/impl/stores/ModuleStoreImpl.java @@ -264,6 +264,12 @@ public class ModuleStoreImpl extends BaseFileConfigurableStoreImpl implements IM } } + @Override + public void reinitComponents(Set componentNames, boolean reloadData) { + LOG.info("[STORAGE] Module: " + myModule.getName()); + super.reinitComponents(componentNames, reloadData); + } + @Override protected boolean optimizeTestLoading() { return ((ProjectEx)myModule.getProject()).isOptimiseTestLoadSpeed(); diff --git a/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ComponentStoreImpl.java b/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ComponentStoreImpl.java index 4b00cfe4bf0a..d09a5fd60e26 100644 --- a/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ComponentStoreImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ComponentStoreImpl.java @@ -497,6 +497,7 @@ abstract class ComponentStoreImpl implements IComponentStore { for (String componentName : componentNames) { final PersistentStateComponent component = (PersistentStateComponent)myComponents.get(componentName); if (component != null) { + LOG.info("[STORAGE] Reinit component '" + componentName + "'"); initPersistentComponent(component, reloadData); } } diff --git a/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/FileBasedStorage.java b/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/FileBasedStorage.java index 22af3f4bae6d..50074b6a729f 100644 --- a/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/FileBasedStorage.java +++ b/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/FileBasedStorage.java @@ -93,6 +93,7 @@ public class FileBasedStorage extends XmlElementStorage { final Listener listener = messageBus.syncPublisher(STORAGE_TOPIC); virtualFileTracker.addTracker(fileUrl, new VirtualFileAdapter() { public void contentsChanged(final VirtualFileEvent event) { + LOG.info("[STORAGE] Changed: " + myFilePath); listener.storageFileChanged(event, FileBasedStorage.this); } }, false, this); diff --git a/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ProjectStoreImpl.java b/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ProjectStoreImpl.java index ab4f5cab9926..a11c72e04fb1 100644 --- a/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ProjectStoreImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ProjectStoreImpl.java @@ -624,11 +624,16 @@ class ProjectStoreImpl extends BaseFileConfigurableStoreImpl implements IProject final Set componentNames; try { componentNames = saveSession.analyzeExternalChanges(changedFiles); + LOG.info("[STORAGE] Changes affects: " + (componentNames == null ? "[NONE]" : + StringUtil.join(componentNames.toArray(new String[componentNames.size()]), ", "))); if (componentNames == null) return false; // TODO[mike]: This is a hack to prevent NPE (assert != null) in StateStorageManagerImpl.reload, storage is null for... for (Pair pair : changedFiles) { - if (pair.second == null) return false; + if (pair.second == null) { + LOG.info("[STORAGE] Soft reload is not possible: no state for:" + pair.first.getName()); + return false; + } } if (!componentNames.isEmpty()) { @@ -636,6 +641,7 @@ class ProjectStoreImpl extends BaseFileConfigurableStoreImpl implements IProject } if (!isReloadPossible(componentNames)) { + LOG.info("[STORAGE] Soft reload is not possible for some components :("); return false; } } diff --git a/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectManagerImpl.java index 7580acc08638..749e8d94e0c3 100644 --- a/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectManagerImpl.java @@ -115,7 +115,9 @@ public class ProjectManagerImpl extends ProjectManagerEx implements NamedJDOMExt connection.subscribe(StateStorage.STORAGE_TOPIC, new StateStorage.Listener() { public void storageFileChanged(final VirtualFileEvent event, @NotNull final StateStorage storage) { VirtualFile file = event.getFile(); + LOG.info("[STORAGE] Check if application reload is required for: " + file.getPath()); if (!file.isDirectory() && !(event.getRequestor() instanceof StateStorage.SaveSession)) { + LOG.info("[STORAGE] Scheduling application reload triggered by change in: " + file.getPath()); saveChangedProjectFile(file, null, storage); } } @@ -130,7 +132,9 @@ public class ProjectManagerImpl extends ProjectManagerEx implements NamedJDOMExt connection.subscribe(StateStorage.STORAGE_TOPIC, new StateStorage.Listener() { public void storageFileChanged(final VirtualFileEvent event, @NotNull final StateStorage storage) { VirtualFile file = event.getFile(); + LOG.info("[STORAGE] Check if project reload is required for: " + file.getPath()); if (!file.isDirectory() && !(event.getRequestor() instanceof StateStorage.SaveSession)) { + LOG.info("[STORAGE] Scheduling project reload triggered by change in: " + file.getPath()); saveChangedProjectFile(file, project, storage); } } @@ -654,6 +658,7 @@ public class ProjectManagerImpl extends ProjectManagerEx implements NamedJDOMExt ApplicationManager.getApplication().runWriteAction(new Runnable() { public void run() { try { + LOG.info("[STORAGE] Checking if we could reinit components w/o project reload..."); reloadOk[0] = ((ProjectEx)project).getStateStore().reload(causes); } catch (StateStorage.StateStorageException e) { @@ -668,6 +673,8 @@ public class ProjectManagerImpl extends ProjectManagerEx implements NamedJDOMExt }); if (reloadOk[0]) return false; + LOG.info("[STORAGE] Unable to reinit components, scheduling full project reload..."); + String message; if (causes.size() == 1) { message = ProjectBundle.message("project.reload.external.change.single", causes.iterator().next().first.getPresentableUrl());