Program: 90004
Project: 90004
Buggy source:
/** 
 * Get statusInfo.
 * @See {@link 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) ? Constants.ASCENDING_SORT_ORDER : Constants.DESCENDING_SORT_ORDER;
  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" + 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" + 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 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) ? Constants.ASCENDING_SORT_ORDER : Constants.DESCENDING_SORT_ORDER;
  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" + 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" + 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);
  }
}