Program: 63400
Project: 63400
Buggy source:
/** 
 * Append the expression and recursively to the query row.
 */
protected void appendExpressionToQueryRow(Expression expression,AbstractRecord row,DatabaseQuery query){
  if (expression.isRelationExpression()) {
    RelationExpression relation=(RelationExpression)expression;
    Object left=extractValueFromExpression(relation.getFirstChild(),query);
    Object right=extractValueFromExpression(relation.getSecondChild(),query);
    if (relation.getOperator().getSelector() == ExpressionOperator.Equal) {
      row.put(left,right);
    }
 else {
      DatabaseRecord nested=new DatabaseRecord();
      if (relation.getOperator().getSelector() == ExpressionOperator.GreaterThan) {
        nested.put("String_Node_Str",right);
      }
 else       if (relation.getOperator().getSelector() == ExpressionOperator.LessThan) {
        nested.put("String_Node_Str",right);
      }
 else       if (relation.getOperator().getSelector() == ExpressionOperator.LessThanEqual) {
        nested.put("String_Node_Str",right);
      }
 else       if (relation.getOperator().getSelector() == ExpressionOperator.GreaterThanEqual) {
        nested.put("String_Node_Str",right);
      }
 else       if (relation.getOperator().getSelector() == ExpressionOperator.NotEqual) {
        nested.put("String_Node_Str",right);
      }
 else       if (relation.getOperator().getSelector() == ExpressionOperator.In) {
        nested.put("String_Node_Str",right);
        row.put(left,nested);
      }
 else       if (relation.getOperator().getSelector() == ExpressionOperator.NotIn) {
        nested.put("String_Node_Str",right);
        row.put(left,nested);
      }
 else {
        throw new EISException("String_Node_Str" + expression + "String_Node_Str"+ query);
      }
      row.put(left,nested);
    }
  }
 else   if (expression.isLogicalExpression()) {
    LogicalExpression logic=(LogicalExpression)expression;
    DatabaseRecord first=new DatabaseRecord();
    DatabaseRecord second=new DatabaseRecord();
    appendExpressionToQueryRow(logic.getFirstChild(),first,query);
    appendExpressionToQueryRow(logic.getSecondChild(),second,query);
    List nested=new Vector();
    nested.add(first);
    nested.add(second);
    if (logic.getOperator().getSelector() == ExpressionOperator.And) {
      row.put("String_Node_Str",nested);
    }
 else     if (logic.getOperator().getSelector() == ExpressionOperator.Or) {
      row.put("String_Node_Str",nested);
    }
 else {
      throw new EISException("String_Node_Str" + expression + "String_Node_Str"+ query);
    }
  }
 else   if (expression.isFunctionExpression()) {
    FunctionExpression function=(FunctionExpression)expression;
    if (function.getOperator().getSelector() == ExpressionOperator.Like) {
      Object left=extractValueFromExpression((Expression)function.getChildren().get(0),query);
      Object right=extractValueFromExpression((Expression)function.getChildren().get(1),query);
      if (!(right instanceof String)) {
        throw new EISException("String_Node_Str" + right + "String_Node_Str"+ query);
      }
      String pattern=(String)right;
      DatabaseRecord nested=new DatabaseRecord();
      if (!this.isLikeRegex) {
        pattern=Helper.convertLikeToRegex(pattern);
      }
      nested.put("String_Node_Str",pattern);
      row.put(left,nested);
    }
 else     if (function.getOperator().getSelector() == ExpressionOperator.Not) {
      DatabaseRecord nested=new DatabaseRecord();
      appendExpressionToQueryRow((Expression)function.getChildren().get(0),nested,query);
      row.put("String_Node_Str",nested);
    }
 else {
      throw new EISException("String_Node_Str" + expression + "String_Node_Str"+ query);
    }
  }
 else {
    throw new EISException("String_Node_Str" + expression + "String_Node_Str"+ query);
  }
}

Fixed version (ground truth):
/** 
 * Append the expression and recursively to the query row.
 */
