Program: 49240
Project: 49240
Buggy source:
/** 
 * Migrates content data.
 */
@SuppressWarnings("String_Node_Str") protected void migrateContentData(String orgid) throws DatabaseException, SQLException {
  this.logger.info("String_Node_Str");
  List<Object[]> contentRows=new LinkedList<Object[]>();
  Set<String> uuidCache=new HashSet<String>();
  ResultSet contentInfo=this.executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",orgid);
  while (contentInfo.next()) {
    String contentId=contentInfo.getString(1);
    String contentUuid=this.migratedContent.get(contentId);
    if (contentUuid == null) {
      this.logger.info("String_Node_Str",contentId);
      contentUuid=this.generateUUID();
      contentRows.add(new Object[]{contentUuid,contentInfo.getObject(1),contentInfo.getObject(2),contentInfo.getObject(3),contentInfo.getObject(4),contentInfo.getObject(5),contentInfo.getObject(6),contentInfo.getObject(7),contentInfo.getObject(8),contentInfo.getObject(9),contentInfo.getObject(10),contentInfo.getObject(11),contentInfo.getObject(12),contentInfo.getObject(13),0});
      this.migratedContent.put(contentId,contentUuid);
    }
    uuidCache.add(contentUuid);
  }
  contentInfo.close();
  if (contentRows.size() > 0) {
    PreparedStatement statement=this.generateBulkInsertStatement("String_Node_Str",contentRows.size(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    int index=0;
    for (    Object[] row : contentRows) {
      for (      Object col : row) {
        this.setParameter(statement,++index,col);
      }
    }
    int count=statement.executeUpdate();
    if (count != contentRows.size()) {
      String errmsg=String.format("String_Node_Str",contentRows.size(),count);
      this.logger.error(errmsg);
      throw new DatabaseException(errmsg);
    }
    this.logger.info("String_Node_Str",count);
    statement.close();
  }
  if (uuidCache.size() > 0) {
    PreparedStatement statement=this.generateBulkInsertStatement("String_Node_Str",uuidCache.size(),"String_Node_Str","String_Node_Str");
    int index=0;
    for (    String cid : uuidCache) {
      this.setParameter(statement,++index,orgid);
      this.setParameter(statement,++index,cid);
    }
    int count=statement.executeUpdate();
    if (count != uuidCache.size()) {
      String errmsg=String.format("String_Node_Str",orgid,uuidCache.size(),count);
      this.logger.error(errmsg);
      throw new DatabaseException(errmsg);
    }
    this.logger.info("String_Node_Str",count);
    statement.close();
  }
}

Fixed version (ground truth):
/** 
 * Migrates content data.
 */
@SuppressWarnings("String_Node_Str") protected void migrateContentData(String orgid) throws DatabaseException, SQLException {
  this.logger.info("String_Node_Str");
  List<Object[]> contentRows=new LinkedList<Object[]>();
  Set<String> uuidCache=new HashSet<String>();
  ResultSet contentInfo=this.executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",orgid);
  int maxrows=MAX_PARAMETERS_PER_STATEMENT / 15;
  while (contentInfo.next()) {
    String contentId=contentInfo.getString(1);
    String contentUuid=this.migratedContent.get(contentId);
    if (contentUuid == null) {
      this.logger.info("String_Node_Str",contentId);
      contentUuid=this.generateUUID();
      contentRows.add(new Object[]{contentUuid,contentInfo.getObject(1),contentInfo.getObject(2),contentInfo.getObject(3),contentInfo.getObject(4),contentInfo.getObject(5),contentInfo.getObject(6),contentInfo.getObject(7),contentInfo.getObject(8),contentInfo.getObject(9),contentInfo.getObject(10),contentInfo.getObject(11),contentInfo.getObject(12),contentInfo.getObject(13),0});
      if (contentRows.size() > maxrows) {
        this.bulkInsertContentData(contentRows);
        contentRows.clear();
      }
      this.migratedContent.put(contentId,contentUuid);
    }
    uuidCache.add(contentUuid);
  }
  contentInfo.close();
  this.bulkInsertContentData(contentRows);
  contentRows.clear();
  if (uuidCache.size() > 0) {
    maxrows=MAX_PARAMETERS_PER_STATEMENT / 2;
    int lastBlock=0;
    int blockSize=maxrows / 2;
    Iterator<String> uuidIterator=uuidCache.iterator();
    PreparedStatement statement=null;
    for (int offset=0; offset < uuidCache.size(); offset+=blockSize) {
      int remaining=Math.min(uuidCache.size() - offset,blockSize);
      if (remaining != lastBlock) {
        if (statement != null) {
          statement.close();
        }
        statement=this.generateBulkInsertStatement("String_Node_Str",remaining,"String_Node_Str","String_Node_Str");
        lastBlock=remaining;
      }
      int index=0;
      while (remaining-- > 0) {
        this.setParameter(statement,++index,orgid);
        this.setParameter(statement,++index,uuidIterator.next());
      }
      int count=statement.executeUpdate();
      if (count != uuidCache.size()) {
        String errmsg=String.format("String_Node_Str",orgid,uuidCache.size(),count);
        this.logger.error(errmsg);
        throw new DatabaseException(errmsg);
      }
    }
    this.logger.info("String_Node_Str",uuidCache.size());
    statement.close();
  }
}