X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.procore%2Fsrc%2Ffi%2Fvtt%2Fsimantics%2Fprocore%2Finternal%2FClusterChange.java;fp=bundles%2Forg.simantics.db.procore%2Fsrc%2Ffi%2Fvtt%2Fsimantics%2Fprocore%2Finternal%2FClusterChange.java;h=fa0b0797f2a2e0e1c4fb34d8af4cbea3bf4c9ea4;hp=1a264dc515d5329d22ec1f285f1043cf08771d1a;hb=60ef4f8b863d892019a61978a63119dc1ebd852f;hpb=bdab0adcee131a18290393e1c2fca72de48c10d2 diff --git a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterChange.java b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterChange.java index 1a264dc51..fa0b0797f 100644 --- a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterChange.java +++ b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterChange.java @@ -54,7 +54,12 @@ public final class ClusterChange { public ClusterImpl clusterImpl; public ClusterChange(ClusterStream clusterStream, ClusterImpl clusterImpl) { + this.clusterImpl = clusterImpl; + + if (!clusterImpl.isLoaded()) + new IllegalStateException("Change to proxy cluster " + clusterImpl.getClusterUID()).printStackTrace(); + clusterUID = clusterImpl.getClusterUID(); long[] longs = new long[ClusterUID.getLongLength()]; clusterUID.toLong(longs, 0); @@ -69,9 +74,13 @@ public final class ClusterChange { Bytes.writeLE(header, offset, longs[i]); //initBuffer(); this.clusterStream = clusterStream; - this.clusterChange2 = new ClusterChange2(clusterUID, clusterImpl); + this.clusterChange2 = new ClusterChange2(clusterUID); clusterStream.changes.add(this); } + + public void adopt(ClusterImpl impl) { + this.clusterImpl = impl; + } private void setHeaderVectorSize(int size) { if (size < 0) @@ -81,7 +90,7 @@ public final class ClusterChange { } @Override public String toString() { - return super.toString() + " cluster=" + clusterImpl.getClusterUID() + " id=" + clusterImpl.getClusterId() + " off=" + byteIndex; + return super.toString() + " cluster=" + clusterUID + " id=" + clusterImpl.getClusterId() + " off=" + byteIndex; } private final void initBuffer() { flushed = false;