From 55c756595b16f2374bfb553542d208f13114a81d Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Fri, 21 Jan 2022 21:43:40 +0200 Subject: [PATCH] Fix MappingBase to update and invalidate configurationByComponentId Previous changes made in #713 only added the cache structure but failed to update and invalidate when synchronization is performed and the structure is updated. gitlab #798 (cherry picked from commit bbdf2b95e12b65225ba1888e090801dd9421a9da) --- .../structural/synchronization/base/MappingBase.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/MappingBase.java b/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/MappingBase.java index e9185e639..4dda1f3af 100644 --- a/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/MappingBase.java +++ b/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/MappingBase.java @@ -175,6 +175,7 @@ abstract public class MappingBase> { result = componentFactory.create(uid); configurationByUid.put(uid, result); configurationBySolverName = null; // forces recalculation + configurationByComponentId = null; // forces recalculation } else { if(result.getParent() == null) @@ -223,6 +224,8 @@ abstract public class MappingBase> { configurationByUid.remove(component.uid); if (configurationBySolverName != null && component.solverComponentName != null) configurationBySolverName.remove(component.solverComponentName); + if (configurationByComponentId != null && component.componentId != 0) + configurationByComponentId.remove(component.componentId); if(component.getChildMap() != null) component.getChildMap().forEachValue(new TObjectProcedure() { @Override @@ -299,6 +302,10 @@ abstract public class MappingBase> { configurationBySolverName.clear(); configurationBySolverName = null; } + if (configurationByComponentId != null) { + configurationByComponentId.clear(); + configurationByComponentId = null; + } pendingRemoval.clear(); } -- 2.47.1