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;h=0b17631341b275059d1241ff3ac28413575527b4;hp=fa0b0797f2a2e0e1c4fb34d8af4cbea3bf4c9ea4;hb=fdf0dbac10faf2b717cc0f7a7bd9462b371e208a;hpb=b844ca924d129072e11f7e4c18918dd388a37e8c 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 fa0b0797f..0b1763134 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 @@ -57,9 +57,6 @@ public final class ClusterChange { 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); @@ -204,8 +201,8 @@ public final class ClusterChange { } if (0 != foreign) { if (foreign > 256) - throw new RuntimeDatabaseException("Internal error, contact application support." + - "Too big foreing index=" + foreign + " max=256"); + throw new RuntimeDatabaseException("Internal error." + + "Too big foreign index=" + foreign + " max=256"); --foreign; bytes[byteIndex++] = foreign; return ClusterEnum.ForeignShort; @@ -217,8 +214,8 @@ public final class ClusterChange { if (DEBUG_STAT) info.sForeign = foreignTable.size(); if (clusterUID.equals(ClusterUID.Null)) - throw new RuntimeDatabaseException("Internal error, contact application support." + - "Cluster unique id not defined for foreing cluster."); + throw new RuntimeDatabaseException("Internal error." + + "Cluster unique id not defined for foreign cluster."); addForeignLong(resourceIndex, clusterUID); return ClusterEnum.ForeignLong; } @@ -496,6 +493,8 @@ public final class ClusterChange { left -= written; checkBufferSpace(12); } + // Possibly truncate file + modiValue(ri, length_, new byte[0], 0, 0); return sum; }