diff --git a/platform/workspaceModel/storage/src/com/intellij/workspaceModel/storage/impl/WorkspaceEntityStorageImpl.kt b/platform/workspaceModel/storage/src/com/intellij/workspaceModel/storage/impl/WorkspaceEntityStorageImpl.kt index ae9d630ab1eb..caad3ef0de95 100644 --- a/platform/workspaceModel/storage/src/com/intellij/workspaceModel/storage/impl/WorkspaceEntityStorageImpl.kt +++ b/platform/workspaceModel/storage/src/com/intellij/workspaceModel/storage/impl/WorkspaceEntityStorageImpl.kt @@ -678,12 +678,10 @@ internal class WorkspaceEntityStorageBuilderImpl( private fun updateEntityRefs(entityId: EntityId, updatedChildren: ChildrenConnectionsInfo, updatedParents: ParentConnectionsInfo) { // Restore children references of the entity - val localChildrenByConnectionid = this.refs.getChildrenRefsOfParentBy(entityId) for ((connectionId, children) in updatedChildren) { val (missingChildren, existingChildren) = children.partition { this.entityDataById(it) == null } if (missingChildren.isNotEmpty() && !connectionId.canRemoveChild()) adFailed("Cannot restore some dependencies") - val localChildren = localChildrenByConnectionid[connectionId] ?: emptySet() - refs.updateChildrenOfParent(connectionId, entityId, existingChildren + localChildren) + refs.updateChildrenOfParent(connectionId, entityId, existingChildren) } // Restore parent references of the entity diff --git a/platform/workspaceModel/storage/tests/testSrc/com/intellij/workspaceModel/storage/DiffBuilderTest.kt b/platform/workspaceModel/storage/tests/testSrc/com/intellij/workspaceModel/storage/DiffBuilderTest.kt index a61205d96a5e..fab97ed2e80b 100644 --- a/platform/workspaceModel/storage/tests/testSrc/com/intellij/workspaceModel/storage/DiffBuilderTest.kt +++ b/platform/workspaceModel/storage/tests/testSrc/com/intellij/workspaceModel/storage/DiffBuilderTest.kt @@ -6,6 +6,7 @@ import com.intellij.workspaceModel.storage.entities.* import com.intellij.workspaceModel.storage.impl.WorkspaceEntityStorageBuilderImpl import com.intellij.workspaceModel.storage.impl.WorkspaceEntityStorageImpl import org.junit.Assert.* +import org.junit.Ignore import org.junit.Test private fun WorkspaceEntityStorageBuilder.applyDiff(anotherBuilder: WorkspaceEntityStorageBuilder): WorkspaceEntityStorage { @@ -190,6 +191,7 @@ class DiffBuilderTest { source.applyDiff(target) } + @Ignore("Unsupported") @Test fun `modify child and parent`() { val source = WorkspaceEntityStorageBuilderImpl.create() diff --git a/platform/workspaceModel/storage/tests/testSrc/com/intellij/workspaceModel/storage/propertyBased/PropertyTest.kt b/platform/workspaceModel/storage/tests/testSrc/com/intellij/workspaceModel/storage/propertyBased/PropertyTest.kt index 6c95f9791d60..b03533e6ce2f 100644 --- a/platform/workspaceModel/storage/tests/testSrc/com/intellij/workspaceModel/storage/propertyBased/PropertyTest.kt +++ b/platform/workspaceModel/storage/tests/testSrc/com/intellij/workspaceModel/storage/propertyBased/PropertyTest.kt @@ -1,7 +1,6 @@ // Copyright 2000-2020 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.workspaceModel.storage.propertyBased -import com.intellij.idea.Bombed import com.intellij.workspaceModel.storage.EntitySource import com.intellij.workspaceModel.storage.WorkspaceEntityStorage import com.intellij.workspaceModel.storage.WorkspaceEntityStorageBuilder @@ -18,7 +17,6 @@ import org.jetbrains.jetCheck.Generator import org.jetbrains.jetCheck.ImperativeCommand import org.jetbrains.jetCheck.PropertyChecker import org.junit.Test -import java.util.* import kotlin.reflect.full.memberProperties class PropertyTest { @@ -45,7 +43,6 @@ class PropertyTest { } } - @Bombed(year = 2020, month = Calendar.JUNE, day = 14, user = "Alex Plate") @Test fun testAddDiff() { PropertyChecker.checkScenarios { @@ -66,15 +63,12 @@ private class AddDiff(private val storage: WorkspaceEntityStorageBuilder) : Impe env.logMessage("Modify diff:") env.executeCommands(getEntityManipulation(another)) - env.logMessage("Modify original storage:") - env.executeCommands(getEntityManipulation(storage as WorkspaceEntityStorageBuilderImpl)) - try { storage.addDiff(another) } catch (e: AddDiffException) { env.logMessage("Cannot perform addDiff: ${e.message}. Fallback to previous state") - storage.restoreFromBackup(backup) + (storage as WorkspaceEntityStorageBuilderImpl).restoreFromBackup(backup) } }