]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.acorn/src/org/simantics/acorn/lru/ChangeSetInfo.java
Acorn: Fix WriteRunnable.runReally() and other fixes
[simantics/platform.git] / bundles / org.simantics.acorn / src / org / simantics / acorn / lru / ChangeSetInfo.java
index 12351a5194c3b07a17845cf8cb7a06f8d8fb6dd2..a730e136d3b8bce4c6bd18b922fb3344a0285d53 100644 (file)
@@ -4,6 +4,8 @@ import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Arrays;
 
+import org.simantics.acorn.exception.AcornAccessVerificationException;
+import org.simantics.acorn.exception.IllegalAcornStateException;
 import org.simantics.db.service.Bytes;
 import org.simantics.utils.datastructures.Pair;
 
@@ -15,13 +17,13 @@ public class ChangeSetInfo extends LRUObject<Long, ChangeSetInfo> {
        private ArrayList<String> clusterChangeSetIds;
        
        // Stub
-       public ChangeSetInfo(LRU<Long, ChangeSetInfo> LRU, Path readDir, Long revision, int offset, int length) {
+       public ChangeSetInfo(LRU<Long, ChangeSetInfo> LRU, Path readDir, Long revision, int offset, int length) throws AcornAccessVerificationException {
                super(LRU, revision, readDir, "clusterStream", offset, length, false, false);
                LRU.map(this);
        }
        
        // New
-       public ChangeSetInfo(LRU<Long, ChangeSetInfo> LRU, Long revision, byte[] bytes, ArrayList<String> clusterChangeSetIds) {
+       public ChangeSetInfo(LRU<Long, ChangeSetInfo> LRU, Long revision, byte[] bytes, ArrayList<String> clusterChangeSetIds) throws AcornAccessVerificationException {
                super(LRU, revision, LRU.getDirectory(), "clusterStream", true, true);
                this.metadataBytes = bytes;
                this.metadataBytes = bytes;
@@ -29,19 +31,17 @@ public class ChangeSetInfo extends LRUObject<Long, ChangeSetInfo> {
                LRU.insert(this, accessTime);
        }
        
-       public ArrayList<String> getCSSIds() {
+       public ArrayList<String> getCSSIds() throws AcornAccessVerificationException {
                if(VERIFY) verifyAccess();
                return clusterChangeSetIds;
        }
        
-       public byte[] getMetadataBytes() {
-               
-               if(VERIFY) verifyAccess();
+       public byte[] getMetadataBytes() throws AcornAccessVerificationException, IllegalAcornStateException {
+               if(VERIFY)
+                   verifyAccess();
                
                makeResident();
-               
                return metadataBytes;
-               
        }
        
        private static void writeLE(TByteArrayList bytes, int value) {