Program: 115150
Project: 115150
Buggy source:
/** 
 * Runs an SQL script (read in using the Reader parameter) using the connection passed in
 * @param conn - the connection to use for the script
 * @param reader - the source of the script
 * @throws SQLException if any SQL errors occur
 * @throws IOException if there is an error reading from the Reader
 */
private void runScript(Connection conn,Reader reader) throws IOException, SQLException {
  StringBuffer command=null;
  try {
    LineNumberReader lineReader=new LineNumberReader(reader);
    String line=null;
    while ((line=lineReader.readLine()) != null) {
      if (command == null) {
        command=new StringBuffer();
      }
      String trimmedLine=line.trim();
      if (trimmedLine.startsWith("String_Node_Str")) {
        println(trimmedLine);
      }
 else       if (trimmedLine.length() < 1 || trimmedLine.startsWith("String_Node_Str")) {
      }
 else       if (trimmedLine.length() < 1 || trimmedLine.startsWith("String_Node_Str")) {
      }
 else       if (!fullLineDelimiter && trimmedLine.endsWith(getDelimiter()) || fullLineDelimiter && trimmedLine.equals(getDelimiter())) {
        command.append(line.substring(0,line.lastIndexOf(getDelimiter())));
        command.append("String_Node_Str");
        Statement statement=conn.createStatement();
        println(command);
        boolean hasResults=false;
        if (stopOnError) {
          hasResults=statement.execute(command.toString());
        }
 else {
          try {
            statement.execute(command.toString());
          }
 catch (          SQLException e) {
            e.fillInStackTrace();
            printlnError("String_Node_Str" + command);
            printlnError(e);
          }
        }
        if (autoCommit && !conn.getAutoCommit()) {
          conn.commit();
        }
        ResultSet rs=statement.getResultSet();
        if (hasResults && rs != null) {
          ResultSetMetaData md=rs.getMetaData();
          int cols=md.getColumnCount();
          for (int i=0; i < cols; i++) {
            String name=md.getColumnLabel(i);
            print(name + "String_Node_Str");
          }
          println("String_Node_Str");
          while (rs.next()) {
            for (int i=0; i < cols; i++) {
              String value=rs.getString(i);
              print(value + "String_Node_Str");
            }
            println("String_Node_Str");
          }
        }
        command=null;
        try {
          statement.close();
        }
 catch (        Exception e) {
        }
        Thread.yield();
      }
 else {
        command.append(line);
        command.append("String_Node_Str");
      }
    }
    if (!autoCommit) {
      conn.commit();
    }
  }
 catch (  SQLException e) {
    e.fillInStackTrace();
    printlnError("String_Node_Str" + command);
    printlnError(e);
    throw e;
  }
catch (  IOException e) {
    e.fillInStackTrace();
    printlnError("String_Node_Str" + command);
    printlnError(e);
    throw e;
  }
 finally {
    conn.rollback();
    flush();
  }
}

Fixed version (ground truth):
/** 
 * Runs an SQL script (read in using the Reader parameter) using the connection passed in
 * @param conn - the connection to use for the script
 * @param reader - the source of the script
 * @throws SQLException if any SQL errors occur
 * @throws IOException if there is an error reading from the Reader
 */
private void runScript(Connection conn,Reader reader) throws IOException, SQLException {
  StringBuffer command=null;
  try {
    LineNumberReader lineReader=new LineNumberReader(reader);
    String line=null;
    while ((line=lineReader.readLine()) != null) {
      if (command == null) {
        command=new StringBuffer();
      }
      String trimmedLine=line.trim();
      if (trimmedLine.startsWith("String_Node_Str")) {
      }
 else       if (trimmedLine.length() < 1 || trimmedLine.startsWith("String_Node_Str")) {
      }
 else       if (trimmedLine.length() < 1 || trimmedLine.startsWith("String_Node_Str")) {
      }
 else       if (!fullLineDelimiter && trimmedLine.endsWith(getDelimiter()) || fullLineDelimiter && trimmedLine.equals(getDelimiter())) {
        command.append(line.substring(0,line.lastIndexOf(getDelimiter())));
        command.append("String_Node_Str");
        Statement statement=conn.createStatement();
        boolean hasResults=false;
        if (stopOnError) {
          hasResults=statement.execute(command.toString());
        }
 else {
          try {
            statement.execute(command.toString());
          }
 catch (          SQLException e) {
            e.fillInStackTrace();
            printlnError("String_Node_Str" + command);
            printlnError(e);
          }
        }
        if (autoCommit && !conn.getAutoCommit()) {
          conn.commit();
        }
        ResultSet rs=statement.getResultSet();
        if (hasResults && rs != null) {
          ResultSetMetaData md=rs.getMetaData();
          int cols=md.getColumnCount();
          for (int i=0; i < cols; i++) {
            String name=md.getColumnLabel(i);
            print(name + "String_Node_Str");
          }
          println("String_Node_Str");
          while (rs.next()) {
            for (int i=0; i < cols; i++) {
              String value=rs.getString(i);
              print(value + "String_Node_Str");
            }
            println("String_Node_Str");
          }
        }
        command=null;
        try {
          statement.close();
        }
 catch (        Exception e) {
        }
        Thread.yield();
      }
 else {
        command.append(line);
        command.append("String_Node_Str");
      }
    }
    if (!autoCommit) {
      conn.commit();
    }
  }
 catch (  SQLException e) {
    e.fillInStackTrace();
    printlnError("String_Node_Str" + command);
    printlnError(e);
    throw e;
  }
catch (  IOException e) {
    e.fillInStackTrace();
    printlnError("String_Node_Str" + command);
    printlnError(e);
    throw e;
  }
 finally {
    conn.rollback();
    flush();
  }
}