diff --git a/platform/configuration-store-impl/src/ComponentStoreWithExtraComponents.kt b/platform/configuration-store-impl/src/ComponentStoreWithExtraComponents.kt index 68e0b892d72a..1bd4ab775292 100644 --- a/platform/configuration-store-impl/src/ComponentStoreWithExtraComponents.kt +++ b/platform/configuration-store-impl/src/ComponentStoreWithExtraComponents.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.configurationStore import com.intellij.configurationStore.schemeManager.SchemeManagerFactoryBase @@ -16,7 +16,7 @@ abstract class ComponentStoreWithExtraComponents : ComponentStoreImpl() { super.initComponent(component, isService) } - final override fun beforeSaveComponents(errors: MutableList) { + override fun beforeSaveComponents(errors: MutableList) { // component state uses scheme manager in an ipr project, so, we must save it before val isIprProject = project?.let { !it.isDirectoryBased } ?: false if (isIprProject) { diff --git a/platform/configuration-store-impl/src/ProjectStoreImpl.kt b/platform/configuration-store-impl/src/ProjectStoreImpl.kt index aff00aba822a..98165720aea0 100644 --- a/platform/configuration-store-impl/src/ProjectStoreImpl.kt +++ b/platform/configuration-store-impl/src/ProjectStoreImpl.kt @@ -322,7 +322,7 @@ private open class ProjectStoreImpl(project: Project, private val pathMacroManag } } - override fun doSave(saveSession: SaveExecutor, readonlyFiles: MutableList, errors: MutableList) { + final override fun beforeSaveComponents(errors: MutableList) { try { saveProjectName() } @@ -330,6 +330,10 @@ private open class ProjectStoreImpl(project: Project, private val pathMacroManag LOG.error("Unable to store project name", e) } + super.beforeSaveComponents(errors) + } + + override fun doSave(saveSession: SaveExecutor, readonlyFiles: MutableList, errors: MutableList) { beforeSave(readonlyFiles) super.doSave(saveSession, readonlyFiles, errors) diff --git a/platform/configuration-store-impl/src/StateStorageManagerImpl.kt b/platform/configuration-store-impl/src/StateStorageManagerImpl.kt index ad3aa400e43f..f35fb7dfe09d 100644 --- a/platform/configuration-store-impl/src/StateStorageManagerImpl.kt +++ b/platform/configuration-store-impl/src/StateStorageManagerImpl.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.configurationStore import com.intellij.openapi.Disposable @@ -328,6 +328,7 @@ open class StateStorageManagerImpl(private val rootTagName: String, open val isExternalSystemStorageEnabled: Boolean get() = false + // function must be pure and do not use anything outside of passed arguments protected open fun beforeElementSaved(elements: MutableList, rootAttributes: MutableMap) { }