Program: 17961
Project: 17961
Buggy source:
@Override protected QueryNode postProcessNode(QueryNode node) throws QueryNodeException {
  if (node instanceof AqpWhiteSpacedQueryNode) {
    QueryConfigHandler config=getQueryConfigHandler();
    if (!config.has(AqpAdsabsQueryConfigHandler.ConfigurationKeys.FUNCTION_QUERY_BUILDER_CONFIG)) {
      throw new QueryNodeException(new MessageImpl("String_Node_Str","String_Node_Str"));
    }
    String funcName=getFuncName();
    String subQuery=((FieldQueryNode)node).getTextAsString();
    String field=((FieldQueryNode)node).getFieldAsString();
    if (field != null) {
      subQuery=field + "String_Node_Str" + subQuery;
    }
    if (node.getParent() instanceof SlopQueryNode) {
      subQuery="String_Node_Str" + subQuery + "String_Node_Str";
      subQuery=subQuery + "String_Node_Str" + ((SlopQueryNode)node.getParent()).getValue();
      if (node.getParent().getParent() instanceof BoostQueryNode) {
        subQuery=subQuery + "String_Node_Str" + ((BoostQueryNode)node.getParent().getParent()).getValue();
      }
    }
 else     if (node.getParent() instanceof BoostQueryNode) {
      subQuery="String_Node_Str" + subQuery + "String_Node_Str";
      subQuery=subQuery + "String_Node_Str" + ((BoostQueryNode)node.getParent()).getValue();
    }
    node.setTag("String_Node_Str",subQuery);
    AqpFunctionQueryBuilder builder=config.get(AqpAdsabsQueryConfigHandler.ConfigurationKeys.FUNCTION_QUERY_BUILDER_CONFIG).getBuilder(funcName,(QueryNode)node,config);
    if (builder == null) {
      throw new QueryNodeException(new MessageImpl(QueryParserMessages.INVALID_SYNTAX,"String_Node_Str" + funcName + "String_Node_Str"));
    }
    List<OriginalInput> fValues=new ArrayList<OriginalInput>();
    fValues.add(new OriginalInput(subQuery,((AqpWhiteSpacedQueryNode)node).getBegin(),((AqpWhiteSpacedQueryNode)node).getEnd()));
    return new AqpFunctionQueryNode(funcName,builder,fValues);
  }
  return node;
}

Fixed version (ground truth):
@Override protected QueryNode postProcessNode(QueryNode node) throws QueryNodeException {
  if (node instanceof AqpWhiteSpacedQueryNode) {
    QueryConfigHandler config=getQueryConfigHandler();
    if (!config.has(AqpAdsabsQueryConfigHandler.ConfigurationKeys.FUNCTION_QUERY_BUILDER_CONFIG)) {
      throw new QueryNodeException(new MessageImpl("String_Node_Str","String_Node_Str"));
    }
    String funcName=getFuncName();
    String subQuery=((FieldQueryNode)node).getTextAsString();
    String field=((FieldQueryNode)node).getFieldAsString();
    if (field.equals(config.get(AqpAdsabsQueryConfigHandler.ConfigurationKeys.UNFIELDED_SEARCH_FIELD))) {
      field=null;
    }
    if (field != null) {
      subQuery=field + "String_Node_Str" + subQuery;
    }
    if (node.getParent() instanceof SlopQueryNode) {
      subQuery="String_Node_Str" + subQuery + "String_Node_Str";
      subQuery=subQuery + "String_Node_Str" + ((SlopQueryNode)node.getParent()).getValue();
      if (node.getParent().getParent() instanceof BoostQueryNode) {
        subQuery=subQuery + "String_Node_Str" + ((BoostQueryNode)node.getParent().getParent()).getValue();
      }
    }
 else     if (node.getParent() instanceof BoostQueryNode) {
      subQuery="String_Node_Str" + subQuery + "String_Node_Str";
      subQuery=subQuery + "String_Node_Str" + ((BoostQueryNode)node.getParent()).getValue();
    }
    node.setTag("String_Node_Str",subQuery);
    AqpFunctionQueryBuilder builder=config.get(AqpAdsabsQueryConfigHandler.ConfigurationKeys.FUNCTION_QUERY_BUILDER_CONFIG).getBuilder(funcName,(QueryNode)node,config);
    if (builder == null) {
      throw new QueryNodeException(new MessageImpl(QueryParserMessages.INVALID_SYNTAX,"String_Node_Str" + funcName + "String_Node_Str"));
    }
    List<OriginalInput> fValues=new ArrayList<OriginalInput>();
    fValues.add(new OriginalInput(subQuery,((AqpWhiteSpacedQueryNode)node).getBegin(),((AqpWhiteSpacedQueryNode)node).getEnd()));
    return new AqpFunctionQueryNode(funcName,builder,fValues);
  }
  return node;
}