Program: 89593
Project: 89593
Buggy source:
/** 
 * Creates an instance in persistent storage of the given job. If the job doesn't have an ID, one is generated for it.
 * @param job a given job to add to persistent storage
 * @throws PermissionDenied If a job already exists in persistent storagewith the same id as the given job
 * @throws IOFailure        If some IOException occurs whilewriting the job to persistent storage
 */
public synchronized void create(Job job){
  ArgumentNotValid.checkNotNull(job,"String_Node_Str");
  Long harvestId=job.getOrigHarvestDefinitionID();
  if (!HarvestDefinitionDAO.getInstance().exists(harvestId)) {
    throw new UnknownID("String_Node_Str" + harvestId);
  }
  Connection connection=HarvestDBConnection.get();
  if (job.getJobID() != null) {
    log.warn("String_Node_Str" + "String_Node_Str");
  }
 else {
    job.setJobID(generateNextID(connection));
  }
  log.debug("String_Node_Str" + job.toString());
  PreparedStatement statement=null;
  try {
    connection.setAutoCommit(false);
    statement=connection.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    statement.setLong(1,job.getJobID());
    statement.setLong(2,job.getOrigHarvestDefinitionID());
    statement.setInt(3,job.getStatus().ordinal());
    statement.setInt(4,job.getPriority().ordinal());
    statement.setLong(5,job.getForceMaxObjectsPerDomain());
    statement.setLong(6,job.getMaxBytesPerDomain());
    statement.setLong(7,job.getMaxJobRunningTime());
    DBUtils.setStringMaxLength(statement,8,job.getOrderXMLName(),Constants.MAX_NAME_SIZE,job,"String_Node_Str");
    final String orderreader=job.getOrderXMLdoc().asXML();
    DBUtils.setClobMaxLength(statement,9,orderreader,Constants.MAX_ORDERXML_SIZE,job,"String_Node_Str");
    DBUtils.setClobMaxLength(statement,10,job.getSeedListAsString(),Constants.MAX_COMBINED_SEED_LIST_SIZE,job,"String_Node_Str");
    statement.setInt(11,job.getHarvestNum());
    DBUtils.setDateMaybeNull(statement,12,job.getActualStart());
    DBUtils.setDateMaybeNull(statement,13,job.getActualStop());
    DBUtils.setDateMaybeNull(statement,14,job.getSubmittedDate());
    DBUtils.setDateMaybeNull(statement,15,job.getCreationDate());
    statement.setInt(16,job.getDomainConfigurationMap().size());
    long initialEdition=1;
    statement.setLong(17,initialEdition);
    DBUtils.setLongMaybeNull(statement,18,job.getResubmittedAsJob());
    statement.executeUpdate();
    createJobConfigsEntries(connection,job);
    connection.commit();
    job.setEdition(initialEdition);
  }
 catch (  SQLException e) {
    String message="String_Node_Str" + job + "String_Node_Str"+ "String_Node_Str"+ ExceptionUtils.getSQLExceptionCause(e);
    log.warn(message,e);
    throw new IOFailure(message,e);
  }
 finally {
    DBUtils.rollbackIfNeeded(connection,"String_Node_Str",job);
    HarvestDBConnection.release(connection);
  }
}

Fixed version (ground truth):
/** 
 * Creates an instance in persistent storage of the given job. If the job doesn't have an ID, one is generated for it.
 * @param job a given job to add to persistent storage
 * @throws PermissionDenied If a job already exists in persistent storagewith the same id as the given job
 * @throws IOFailure        If some IOException occurs whilewriting the job to persistent storage
 */
public synchronized void create(Job job){
  ArgumentNotValid.checkNotNull(job,"String_Node_Str");
  Long harvestId=job.getOrigHarvestDefinitionID();
  if (!HarvestDefinitionDAO.getInstance().exists(harvestId)) {
    throw new UnknownID("String_Node_Str" + harvestId);
  }
  Connection connection=HarvestDBConnection.get();
  if (job.getJobID() != null) {
    log.warn("String_Node_Str" + "String_Node_Str");
  }
 else {
    job.setJobID(generateNextID(connection));
  }
  if (job.getCreationDate() != null) {
    log.warn("String_Node_Str" + "String_Node_Str");
  }
 else {
    job.setCreationDate(new Date());
  }
  log.debug("String_Node_Str" + job.toString());
  PreparedStatement statement=null;
  try {
    connection.setAutoCommit(false);
    statement=connection.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    statement.setLong(1,job.getJobID());
    statement.setLong(2,job.getOrigHarvestDefinitionID());
    statement.setInt(3,job.getStatus().ordinal());
    statement.setInt(4,job.getPriority().ordinal());
    statement.setLong(5,job.getForceMaxObjectsPerDomain());
    statement.setLong(6,job.getMaxBytesPerDomain());
    statement.setLong(7,job.getMaxJobRunningTime());
    DBUtils.setStringMaxLength(statement,8,job.getOrderXMLName(),Constants.MAX_NAME_SIZE,job,"String_Node_Str");
    final String orderreader=job.getOrderXMLdoc().asXML();
    DBUtils.setClobMaxLength(statement,9,orderreader,Constants.MAX_ORDERXML_SIZE,job,"String_Node_Str");
    DBUtils.setClobMaxLength(statement,10,job.getSeedListAsString(),Constants.MAX_COMBINED_SEED_LIST_SIZE,job,"String_Node_Str");
    statement.setInt(11,job.getHarvestNum());
    DBUtils.setDateMaybeNull(statement,12,job.getActualStart());
    DBUtils.setDateMaybeNull(statement,13,job.getActualStop());
    DBUtils.setDateMaybeNull(statement,14,job.getSubmittedDate());
    DBUtils.setDateMaybeNull(statement,15,job.getCreationDate());
    statement.setInt(16,job.getDomainConfigurationMap().size());
    long initialEdition=1;
    statement.setLong(17,initialEdition);
    DBUtils.setLongMaybeNull(statement,18,job.getResubmittedAsJob());
    statement.executeUpdate();
    createJobConfigsEntries(connection,job);
    connection.commit();
    job.setEdition(initialEdition);
  }
 catch (  SQLException e) {
    String message="String_Node_Str" + job + "String_Node_Str"+ "String_Node_Str"+ ExceptionUtils.getSQLExceptionCause(e);
    log.warn(message,e);
    throw new IOFailure(message,e);
  }
 finally {
    DBUtils.rollbackIfNeeded(connection,"String_Node_Str",job);
    HarvestDBConnection.release(connection);
  }
}