]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ClusterSmall.java
Fixed ClusterTable cluster hash/importance map book-keeping problem
[simantics/platform.git] / bundles / org.simantics.db.procore / src / org / simantics / db / procore / cluster / ClusterSmall.java
index 1b7dc0d32598374fb1b062c26987a580f0ab7964..1a8af51433610146897dcfd1d99225bcbd60921d 100644 (file)
@@ -1069,14 +1069,14 @@ final public class ClusterSmall extends ClusterImpl {
     public String toString() {
         if (deleted) return "ClusterSmall[" + getClusterId() + " - has been deleted or hasn't been created.]";
         try {
-            final TIntHashSet set = new TIntHashSet();
-            TIntShortHashMap map = foreignTable.getResourceHashMap();
-            map.forEachKey(new TIntProcedure() {
-                @Override
-                public boolean execute(int value) {
-                    set.add(value & 0xfffff000);
-                    return true;
-                }
+            ForeignTableSmall ft = foreignTable;
+            if (ft == null)
+                return "ClusterSmall[" + getClusterId() + " - " + getNumberOfResources() + "]";
+            TIntShortHashMap map = ft.getResourceHashMap();
+            TIntHashSet set = new TIntHashSet();
+            map.forEachKey(value -> {
+                set.add(value & 0xfffff000);
+                return true;
             });
             return "ClusterSmall[" + getClusterId() + " - " + getNumberOfResources() + " - " + foreignTable.getResourceHashMap().size() + " - " + set.size() + "]";
         } catch (Throwable e) {