- for (NameValuePair i : currentNode.getSetSet()) {
- if (i.getIsManual()) // Manual input: we have no conflict
- continue;
-
- valueMap.put(i.getVarName(), i.getValue());
- if (writerMap.containsKey(i.getVarName()))
- writerMap.put(i.getVarName(), i.getAppNum()+writerMap.get(i.getVarName())); // We have two writers?
- else
- writerMap.put(i.getVarName(), i.getAppNum());
+ // Update the valueMap and check if we have conflict in the setSet
+ for (NameValuePair i : nodeToProcess.getSetSet()) {
+ if (i.getIsManual()) // Manual input: we have no conflict
+ continue; // If this manual write is the last write, this is actually a break
+
+ if (valueMap.containsKey(i.getVarName())) {
+ if (!valueMap.get(i.getVarName()).equals(i.getValue())) { // Check if their value is different we have a conflict
+ errorMessage = createErrorMessage(i, valueMap, writerMap);
+ return true;
+ }
+ else // We have two writers writing the same value
+ writerMap.put(i.getVarName(), i.getAppNum()+writerMap.get(i.getVarName()));
+ } else {
+ valueMap.put(i.getVarName(), i.getValue());
+ writerMap.put(i.getVarName(), i.getAppNum());
+ }