Make updates and not edges have manual property
[jpf-core.git] / src / main / gov / nasa / jpf / listener / ConflictTracker.java
index a61da9ce631738438ba055b3c7becee9936fe7b7..3ec1eea1b9b9d466a0d9db55e5d001e97dbb3de4 100644 (file)
@@ -129,7 +129,7 @@ public class ConflictTracker extends ListenerAdapter {
       }
 
       //Check for conflict with the appropriate update set if we are not a manual transition
-      if (confupdates != null && !e.isManual()) {
+      if (confupdates != null && !u.isManual()) {
         for(Update u2: confupdates) {
           if (conflicts(u, u2)) {
             throw new RuntimeException(createErrorMessage(u, u2));
@@ -177,13 +177,13 @@ public class ConflictTracker extends ListenerAdapter {
     return message;
   }
 
-  Edge createEdge(Node parent, Node current, Transition transition, boolean ismanual) {
+  Edge createEdge(Node parent, Node current, Transition transition) {
     //Check if this transition is explored.  If so, just skip everything
     if (transitions.contains(transition))
       return null;
 
     //Create edge
-    Edge e = new Edge(parent, current, transition, currUpdates, ismanual);
+    Edge e = new Edge(parent, current, transition, currUpdates);
     parent.addOutEdge(e);
 
     //Mark transition as explored
@@ -222,20 +222,14 @@ public class ConflictTracker extends ListenerAdapter {
     Node source, destination;
     Transition transition;
     ArrayList<Update> updates = new ArrayList<Update>();
-    boolean ismanual;
     
-    Edge(Node src, Node dst, Transition t, ArrayList<Update> _updates, boolean _ismanual) {
+    Edge(Node src, Node dst, Transition t, ArrayList<Update> _updates) {
       this.source = src;
       this.destination = dst;
       this.transition = t;
-      this.ismanual = _ismanual;
       this.updates.addAll(_updates);
     }
 
-    boolean isManual() {
-      return ismanual;
-    }
-
     Node getSrc() {
       return source;
     }
@@ -258,14 +252,20 @@ public class ConflictTracker extends ListenerAdapter {
     String deviceId;
     String attribute;
     String value;
-
-    Update(String _appName, String _deviceId, String _attribute, String _value) {
+    boolean ismanual;
+    
+    Update(String _appName, String _deviceId, String _attribute, String _value, boolean _ismanual) {
       this.appName = _appName;
       this.deviceId = _deviceId;
       this.attribute = _attribute;
       this.value = _value;
+      this.ismanual = _ismanual;
     }
 
+    boolean isManual() {
+      return ismanual;
+    }
+    
     String getApp() {
       return appName;
     }
@@ -359,7 +359,7 @@ public class ConflictTracker extends ListenerAdapter {
     Node currentNode = getNode(id);
 
     // Create an edge based on the current transition
-    Edge newEdge = createEdge(parentNode, currentNode, transition, manual);
+    Edge newEdge = createEdge(parentNode, currentNode, transition);
 
     // Reset the temporary variables and flags
     currUpdates.clear();
@@ -539,7 +539,7 @@ public class ConflictTracker extends ListenerAdapter {
   }
 
   private void writeWriterAndValue(String writer, String attribute, String value) {
-    Update u = new Update(writer, "DEVICE", attribute, value);
+    Update u = new Update(writer, "DEVICE", attribute, value, manual);
     currUpdates.add(u);
   }