]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterTable.java
Better fix for ClusterTable maps going out of sync
[simantics/platform.git] / bundles / org.simantics.db.procore / src / fi / vtt / simantics / procore / internal / ClusterTable.java
index 5daf534fef481ca3e6b3bd43dcf637d82e2bb4ef..c6fd11c4eb35900763e1176b51fe90f7001819e3 100644 (file)
@@ -297,9 +297,7 @@ public final class ClusterTable implements IClusterTable {
         if (existing.hasVirtual())
             cluster.markVirtual();
 
-        long existingImportance = existing.getImportance();
-        if (existingImportance != 0)
-            importanceMap.remove(existingImportance);
+        importanceMap.remove(existing.getImportance());
         if (collectorPolicy != null)
             collectorPolicy.removed((ClusterImpl)existing);
 
@@ -1207,8 +1205,8 @@ public final class ClusterTable implements IClusterTable {
         int ims = importanceMap.size();
         int ihms = countImportantClusters();
 
-//        System.out.format("[%s] Validating ClusterTable: byteSize=%d, hashMap=%d/%d, importanceMap=%d%n",
-//                place, sizeInBytes, ihms, clusters.hashMap.size(), ims);
+//        System.out.format("[ClusterTable.%s] Validating: byteSize=%d (%d MB), hashMap=%d/%d, importanceMap=%d%n",
+//                place, sizeInBytes, sizeInBytes / (1024*1024), ihms, clusters.hashMap.size(), ims);
 
         int i = clusterArray.length;
         long size = 0;