Program: 109960
Project: 109960
Buggy source:
/** 
 * Posts a survey on Mechanical Turk using the current settings in MturkLibrary. Note that randomization is not performed here and so must be called before calling postSurvey. This also allows the user to not use randomization if she wishes.
 * @param survey
 * @return
 * @throws SurveyException
 * @throws ServiceException
 * @throws IOException
 */
public static List<HIT> postSurvey(Survey survey,Map<String,Integer> orderSeen) throws SurveyException, ServiceException, IOException {
  List<HIT> hits=new ArrayList<HIT>();
  QualificationType qualificationType;
  if (ResponseManager.manager.containsKey(survey))   qualificationType=ResponseManager.manager.get(survey).qualificationType;
 else {
    qualificationType=service.createQualificationType(survey.sourceName + survey.sid + MturkLibrary.TIME,MturkLibrary.props.getProperty("String_Node_Str"),"String_Node_Str");
    qualificationType.setAutoGranted(true);
    qualificationType.setIsRequestable(false);
  }
  for (int i=numToBatch; i > 0; i--) {
    long lifetime=Long.parseLong(MturkLibrary.props.getProperty("String_Node_Str"));
    String hitid=ResponseManager.createHIT(MturkLibrary.props.getProperty("String_Node_Str"),MturkLibrary.props.getProperty("String_Node_Str"),MturkLibrary.props.getProperty("String_Node_Str"),XML.getXMLString(survey),Double.parseDouble(MturkLibrary.props.getProperty("String_Node_Str")),Long.parseLong(MturkLibrary.props.getProperty("String_Node_Str")),maxAutoApproveDelay,lifetime,qualificationType);
    HIT hit=ResponseManager.getHIT(hitid);
    System.out.println(SurveyPoster.makeHITURL(hit));
synchronized (ResponseManager.manager) {
      if (!ResponseManager.manager.containsKey(survey))       ResponseManager.manager.put(survey,new Record(survey,(Properties)MturkLibrary.props.clone()));
      Record record=ResponseManager.manager.get(survey);
      record.addNewHIT(hit);
      ResponseManager.manager.notifyAll();
    }
    hits.add(hit);
  }
  return hits;
}

Fixed version (ground truth):
/** 
 * Posts a survey on Mechanical Turk using the current settings in MturkLibrary. Note that randomization is not performed here and so must be called before calling postSurvey. This also allows the user to not use randomization if she wishes.
 * @param survey
 * @return
 * @throws SurveyException
 * @throws ServiceException
 * @throws IOException
 */
public static List<HIT> postSurvey(Survey survey,Map<String,Integer> orderSeen) throws SurveyException, ServiceException, IOException, ParseException {
  List<HIT> hits=new ArrayList<HIT>();
  QualificationType qualificationType;
  if (ResponseManager.manager.containsKey(survey))   qualificationType=ResponseManager.manager.get(survey).qualificationType;
 else {
    qualificationType=service.createQualificationType(survey.sourceName + survey.sid + MturkLibrary.TIME,MturkLibrary.props.getProperty("String_Node_Str"),"String_Node_Str");
    qualificationType.setAutoGranted(true);
    qualificationType.setIsRequestable(false);
  }
  for (int i=numToBatch; i > 0; i--) {
    long lifetime=Long.parseLong(MturkLibrary.props.getProperty("String_Node_Str"));
    String hitid=ResponseManager.createHIT(MturkLibrary.props.getProperty("String_Node_Str"),MturkLibrary.props.getProperty("String_Node_Str"),MturkLibrary.props.getProperty("String_Node_Str"),XML.getXMLString(survey),Double.parseDouble(MturkLibrary.props.getProperty("String_Node_Str")),Long.parseLong(MturkLibrary.props.getProperty("String_Node_Str")),maxAutoApproveDelay,lifetime,qualificationType);
    HIT hit=ResponseManager.getHIT(hitid);
    System.out.println(SurveyPoster.makeHITURL(hit));
synchronized (ResponseManager.manager) {
      if (!ResponseManager.manager.containsKey(survey))       ResponseManager.manager.put(survey,new Record(survey,(Properties)MturkLibrary.props.clone()));
      Record record=ResponseManager.manager.get(survey);
      record.addNewHIT(hit);
      ResponseManager.manager.notifyAll();
    }
    hits.add(hit);
  }
  return hits;
}