]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.acorn/src/org/simantics/acorn/lru/ClusterChangeSet.java
Acorn: Fix WriteRunnable.runReally() and other fixes
[simantics/platform.git] / bundles / org.simantics.acorn / src / org / simantics / acorn / lru / ClusterChangeSet.java
index d0f3013d082ff6bea3aa8f3748be372d2da504a6..cfe5c1357111a07c52de61887541bc6b49cc8933 100644 (file)
@@ -3,6 +3,8 @@ package org.simantics.acorn.lru;
 import java.util.ArrayList;
 
 import org.simantics.acorn.ClusterManager;
+import org.simantics.acorn.exception.AcornAccessVerificationException;
+import org.simantics.acorn.exception.IllegalAcornStateException;
 import org.simantics.acorn.internal.Change;
 import org.simantics.acorn.internal.ClusterChange;
 import org.simantics.db.procore.cluster.ClusterTraits;
@@ -40,9 +42,9 @@ public class ClusterChangeSet {
                        this.newValue = null;
                }
 
-               public Entry(int subject, boolean oldValueEx, byte[] oldValue, byte[] newValue) {
+               public Entry(int subject, boolean oldValueEx, byte[] oldValue, byte[] newValue) throws IllegalAcornStateException {
                        if(oldValue == null && newValue == null)
-                               throw new IllegalStateException();
+                               throw new IllegalAcornStateException("oldValue == null && newValue == null");
                        this.type = Type.VALUE;
                        this.subject = (short)(subject & 0xFFF);
                        this.predicate = 0;
@@ -54,7 +56,7 @@ public class ClusterChangeSet {
                        this.newValue = newValue;
                }
                
-               public void process(ClusterManager clusters, ClusterChange cs, int clusterKey) {
+               public void process(ClusterManager clusters, ClusterChange cs, int clusterKey) throws AcornAccessVerificationException {
                        
                        Entry e = this;
                        
@@ -113,7 +115,7 @@ public class ClusterChangeSet {
                chunkOffset = Integer.parseInt(ss[1]);
        }
        
-       public ClusterStreamChunk getChunk(ClusterManager manager) {
+       public ClusterStreamChunk getChunk(ClusterManager manager) throws AcornAccessVerificationException {
                return manager.streamLRU.get(chunkKey);
        }