Minor bug fix in ConflictTracker.java
authorSeyed Amir Hossein Aqajari <saqajari@circinus-28.ics.uci.edu>
Mon, 18 Nov 2019 23:47:44 +0000 (15:47 -0800)
committerSeyed Amir Hossein Aqajari <saqajari@circinus-28.ics.uci.edu>
Mon, 18 Nov 2019 23:47:44 +0000 (15:47 -0800)
src/main/gov/nasa/jpf/listener/ConflictTracker.java

index ca405b2..b5c8d08 100644 (file)
@@ -172,11 +172,14 @@ public class ConflictTracker extends ListenerAdapter {
   boolean updateEdge(Node parentNode, Node currentNode) {
        ArrayList<NameValuePair> setSet = currentNode.getSetSetMap().get(parentNode);
        HashSet<String> updatedVarNames = new HashSet<String>();
+       HashMap<Integer, String> writerLastValue = new HashMap<Integer, String>();
+
        boolean isChanged = false;
        
        if (setSet != null) {
                for (int i = 0;i < setSet.size();i++) {
                        updatedVarNames.add(setSet.get(i).getVarName());
+                       writerLastValue.put(setSet.get(i).getAppNum(), setSet.get(i).getValue());
                }
        }
 
@@ -187,9 +190,9 @@ public class ConflictTracker extends ListenerAdapter {
 
        if (setSet != null) {
                for (int i = 0;i < setSet.size();i++) {
-                       if (currentNode.getOutSet().contains(setSet.get(i)))
-                               currentNode.getOutSet().remove(setSet.get(i));
-                       isChanged |= currentNode.getOutSet().add(setSet.get(i));
+                       if (setSet.get(i).getValue().equals(writerLastValue.get(setSet.get(i).getAppNum()))) {
+                               isChanged |= currentNode.getOutSet().add(setSet.get(i));
+                       }
                }
        }