Program: 114791
Project: 114791
Buggy source:
private List<String> readSQLStatements(InputStream is,String dbType){
  List<String> sqlStatements=new ArrayList<>();
  try {
    BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(is,"String_Node_Str"));
    String sqlQuery="String_Node_Str";
    boolean isFoundQueryEnd=false;
    String line;
    while ((line=bufferedReader.readLine()) != null) {
      line=line.trim();
      if (line.startsWith("String_Node_Str") || line.startsWith("String_Node_Str")) {
        continue;
      }
      StringTokenizer stringTokenizer=new StringTokenizer(line);
      if (stringTokenizer.hasMoreTokens()) {
        String token=stringTokenizer.nextToken();
        if ("String_Node_Str".equalsIgnoreCase(token)) {
          continue;
        }
      }
      if (line.contains("String_Node_Str")) {
        line=line.replace("String_Node_Str","String_Node_Str");
      }
      sqlQuery+=' ' + line;
      if (line.contains("String_Node_Str")) {
        isFoundQueryEnd=true;
      }
      if (org.wso2.carbon.apimgt.migration.util.Constants.DB_TYPE_ORACLE.equals(dbType)) {
        if ("String_Node_Str".equals(line.trim())) {
          isFoundQueryEnd=true;
        }
 else {
          isFoundQueryEnd=false;
        }
        sqlQuery=sqlQuery.replaceAll("String_Node_Str","String_Node_Str");
        sqlQuery=sqlQuery.replaceAll("String_Node_Str","String_Node_Str");
      }
      if (org.wso2.carbon.apimgt.migration.util.Constants.DB_TYPE_DB2.equals(dbType)) {
        sqlQuery=sqlQuery.replace("String_Node_Str","String_Node_Str");
      }
      if (isFoundQueryEnd) {
        if (sqlQuery.length() > 0) {
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str" + sqlQuery);
          }
          sqlStatements.add(sqlQuery.trim());
        }
        sqlQuery="String_Node_Str";
        isFoundQueryEnd=false;
      }
    }
    bufferedReader.close();
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
  }
  return sqlStatements;
}

Fixed version (ground truth):
private List<String> readSQLStatements(InputStream is,String dbType){
  List<String> sqlStatements=new ArrayList<>();
  try {
    BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(is,"String_Node_Str"));
    String sqlQuery="String_Node_Str";
    boolean isFoundQueryEnd=false;
    String line;
    while ((line=bufferedReader.readLine()) != null) {
      line=line.trim();
      if (line.startsWith("String_Node_Str") || line.startsWith("String_Node_Str")) {
        continue;
      }
      StringTokenizer stringTokenizer=new StringTokenizer(line);
      if (stringTokenizer.hasMoreTokens()) {
        String token=stringTokenizer.nextToken();
        if ("String_Node_Str".equalsIgnoreCase(token)) {
          continue;
        }
      }
      if (line.contains("String_Node_Str")) {
        line=line.replace("String_Node_Str","String_Node_Str");
      }
      sqlQuery+=' ' + line;
      if (line.contains("String_Node_Str")) {
        isFoundQueryEnd=true;
      }
      if (org.wso2.carbon.apimgt.migration.util.Constants.DB_TYPE_ORACLE.equals(dbType)) {
        if ("String_Node_Str".equals(line.trim())) {
          isFoundQueryEnd=true;
        }
 else {
          isFoundQueryEnd=false;
        }
        sqlQuery=sqlQuery.replaceAll("String_Node_Str","String_Node_Str");
      }
      if (org.wso2.carbon.apimgt.migration.util.Constants.DB_TYPE_DB2.equals(dbType)) {
        sqlQuery=sqlQuery.replace("String_Node_Str","String_Node_Str");
      }
      if (isFoundQueryEnd) {
        if (sqlQuery.length() > 0) {
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str" + sqlQuery);
          }
          sqlStatements.add(sqlQuery.trim());
        }
        sqlQuery="String_Node_Str";
        isFoundQueryEnd=false;
      }
    }
    bufferedReader.close();
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
  }
  return sqlStatements;
}