protected void appendExpressionToQueryRow(Expression expression,AbstractRecord row,DatabaseQuery query){
  if (expression.isRelationExpression()) {
    RelationExpression relation=(RelationExpression)expression;
    Object left=extractValueFromExpression(relation.getFirstChild(),query);
    Object right=extractValueFromExpression(relation.getSecondChild(),query);
    if (relation.getOperator().getSelector() == ExpressionOperator.Equal) {
      row.put(left,right);
    }
 else {
      DatabaseRecord nested=new DatabaseRecord();
      if (relation.getOperator().getSelector() == ExpressionOperator.GreaterThan) {
        nested.put("String_Node_Str",right);
      }
 else       if (relation.getOperator().getSelector() == ExpressionOperator.LessThan) {
        nested.put("String_Node_Str",right);
      }
 else       if (relation.getOperator().getSelector() == ExpressionOperator.LessThanEqual) {
        nested.put("String_Node_Str",right);
      }
 else       if (relation.getOperator().getSelector() == ExpressionOperator.GreaterThanEqual) {
        nested.put("String_Node_Str",right);
      }
 else       if (relation.getOperator().getSelector() == ExpressionOperator.NotEqual) {
        nested.put("String_Node_Str",right);
      }
 else       if (relation.getOperator().getSelector() == ExpressionOperator.In) {
        nested.put("String_Node_Str",right);
        row.put(left,nested);
      }
 else       if (relation.getOperator().getSelector() == ExpressionOperator.NotIn) {
        nested.put("String_Node_Str",right);
        row.put(left,nested);
      }
 else {
        throw new EISException("String_Node_Str" + expression + "String_Node_Str"+ query);
      }
      row.put(left,nested);
    }
  }
 else   if (expression.isLogicalExpression()) {
    LogicalExpression logic=(LogicalExpression)expression;
    DatabaseRecord first=new DatabaseRecord();
    DatabaseRecord second=new DatabaseRecord();
    appendExpressionToQueryRow(logic.getFirstChild(),first,query);
    appendExpressionToQueryRow(logic.getSecondChild(),second,query);
    List nested=new Vector();
    nested.add(first);
    nested.add(second);
    if (logic.getOperator().getSelector() == ExpressionOperator.And) {
      row.put("String_Node_Str",nested);
    }
 else     if (logic.getOperator().getSelector() == ExpressionOperator.Or) {
      row.put("String_Node_Str",nested);
    }
 else {
      throw new EISException("String_Node_Str" + expression + "String_Node_Str"+ query);
    }
  }
 else   if (expression.isFunctionExpression()) {
    FunctionExpression function=(FunctionExpression)expression;
    if (function.getOperator().getSelector() == ExpressionOperator.Like) {
      Object left=extractValueFromExpression((Expression)function.getChildren().get(0),query);
      Object right=extractValueFromExpression((Expression)function.getChildren().get(1),query);
      if (!(right instanceof String)) {
        throw new EISException("String_Node_Str" + right + "String_Node_Str"+ query);
      }
      String pattern=(String)right;
      DatabaseRecord nested=new DatabaseRecord();
      if (!this.isLikeRegex) {
        pattern=Helper.convertLikeToRegex(pattern);
      }
      nested.put("String_Node_Str",pattern);
      row.put(left,nested);
    }
 else     if (function.getOperator().getSelector() == ExpressionOperator.Not) {
      Expression expr=(Expression)function.getChildren().get(0);
      if (expr.isRelationExpression()) {
        RelationExpression relation=(RelationExpression)expr;
        Object left=extractValueFromExpression(relation.getFirstChild(),query);
        Object right=extractValueFromExpression(relation.getSecondChild(),query);
        DatabaseRecord nested=new DatabaseRecord();
        if (expr.getOperator().getSelector() == ExpressionOperator.Equal) {
          nested.put("String_Node_Str",right);
        }
 else {
          nested.put("String_Node_Str",right);
        }
        row.put(left,nested);
      }
 else {
        throw new EISException("String_Node_Str" + expression + "String_Node_Str"+ query);
      }
    }
 else {
      throw new EISException("String_Node_Str" + expression + "String_Node_Str"+ query);
    }
  }
 else {
    throw new EISException("String_Node_Str" + expression + "String_Node_Str"+ query);
  }
}