Commits working, Transactions Working, Arbitrations working, Still needs a lot of...
[iotcloud.git] / version2 / src / java / iotcloud / Commit.java
index 1ee044df3e7cca9f22eeb29f071f8666989e2f49..86650c98a203bc83dac3f504b99d7554f7957c5f 100644 (file)
@@ -77,6 +77,7 @@ class Commit extends Entry {
        }
 
        public Entry getCopy(Slot s) {
+               // System.out.println("Commit Rescued:  " + this);  // TODO remove
                return new Commit(s, seqnumtrans, keyValueUpdateSet);
        }
 
@@ -89,14 +90,17 @@ class Commit extends Entry {
                        for (Iterator<KeyValue> i = keyValueUpdateSet.iterator(); i.hasNext();) {
                                KeyValue kv2 = i.next();
 
-                               if (kv1.getKey() == kv2.getKey()) {
-                                       keyValueUpdateSet.remove(kv2);
+                               if (kv1.getKey().equals(kv2.getKey())) {
+                                       // keyValueUpdateSet.remove(kv2);
+                                       i.remove();
                                        break;
                                }
                        }
                }
 
-               if (keyValueUpdateSet.size() == 0)
+               if (keyValueUpdateSet.size() == 0) {
+                       // System.out.println("Killed Commit:  " + this); // TODO remove
                        this.setDead();
+               }
        }
 }
\ No newline at end of file