Program: 101947
Project: 101947
Buggy source:
private String procedure(Procedure procedure){
  if (!includeProcedures)   return null;
  if (ignoreTeiidProcedures && isTeiidProcedure(procedure.getName()))   return null;
  StringBuilder sb=new StringBuilder();
  boolean isFunction=procedure.isFunction();
  if (isFunction) {
    if (isVirtual)     sb.append(CREATE_VIRTUAL_FUNCTION).append(SPACE);
 else     sb.append(CREATE_FOREIGN_FUNCTION).append(SPACE);
  }
 else {
    if (isVirtual)     sb.append(CREATE_VIRTUAL_PROCEDURE).append(SPACE);
 else     sb.append(CREATE_FOREIGN_PROCEDURE).append(SPACE);
  }
  sb.append(getName(procedure));
  sb.append(SPACE + OPEN_BRACKET);
  @SuppressWarnings("String_Node_Str") List<ProcedureParameter> params=procedure.getParameters();
  int nParams=params.size();
  int count=0;
  for (  ProcedureParameter param : params) {
    String paramStr=getParameterDdl(param);
    count++;
    sb.append(paramStr);
    String options=getOptions(param);
    if (!StringUtilities.isEmpty(options)) {
      sb.append(SPACE).append(options);
    }
    if (count < nParams)     sb.append(COMMA + SPACE);
  }
  sb.append(CLOSE_BRACKET);
  if (procedure.getResult() != null) {
    sb.append(SPACE + RETURNS);
    String options=getOptions(procedure.getResult());
    if (!StringUtilities.isEmpty(options)) {
      sb.append(SPACE).append(options);
    }
    sb.append(SPACE + TABLE + SPACE);
    sb.append(OPEN_BRACKET);
    count=0;
    int nCols=procedure.getResult().getColumns().size();
    for (    Object col : procedure.getResult().getColumns()) {
      Column nextCol=(Column)col;
      count++;
      String columnStr=getColumnDdl(nextCol);
      sb.append(columnStr);
      if (count < nCols)       sb.append(COMMA + SPACE);
    }
    sb.append(CLOSE_BRACKET);
  }
  String options=getProcedureOptions(procedure);
  if (!StringUtilities.isEmpty(options)) {
    sb.append(NEW_LINE);
    sb.append(SPACE).append(options);
  }
  if (isVirtual && !isFunction) {
    TransformationMappingRoot tRoot=(TransformationMappingRoot)TransformationHelper.getTransformationMappingRoot(procedure);
    String sqlString=TransformationHelper.getSelectSqlString(tRoot).replace(CREATE_VIRTUAL_PROCEDURE,StringConstants.EMPTY_STRING);
    if (sqlString != null) {
      if (sqlString.indexOf('\n') == 0) {
        sqlString=sqlString.replace(StringConstants.NEW_LINE,StringConstants.EMPTY_STRING);
      }
      sb.append(NEW_LINE + TAB).append(Reserved.AS).append(NEW_LINE).append(sqlString);
      if (!sqlString.endsWith(SEMI_COLON))       sb.append(SEMI_COLON);
      sb.append(NEW_LINE);
    }
  }
 else {
    sb.append(SEMI_COLON + NEW_LINE);
  }
  return sb.toString();
}

Fixed version (ground truth):
private String procedure(Procedure procedure){
  if (!includeProcedures)   return null;
  if (ignoreTeiidProcedures && isTeiidProcedure(procedure.getName()))   return null;
  StringBuilder sb=new StringBuilder();
  boolean isFunction=procedure.isFunction();
  if (isFunction) {
    if (isVirtual)     sb.append(CREATE_VIRTUAL_FUNCTION).append(SPACE);
 else     sb.append(CREATE_FOREIGN_FUNCTION).append(SPACE);
  }
 else {
    if (isVirtual)     sb.append(CREATE_VIRTUAL_PROCEDURE).append(SPACE);
 else     sb.append(CREATE_FOREIGN_PROCEDURE).append(SPACE);
  }
  sb.append(getName(procedure));
  sb.append(SPACE + OPEN_BRACKET);
  @SuppressWarnings("String_Node_Str") List<ProcedureParameter> params=procedure.getParameters();
  int nParams=params.size();
  int count=0;
  for (  ProcedureParameter param : params) {
    if (count == 0)     sb.append(NEW_LINE);
    String paramStr=getParameterDdl(param);
    count++;
    sb.append(TAB).append(paramStr);
    String options=getOptions(param);
    if (!StringUtilities.isEmpty(options)) {
      sb.append(SPACE).append(options);
    }
    if (count < nParams)     sb.append(COMMA + NEW_LINE);
  }
  sb.append(NEW_LINE + CLOSE_BRACKET);
  if (procedure.getResult() != null) {
    sb.append(SPACE + RETURNS);
    String options=getOptions(procedure.getResult());
    if (!StringUtilities.isEmpty(options)) {
      sb.append(SPACE).append(options);
    }
    sb.append(NEW_LINE + TAB + TABLE+ SPACE);
    sb.append(OPEN_BRACKET);
    count=0;
    int nCols=procedure.getResult().getColumns().size();
    for (    Object col : procedure.getResult().getColumns()) {
      if (count == 0)       sb.append(NEW_LINE);
      Column nextCol=(Column)col;
      count++;
      String columnStr=getColumnDdl(nextCol);
      sb.append(TAB + TAB).append(columnStr);
      if (count < nCols)       sb.append(COMMA + NEW_LINE);
    }
    sb.append(NEW_LINE + CLOSE_BRACKET);
  }
  String options=getProcedureOptions(procedure);
  if (!StringUtilities.isEmpty(options)) {
    sb.append(SPACE).append(options);
  }
  if (isVirtual && !isFunction) {
    TransformationMappingRoot tRoot=(TransformationMappingRoot)TransformationHelper.getTransformationMappingRoot(procedure);
    String sqlString=TransformationHelper.getSelectSqlString(tRoot).replace(CREATE_VIRTUAL_PROCEDURE,StringConstants.EMPTY_STRING);
    if (sqlString != null) {
      if (sqlString.indexOf('\n') == 0) {
        sqlString=sqlString.replace(StringConstants.NEW_LINE,StringConstants.EMPTY_STRING);
      }
      sb.append(NEW_LINE + TAB).append(Reserved.AS).append(NEW_LINE).append(sqlString);
      if (!sqlString.endsWith(SEMI_COLON))       sb.append(SEMI_COLON);
      sb.append(NEW_LINE);
    }
  }
 else {
    sb.append(SEMI_COLON + NEW_LINE);
  }
  return sb.toString();
}