Program: 89719
Project: 89719
Buggy source:
/** 
 * Get statusInfo.
 * @see JobDAO#getStatusInfo(long,long,boolean,Set)
 */
public List<JobStatusInfo> getStatusInfo(long harvestId,long harvestNum,boolean asc,Set<JobStatus> selectedStatusSet){
  ArgumentNotValid.checkNotNegative(harvestId,"String_Node_Str");
  ArgumentNotValid.checkNotNegative(harvestNum,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(selectedStatusSet,"String_Node_Str");
  String ascdescString=(asc) ? HarvestStatusQuery.SORT_ORDER.ASC.name() : HarvestStatusQuery.SORT_ORDER.DESC.name();
  StringBuffer statusSortBuffer=new StringBuffer();
  boolean selectAllJobStates=(selectedStatusSet.size() == JobStatus.values().length);
  if (!selectAllJobStates) {
    if (selectedStatusSet.size() == 1) {
      int theWantedStatus=selectedStatusSet.iterator().next().ordinal();
      statusSortBuffer.append("String_Node_Str").append(theWantedStatus);
    }
 else {
      Iterator<JobStatus> it=selectedStatusSet.iterator();
      int nextInt=it.next().ordinal();
      StringBuffer res=new StringBuffer("String_Node_Str" + nextInt);
      while (it.hasNext()) {
        nextInt=it.next().ordinal();
        res.append("String_Node_Str").append(nextInt);
      }
      res.append("String_Node_Str");
      statusSortBuffer.append(res);
    }
  }
  Connection dbconnection=DBConnect.getDBConnection();
  PreparedStatement statement=null;
  try {
    statement=dbconnection.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + harvestId + "String_Node_Str"+ harvestNum+ statusSortBuffer.toString()+ "String_Node_Str"+ ascdescString);
    ResultSet res=statement.executeQuery();
    return makeJobStatusInfoListFromResultset(res);
  }
 catch (  SQLException e) {
    String message="String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e);
    log.warn(message,e);
    throw new IOFailure(message,e);
  }
 finally {
    DBUtils.closeStatementIfOpen(statement);
  }
}

Fixed version (ground truth):
/** 
 * Get a list of small and immediately usable status information for given job status and in given job id order.
 * @param query the user query
 * @throws IOFailure on trouble getting data from database
 */
@Override public HarvestStatus getStatusInfo(HarvestStatusQuery query){
  log.debug("String_Node_Str");
  PreparedStatement s=null;
  long totalRowsCount=0;
  try {
    s=buildSqlQuery(query,true).getPopulatedStatement();
    ResultSet res=s.executeQuery();
    res.next();
    totalRowsCount=res.getLong(1);
  }
 catch (  SQLException e) {
    String message="String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e);
    log.warn(message,e);
    throw new IOFailure(message,e);
  }
 finally {
    DBUtils.closeStatementIfOpen(s);
  }
  List<JobStatusInfo> jobs=null;
  try {
    s=buildSqlQuery(query,false).getPopulatedStatement();
    ResultSet res=s.executeQuery();
    jobs=makeJobStatusInfoListFromResultset(res);
  }
 catch (  SQLException e) {
    String message="String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e);
    log.warn(message,e);
    throw new IOFailure(message,e);
  }
 finally {
    DBUtils.closeStatementIfOpen(s);
  }
  log.debug("String_Node_Str");
  return new HarvestStatus(totalRowsCount,jobs);
}