Program: 168471
Project: 168471
Buggy source:
/** 
 * Adds the update relation.
 * @param left the left selector
 * @param operator the operator
 * @param right the right selector
 * @return a new relation which is needed to manage. Otherwise, a null value is returned
 * @throws UnsupportedException the unsupported exception
 * @throws ExecutionException the execution exception
 */
public Relation addUpdateRelation(Selector left,Operator operator,Selector right) throws UnsupportedException, ExecutionException {
  BasicDBObject basicDBObject;
  Relation relation=null;
switch (operator) {
case EQ:
case ASSIGN:
    if (right.getType() == SelectorType.RELATION) {
      String column=(String)SelectorHelper.getRestrictedValue(left,SelectorType.COLUMN);
      RelationSelector rightSelector=(RelationSelector)right;
      String innerRelationColumn=(String)SelectorHelper.getRestrictedValue(rightSelector.getRelation().getLeftTerm(),SelectorType.COLUMN);
      if (column.equals(innerRelationColumn)) {
        return rightSelector.getRelation();
      }
 else {
        throw new UnsupportedException("String_Node_Str" + column + "String_Node_Str"+ innerRelationColumn);
      }
    }
  if (relations.containsField(SET_COMMAND)) {
    basicDBObject=(BasicDBObject)relations.get(SET_COMMAND);
    basicDBObject.putAll(getBasicRelation(left,right));
  }
 else {
    basicDBObject=new BasicDBObject();
    basicDBObject.putAll(getBasicRelation(left,right));
    relations.put(SET_COMMAND,basicDBObject);
  }
break;
case ADD:
if (relations.containsField(INCREMENT_COMMAND)) {
basicDBObject=(BasicDBObject)relations.get(INCREMENT_COMMAND);
basicDBObject.putAll(getIncrementalRelation(left,right,false));
}
 else {
basicDBObject=new BasicDBObject();
basicDBObject.putAll(getIncrementalRelation(left,right,false));
relations.put(INCREMENT_COMMAND,basicDBObject);
}
break;
case SUBTRACT:
if (relations.containsField(INCREMENT_COMMAND)) {
basicDBObject=(BasicDBObject)relations.get(INCREMENT_COMMAND);
basicDBObject.putAll(getIncrementalRelation(left,right,true));
}
 else {
basicDBObject=new BasicDBObject();
basicDBObject.putAll(getIncrementalRelation(left,right,true));
relations.put(INCREMENT_COMMAND,basicDBObject);
}
break;
case MULTIPLICATION:
if (relations.containsField(MUTLTIPLICATION_COMMAND)) {
basicDBObject=(BasicDBObject)relations.get(MUTLTIPLICATION_COMMAND);
basicDBObject.putAll(getNumberRelation(left,right));
}
 else {
basicDBObject=new BasicDBObject();
basicDBObject.putAll(getNumberRelation(left,right));
relations.put(MUTLTIPLICATION_COMMAND,basicDBObject);
}
break;
case DIVISION:
case DISTINCT:
case BETWEEN:
case MATCH:
case GET:
case GT:
case IN:
case LET:
case LIKE:
case LT:
default :
throw new UnsupportedException("String_Node_Str" + operator + "String_Node_Str");
}
return relation;
}

Fixed version (ground truth):
/** 
 * Adds an update relation.
 * @param left the left selector
 * @param operator the operator
 * @param right the right selector
 * @return a new relation which is needed to manage. Otherwise, a null value is returned
 * @throws UnsupportedException the unsupported exception
 * @throws ExecutionException the execution exception
 */
public Relation addUpdateRelation(Selector left,Operator operator,Selector right) throws UnsupportedException, ExecutionException {
  BasicDBObject basicDBObject;
  Relation relation=null;
switch (operator) {
case EQ:
case ASSIGN:
    if (containsAnInnerRelation(left,right)) {
      return ((RelationSelector)right).getRelation();
    }
 else {
      if (relations.containsField(SET_COMMAND)) {
        basicDBObject=(BasicDBObject)relations.get(SET_COMMAND);
        basicDBObject.putAll(getBasicRelation(left,right));
      }
 else {
        basicDBObject=new BasicDBObject();
        basicDBObject.putAll(getBasicRelation(left,right));
        relations.put(SET_COMMAND,basicDBObject);
      }
    }
  break;
case ADD:
if (relations.containsField(INCREMENT_COMMAND)) {
  basicDBObject=(BasicDBObject)relations.get(INCREMENT_COMMAND);
  basicDBObject.putAll(getIncrementalRelation(left,right,false));
}
 else {
  basicDBObject=new BasicDBObject();
  basicDBObject.putAll(getIncrementalRelation(left,right,false));
  relations.put(INCREMENT_COMMAND,basicDBObject);
}
break;
case SUBTRACT:
if (relations.containsField(INCREMENT_COMMAND)) {
basicDBObject=(BasicDBObject)relations.get(INCREMENT_COMMAND);
basicDBObject.putAll(getIncrementalRelation(left,right,true));
}
 else {
basicDBObject=new BasicDBObject();
basicDBObject.putAll(getIncrementalRelation(left,right,true));
relations.put(INCREMENT_COMMAND,basicDBObject);
}
break;
case MULTIPLICATION:
if (relations.containsField(MUTLTIPLICATION_COMMAND)) {
basicDBObject=(BasicDBObject)relations.get(MUTLTIPLICATION_COMMAND);
basicDBObject.putAll(getNumberRelation(left,right));
}
 else {
basicDBObject=new BasicDBObject();
basicDBObject.putAll(getNumberRelation(left,right));
relations.put(MUTLTIPLICATION_COMMAND,basicDBObject);
}
break;
default :
throw new UnsupportedException("String_Node_Str" + operator + "String_Node_Str");
}
return relation;
}