From: amiraj Date: Fri, 18 Oct 2019 18:19:16 +0000 (-0700) Subject: Fixing a bug in listener! X-Git-Url: http://plrg.eecs.uci.edu/git/?p=jpf-core.git;a=commitdiff_plain;h=8d85c4be56e042244af49889fc5cf0a86db1b46d Fixing a bug in listener! --- diff --git a/src/main/gov/nasa/jpf/listener/ConflictTracker.java b/src/main/gov/nasa/jpf/listener/ConflictTracker.java index 9fb12cf..51e34fc 100644 --- a/src/main/gov/nasa/jpf/listener/ConflictTracker.java +++ b/src/main/gov/nasa/jpf/listener/ConflictTracker.java @@ -158,13 +158,16 @@ public class ConflictTracker extends ListenerAdapter { // Comparing the inSet and setSet to find the conflict for (NameValuePair i : currentNode.getInSet()) { if (valueMap.containsKey(i.getVarName())) { - if (!(valueMap.get(i.getVarName()).equals(i.getValue()))) // We have different values - if (!(writerMap.get(i.getVarName()).equals(i.getAppNum()))) {// We have different writers + String value = valueMap.get(i.getVarName()); + Integer writer = writerMap.get(i.getVarName()); + if ((value != null)&&(writer != null)) { + if (!value.equals(i.getValue())&&!writer.equals(i.getAppNum())) { // We have different values errorMessage = "Conflict found between the two apps. App"+i.getAppNum()+" has written the value: "+i.getValue()+ " to the variable: "+i.getVarName()+" while App"+writerMap.get(i.getVarName())+" is overwriting the value: " +valueMap.get(i.getVarName())+" to the same variable!"; return true; } + } } }