From d2f461c83751a337c78e267dd25552671ec7608a Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Thu, 5 Feb 2015 07:25:09 +0100 Subject: [PATCH] don't add fake storage if project file storage already listed --- .../openapi/components/impl/stores/ProjectStoreImpl.java | 7 +++++++ 1 file changed, 7 insertions(+) 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 8b6fab26ce30..3946225d8364 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 @@ -568,6 +568,13 @@ class ProjectStoreImpl extends BaseFileConfigurableStoreImpl implements IProject // if we create project from default, component state written not to own storage file, but to project file, // we don't have time to fix it properly, so, ancient hack restored. Storage[] result = super.getComponentStorageSpecs(persistentStateComponent, stateSpec, operation); + // don't add fake storage if project file storage already listed, otherwise data will be deleted on write (because of "deprecated") + for (Storage storage : result) { + if (storage.file().equals(StoragePathMacros.PROJECT_FILE)) { + return result; + } + } + Storage[] withProjectFileStorage = new Storage[result.length + 1]; System.arraycopy(result, 0, withProjectFileStorage, 0, result.length); withProjectFileStorage[result.length] = DEFAULT_STORAGE_ANNOTATION;