From: Brian Demsky Date: Tue, 17 Dec 2019 06:57:19 +0000 (-0800) Subject: Make updates and not edges have manual property X-Git-Url: http://plrg.eecs.uci.edu/git/?p=jpf-core.git;a=commitdiff_plain;h=4dc7b430e4ec5e2cdba1c837b1c4960a5875cd6a Make updates and not edges have manual property --- diff --git a/src/main/gov/nasa/jpf/listener/ConflictTracker.java b/src/main/gov/nasa/jpf/listener/ConflictTracker.java index a61da9c..3ec1eea 100644 --- a/src/main/gov/nasa/jpf/listener/ConflictTracker.java +++ b/src/main/gov/nasa/jpf/listener/ConflictTracker.java @@ -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 updates = new ArrayList(); - boolean ismanual; - Edge(Node src, Node dst, Transition t, ArrayList _updates, boolean _ismanual) { + Edge(Node src, Node dst, Transition t, ArrayList _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); }