boolean propagateTheChange(Node currentNode) {
HashSet<Node> changed = new HashSet<Node>(currentNode.getSuccessors());
- HashSet<Node> parentSet = new HashSet<Node>();
while(!changed.isEmpty()) {
// Get the first element of HashSet and remove it from the changed set
Node nodeToProcess = changed.iterator().next();
changed.remove(nodeToProcess);
- // Change the parent node
- if (!currentNode.getSuccessors().contains(nodeToProcess)) {
- currentNode = parentSet.iterator().next();
- parentSet.remove(currentNode);
- }
-
-
// Update the edge
boolean isChanged = updateEdge(currentNode, nodeToProcess);
// Checking if the out set has changed or not(Add its successors to the change list!)
if (isChanged) {
- parentSet.add(nodeToProcess);
- for (Node i : nodeToProcess.getSuccessors()) {
- changed.add(i);
- }
+ propagateTheChange(nodeToProcess);
}
}
" to the variable: "+pair.getVarName()+" while App"+
writerMap.get(pair.getVarName())+" is overwriting the value: "
+valueMap.get(pair.getVarName())+" to the same variable!";
+ System.out.println(message);
return message;
}
Integer writer = writerMap.get(i.getVarName());
if ((value != null)&&(writer != null)) {
if (!value.equals(i.getValue())&&!writer.equals(i.getAppNum())) { // We have different values
- System.out.println("we are here!!!!");
errorMessage = createErrorMessage(i, valueMap, writerMap);
return true;
}
ArrayList<NameValuePair> setSet = currentNode.getSetSetMap().get(parentNode);
HashSet<String> updatedVarNames = new HashSet<String>();
boolean isChanged = false;
-
- for (int i = 0;i < setSet.size();i++) {
- updatedVarNames.add(setSet.get(i).getVarName());
+
+ if (setSet != null) {
+ for (int i = 0;i < setSet.size();i++) {
+ updatedVarNames.add(setSet.get(i).getVarName());
+ }
}
for (NameValuePair i : parentNode.getOutSet()) {
isChanged |= currentNode.getOutSet().add(i);
}
- for (int i = 0;i < setSet.size();i++) {
- isChanged |= currentNode.getOutSet().add(setSet.get(i));
+ if (setSet != null) {
+ for (int i = 0;i < setSet.size();i++) {
+ isChanged |= currentNode.getOutSet().add(setSet.get(i));
+ }
}
return isChanged;
// Check for the conflict in this edge
conflictFound = checkForConflict(currentNode);
-
+
// Check if the outSet of this state has changed, update all of its successors' sets if any
if (isChanged)
conflictFound = conflictFound || propagateTheChange(currentNode);
} else {
if (executedInsn instanceof WriteInstruction) {
String varId = ((WriteInstruction) executedInsn).getFieldInfo().getFullName();
+
for (String var : conflictSet) {
if (varId.contains(var)) {
// Get variable info