diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ModuleRootManagerImpl.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ModuleRootManagerImpl.java index 8c238297313d..910bf69be095 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ModuleRootManagerImpl.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ModuleRootManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import com.intellij.openapi.roots.ex.ProjectRootManagerEx; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.InvalidDataException; import com.intellij.openapi.util.JDOMExternalizable; +import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.pointers.VirtualFilePointerManager; import com.intellij.util.ThrowableRunnable; @@ -177,7 +178,7 @@ public class ModuleRootManagerImpl extends ModuleRootManager implements Disposab ModifiableModelCommitter.multiCommit(new ModifiableRootModel[]{rootModel}, moduleModel); if (changed) { - myModificationCount++; + stateChanged(); } } @@ -186,14 +187,13 @@ public class ModuleRootManagerImpl extends ModuleRootManager implements Disposab rootModel.dispose(); try { - ((ModuleRootManagerImpl)getInstance(rootModel.getModule())).myModificationCount++; + ((ModuleRootManagerImpl)getInstance(rootModel.getModule())).stateChanged(); } catch (Exception e) { LOG.error(e); } } - @Override @NotNull public Module[] getDependencies() { @@ -364,6 +364,13 @@ public class ModuleRootManagerImpl extends ModuleRootManager implements Disposab } } + private void stateChanged() { + if (Registry.is("store.track.module.root.manager.changes", false)) { + LOG.error("ModelRootManager state changed"); + } + myModificationCount++; + } + public static class ModuleRootManagerState implements JDOMExternalizable { private RootModelImpl myRootModel; private Element myRootModelElement; diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties index 7e2d16f2d5d6..a23f76e85647 100644 --- a/platform/util/resources/misc/registry.properties +++ b/platform/util/resources/misc/registry.properties @@ -912,6 +912,7 @@ typing.freeze.report.dumps.description=Automatically reports thread dumps to our store.basedir.parent.detection=true store.save.use.modificationCount=true +store.track.module.root.manager.changes=false ide.ui.composite.editor.for.combobox.description=Allows to use composite components based on JPanel as a ComboBox editor ide.ui.composite.editor.for.combobox=true