From: amiraj Date: Fri, 18 Oct 2019 22:46:55 +0000 (-0700) Subject: Fixing a bug in ConflictTracker.java X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7208239ff942a7eb60c652342970ae6afb1976ba;p=jpf-core.git Fixing a bug in ConflictTracker.java --- diff --git a/src/main/gov/nasa/jpf/listener/ConflictTracker.java b/src/main/gov/nasa/jpf/listener/ConflictTracker.java index db47836..1343467 100644 --- a/src/main/gov/nasa/jpf/listener/ConflictTracker.java +++ b/src/main/gov/nasa/jpf/listener/ConflictTracker.java @@ -539,10 +539,13 @@ public class ConflictTracker extends ListenerAdapter { private void writeWriterAndValue(String writer, String value, String var) { // Update the temporary Set set. - if (writer.equals("App1")) - tempSetSet.add(new NameValuePair(1, value, var, manual)); - else if (writer.equals("App2")) - tempSetSet.add(new NameValuePair(2, value, var, manual)); + NameValuePair temp = new NameValuePair(1, value, var, manual); + if (writer.equals("App2")) + temp = new NameValuePair(2, value, var, manual); + + if (tempSetSet.contains(temp)) + tempSetSet.remove(temp); + tempSetSet.add(temp); // Set isSet to true isSet = true; }