]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/Operations.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / util / Operations.java
index 21911f412cfd9ef7d3fe2992f9f924a5e8f4a416..25a1bcf102d3a0176c733410b34a25e0cecfe199 100644 (file)
@@ -1,27 +1,27 @@
-package org.simantics.db.layer0.util;\r
-\r
-import org.simantics.db.RequestProcessor;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.common.request.AdaptValue;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.layer0.exception.OperationNotAllowedException;\r
-import org.simantics.db.request.WriteResult;\r
-import org.simantics.scl.runtime.function.Function;\r
-\r
-public class Operations {\r
-\r
-    public static boolean isAllowed(RequestProcessor rp, Resource operation) throws DatabaseException {\r
-        return true;\r
-    }\r
-    \r
-    public static <T> T exec(RequestProcessor rp, \r
-            Resource operation, Object ... parameters) throws DatabaseException, OperationNotAllowedException {\r
-        if(!isAllowed(rp, operation))\r
-            throw new OperationNotAllowedException();\r
-        Object op = rp.syncRequest(new AdaptValue(operation));\r
-        if(parameters.length > 0)\r
-            op = ((Function)op).applyArray(parameters);\r
-        return rp.syncRequest((WriteResult<T>)op);\r
-    }\r
-    \r
-}\r
+package org.simantics.db.layer0.util;
+
+import org.simantics.db.RequestProcessor;
+import org.simantics.db.Resource;
+import org.simantics.db.common.request.AdaptValue;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.layer0.exception.OperationNotAllowedException;
+import org.simantics.db.request.WriteResult;
+import org.simantics.scl.runtime.function.Function;
+
+public class Operations {
+
+    public static boolean isAllowed(RequestProcessor rp, Resource operation) throws DatabaseException {
+        return true;
+    }
+    
+    public static <T> T exec(RequestProcessor rp, 
+            Resource operation, Object ... parameters) throws DatabaseException, OperationNotAllowedException {
+        if(!isAllowed(rp, operation))
+            throw new OperationNotAllowedException();
+        Object op = rp.syncRequest(new AdaptValue(operation));
+        if(parameters.length > 0)
+            op = ((Function)op).applyArray(parameters);
+        return rp.syncRequest((WriteResult<T>)op);
+    }
+    
+}