X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.procore%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fprocore%2Fcluster%2FClusterSmall.java;h=ead0099847e70aacf5914535b74600c4d84dbb06;hb=980d21d8a26dddd2e57dbffdc8f320a76aa0973e;hp=1b7dc0d32598374fb1b062c26987a580f0ab7964;hpb=56a799c9b7d395cefb59e101cd0f7ce8d68f88e6;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ClusterSmall.java b/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ClusterSmall.java index 1b7dc0d32..ead009984 100644 --- a/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ClusterSmall.java +++ b/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ClusterSmall.java @@ -40,7 +40,6 @@ import fi.vtt.simantics.procore.internal.ClusterStream; import fi.vtt.simantics.procore.internal.ClusterTable; import fi.vtt.simantics.procore.internal.SessionImplSocket; import gnu.trove.map.hash.TIntShortHashMap; -import gnu.trove.procedure.TIntProcedure; import gnu.trove.set.hash.TIntHashSet; final public class ClusterSmall extends ClusterImpl { @@ -1009,6 +1008,7 @@ final public class ClusterSmall extends ClusterImpl { } if (deleted) return null; // Can't convert deleted cluster to big. ClusterBig big = new ClusterBig(getClusterUID(), clusterKey, support); + big.setImportance(importance); big.cc = this.cc; big.cc.clusterImpl = this; resourceTable.toBig(big, support, this); @@ -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) {