]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/ValueUpdateSet.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / query / ValueUpdateSet.java
index 8e7144f4df144f991c9b6036fe4c9505a9ea325d..e2c44a79e300981b27092684e44fa8af7f29d6f7 100644 (file)
@@ -1,51 +1,51 @@
-package org.simantics.db.impl.query;\r
-\r
-import gnu.trove.procedure.TIntProcedure;\r
-import gnu.trove.set.hash.TIntHashSet;\r
-\r
-final public class ValueUpdateSet {\r
-\r
-       private int first = 0;\r
-       public TIntHashSet rest = new TIntHashSet();\r
-       \r
-       public int size() {\r
-               if(first != 0) return 1;\r
-               else return rest.size();\r
-       }\r
-       \r
-       public int getFirst() {\r
-               return first;\r
-       }\r
-       \r
-       public void add(int l) {\r
-               if(first == 0) {\r
-                       if(rest.isEmpty()) {\r
-                               first = l;\r
-                       } else {\r
-                               rest.add(l);\r
-                       }\r
-               } else {\r
-                       if(l == first) return;\r
-                       rest.add(first);\r
-                       rest.add(l);\r
-                       first = 0;\r
-               }\r
-       }\r
-       \r
-       public void clear() {\r
-               first = 0;\r
-               if(!rest.isEmpty()) {\r
-                       rest = new TIntHashSet();\r
-                       //System.err.println("new rest!");\r
-               }\r
-       }\r
-       \r
-       public void forEach(TIntProcedure proc) {\r
-               if(first != 0) {\r
-                       proc.execute(first);\r
-               } else {\r
-                       rest.forEach(proc);\r
-               }\r
-       }\r
-       \r
-}\r
+package org.simantics.db.impl.query;
+
+import gnu.trove.procedure.TIntProcedure;
+import gnu.trove.set.hash.TIntHashSet;
+
+final public class ValueUpdateSet {
+
+       private int first = 0;
+       public TIntHashSet rest = new TIntHashSet();
+       
+       public int size() {
+               if(first != 0) return 1;
+               else return rest.size();
+       }
+       
+       public int getFirst() {
+               return first;
+       }
+       
+       public void add(int l) {
+               if(first == 0) {
+                       if(rest.isEmpty()) {
+                               first = l;
+                       } else {
+                               rest.add(l);
+                       }
+               } else {
+                       if(l == first) return;
+                       rest.add(first);
+                       rest.add(l);
+                       first = 0;
+               }
+       }
+       
+       public void clear() {
+               first = 0;
+               if(!rest.isEmpty()) {
+                       rest = new TIntHashSet();
+                       //System.err.println("new rest!");
+               }
+       }
+       
+       public void forEach(TIntProcedure proc) {
+               if(first != 0) {
+                       proc.execute(first);
+               } else {
+                       rest.forEach(proc);
+               }
+       }
+       
+}