nus-yam/ex-repair huggingface dataset:
Program: 24665
Project: 24665
Buggy source:
/** 
 * Copy project
 */
@Override @AllowedRoles(roles={Roles.Administrator}) public GwtProject copyProject(GwtProject originalProject) throws SquareException {
  System.out.println("String_Node_Str");
  Project project=new Project(originalProject);
  project.setId(0);
  project.setName(project.getName() + "String_Node_Str");
  User aoe=userDao.fetch(originalProject.getAcquisitionOrganizationEngineer().getUserId());
  project.setAcquisitionOrganizationEngineer(aoe);
  Date now=new Date();
  project.setDateCreated(now);
  project.setDateModified(now);
  System.out.println("String_Node_Str");
  projectDao.create(project);
  System.out.println("String_Node_Str");
  userDao.addUserToProject(aoe,project,roleDao.findByName(ProjectRole.Acquisition_Organization_Engineer.getLabel()));
  Project original=new Project(originalProject);
  System.out.println("String_Node_Str");
  copyTerms(project,original);
  HashMap<Integer,Integer> goalMap=copyGoals(project,original);
  HashMap<Integer,Integer> assetMap=copyAssets(project,original);
  copyGoalAsset(original,goalMap,assetMap);
  HashMap<Integer,Integer> requirementMap=copyRequirements(project,original);
  copyRequirementGoal(original,requirementMap,goalMap);
  copySteps(project);
  System.out.println("String_Node_Str");
  return project.createGwtProject();
}

Fixed version (ground truth):
/** 
 * Copy project
 */
@Override @AllowedRoles(roles={Roles.Administrator}) public GwtProject copyProject(GwtProject originalProject) throws SquareException {
  System.out.println("String_Node_Str");
  Project project=new Project(originalProject);
  project.setId(0);
  project.setName(project.getName() + "String_Node_Str");
  User aoe=userDao.fetch(originalProject.getAcquisitionOrganizationEngineer().getUserId());
  project.setAcquisitionOrganizationEngineer(aoe);
  Date now=new Date();
  project.setDateCreated(now);
  project.setDateModified(now);
  System.out.println("String_Node_Str");
  projectDao.create(project);
  System.out.println("String_Node_Str");
  userDao.addUserToProject(aoe,project,roleDao.findByName(ProjectRole.Acquisition_Organization_Engineer.getLabel()));
  Project original=new Project(originalProject);
  System.out.println("String_Node_Str");
  copyTerms(project,original);
  HashMap<Integer,Integer> goalMap=copyGoals(project,original);
  HashMap<Integer,Integer> assetMap=copyAssets(project,original);
  copyGoalAsset(original,goalMap,assetMap);
  HashMap<Integer,Integer> requirementMap=copyRequirements(project,original);
  copyRequirementGoal(original,requirementMap,goalMap);
  copySteps(project);
  System.out.println("String_Node_Str");
  copyPackageAttributeRating(project,original);
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  return project.createGwtProject();
}
Program: 24666
Project: 24666
Buggy source:
public HashMap<Integer,Integer> copyPackageAttributeRating(Project project,Project originalProject){
  HashMap<Integer,Integer> map=new HashMap<Integer,Integer>();
  List<ProjectPackageAttributeRating> PPAR=projectPackageAttributeRatingDao.getAllRatingsForProjectNoGwt(originalProject);
  for (  ProjectPackageAttributeRating ppar : PPAR) {
    System.out.println("String_Node_Str" + ppar.getId());
    System.out.println("String_Node_Str" + ppar.getProject());
    System.out.println("String_Node_Str" + ppar.getProject().getId());
    System.out.println("String_Node_Str" + ppar.getSoftwarePackage());
    System.out.println("String_Node_Str" + ppar.getQualityAttribute());
    System.out.println("String_Node_Str" + ppar.getRating());
  }
  System.out.println("String_Node_Str");
  for (  ProjectPackageAttributeRating ppar : PPAR) {
    Date now=new Date();
    ProjectPackageAttributeRating newPpar=new ProjectPackageAttributeRating(ppar.getId(),ppar.getSoftwarePackage(),project,ppar.getQualityAttribute(),ppar.getRating());
    System.out.println("String_Node_Str");
    newPpar.setProject(ppar.getProject());
    projectPackageAttributeRatingDao.create(newPpar);
    System.out.println("String_Node_Str");
    map.put(ppar.getProject().getId(),newPpar.getProject().getId());
    System.out.println("String_Node_Str");
  }
  return map;
}

Fixed version (ground truth):
public HashMap<Integer,Integer> copyPackageAttributeRating(Project project,Project originalProject){
  System.out.println("String_Node_Str");
  HashMap<Integer,Integer> map=new HashMap<Integer,Integer>();
  List<ProjectPackageAttributeRating> PPAR=projectPackageAttributeRatingDao.getAllRatingsForProjectNoGwt(originalProject);
  for (  ProjectPackageAttributeRating ppar : PPAR) {
    System.out.println("String_Node_Str" + ppar.getId().getProjectId());
    System.out.println("String_Node_Str" + ppar.getSoftwarePackage());
    System.out.println("String_Node_Str" + ppar.getQualityAttribute());
    System.out.println("String_Node_Str" + ppar.getRating());
  }
  System.out.println("String_Node_Str");
  for (  ProjectPackageAttributeRating ppar : PPAR) {
    Date now=new Date();
    ProjectPackageAttributeRating newPpar=new ProjectPackageAttributeRating(project.getId(),ppar.getId().getPackageId(),ppar.getId().getAttributeId(),ppar.getRating(),ppar.getSoftwarePackage(),ppar.getQualityAttribute());
    projectPackageAttributeRatingDao.create(newPpar);
  }
  return map;
}
Program: 24667
Project: 24667
Buggy source:
/** 
 * Copy project
 */
@Override @AllowedRoles(roles={Roles.Administrator}) public GwtProject copyProject(GwtProject originalProject) throws SquareException {
  System.out.println("String_Node_Str");
  Project project=new Project(originalProject);
  project.setId(0);
  project.setName(project.getName() + "String_Node_Str");
  User aoe=userDao.fetch(originalProject.getAcquisitionOrganizationEngineer().getUserId());
  project.setAcquisitionOrganizationEngineer(aoe);
  Date now=new Date();
  project.setDateCreated(now);
  project.setDateModified(now);
  System.out.println("String_Node_Str");
  projectDao.create(project);
  System.out.println("String_Node_Str");
  userDao.addUserToProject(aoe,project,roleDao.findByName(ProjectRole.Acquisition_Organization_Engineer.getLabel()));
  Project original=new Project(originalProject);
  System.out.println("String_Node_Str");
  copyTerms(project,original);
  HashMap<Integer,Integer> goalMap=copyGoals(project,original);
  HashMap<Integer,Integer> assetMap=copyAssets(project,original);
  copyGoalAsset(original,goalMap,assetMap);
  HashMap<Integer,Integer> requirementMap=copyRequirements(project,original);
  copyRequirementGoal(original,requirementMap,goalMap);
  copySteps(project);
  System.out.println("String_Node_Str");
  copyPackageAttributeRating(project,original);
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  return project.createGwtProject();
}

Fixed version (ground truth):
/** 
 * Copy project
 */
@Override @AllowedRoles(roles={Roles.Administrator}) public GwtProject copyProject(GwtProject originalProject) throws SquareException {
  System.out.println("String_Node_Str");
  Project project=new Project(originalProject);
  project.setId(0);
  project.setName(project.getName() + "String_Node_Str");
  User aoe=userDao.fetch(originalProject.getAcquisitionOrganizationEngineer().getUserId());
  project.setAcquisitionOrganizationEngineer(aoe);
  Date now=new Date();
  project.setDateCreated(now);
  project.setDateModified(now);
  System.out.println("String_Node_Str");
  projectDao.create(project);
  System.out.println("String_Node_Str");
  userDao.addUserToProject(aoe,project,roleDao.findByName(ProjectRole.Acquisition_Organization_Engineer.getLabel()));
  Project original=new Project(originalProject);
  System.out.println("String_Node_Str");
  copyTerms(project,original);
  HashMap<Integer,Integer> goalMap=copyGoals(project,original);
  HashMap<Integer,Integer> assetMap=copyAssets(project,original);
  copyGoalAsset(original,goalMap,assetMap);
  HashMap<Integer,Integer> requirementMap=copyRequirements(project,original);
  copyRequirementGoal(original,requirementMap,goalMap);
  copySteps(project);
  if (originalProject.getCases().getId() == 3) {
    System.out.println("String_Node_Str" + originalProject.getCases().getId());
    System.out.println("String_Node_Str");
    copyPackageAttributeRating(project,original);
    copyTradeoffReason(project,original);
    copyRationale(project,original);
    System.out.println("String_Node_Str");
  }
  System.out.println("String_Node_Str");
  return project.createGwtProject();
}
Program: 24668
Project: 24668
Buggy source:
@Override public void onChange(ChangeEvent event){
  final String status=statusList.getItemText(statusList.getSelectedIndex());
  if (step.getStatus() != StepStatus.NotStarted && StepStatus.convertLabel(status) == StepStatus.NotStarted) {
    Window.alert(messages.cannotChangeToNotStarted());
    if (step.getStatus() == StepStatus.InProgress)     statusList.setSelectedIndex(1);
    if (step.getStatus() == StepStatus.Complete)     statusList.setSelectedIndex(2);
    return;
  }
  if (step.getStatus() == StepStatus.Complete && StepStatus.convertLabel(status) == StepStatus.InProgress) {
    int stepNo=Integer.valueOf(step.getDescription().charAt(5));
    for (int i=0; i < listOfSteps.size(); i++) {
      int stepNumber=Integer.valueOf(listOfSteps.get(i).getStep().getDescription().charAt(5));
      if (stepNumber < stepNo) {
        updateStepStatus(projectId,listOfSteps.get(i).getStep().getId(),"String_Node_Str");
      }
    }
  }
  updateStepStatus(projectId,step.getId(),status);
  step.setStatus(StepStatus.convertLabel(status));
}

Fixed version (ground truth):
@Override public void onChange(ChangeEvent event){
  final String status=statusList.getItemText(statusList.getSelectedIndex());
  if (step.getStatus() != StepStatus.NotStarted && StepStatus.convertLabel(status) == StepStatus.NotStarted) {
    Window.alert(messages.cannotChangeToNotStarted());
    if (step.getStatus() == StepStatus.InProgress)     statusList.setSelectedIndex(1);
    if (step.getStatus() == StepStatus.Complete)     statusList.setSelectedIndex(2);
    return;
  }
  if (step.getStatus() == StepStatus.Complete && StepStatus.convertLabel(status) == StepStatus.InProgress) {
    int stepNo=Integer.valueOf(step.getDescription().charAt(5));
    for (int i=0; i < listOfSteps.size(); i++) {
      int stepNumber=Integer.valueOf(listOfSteps.get(i).getStep().getDescription().charAt(5));
      if (stepNumber < stepNo) {
        updateStepStatus(projectId,listOfSteps.get(i).getStep().getId(),"String_Node_Str");
      }
    }
  }
  if (step.getStatus() == StepStatus.NotStarted && (StepStatus.convertLabel(status) == StepStatus.InProgress || StepStatus.convertLabel(status) == StepStatus.Complete)) {
    analysisResults.clear();
    analysisResults.add(new Hyperlink(step.getDescription(),StepRouter.CreateStepLink(step)));
  }
  updateStepStatus(projectId,step.getId(),status);
  step.setStatus(StepStatus.convertLabel(status));
}
Program: 24670
Project: 24670
Buggy source:
public void copyRationale(Project project,Project originalProject){
  System.out.println("String_Node_Str");
  ProjectPackageRationale PPR=rationalDao.getRationale(originalProject);
  System.out.println("String_Node_Str" + PPR.getId().getProjectId());
  System.out.println("String_Node_Str" + PPR.getId().getPackageId());
  System.out.println("String_Node_Str" + PPR.getRationale());
  System.out.println("String_Node_Str");
  ProjectPackageRationale newPpr=new ProjectPackageRationale(project.getId(),PPR.getId().getPackageId(),PPR.getSoftwarePackage(),PPR.getRationale());
  rationalDao.create(newPpr);
}

Fixed version (ground truth):
public void copyRationale(Project project,Project originalProject){
  System.out.println("String_Node_Str");
  ProjectPackageRationale PPR=rationalDao.getRationale(originalProject);
  System.out.println("String_Node_Str");
  if (PPR != null) {
    System.out.println("String_Node_Str" + PPR.getId().getProjectId());
    System.out.println("String_Node_Str" + PPR.getId().getPackageId());
    System.out.println("String_Node_Str" + PPR.getRationale());
    System.out.println("String_Node_Str");
    ProjectPackageRationale newPpr=new ProjectPackageRationale(project.getId(),PPR.getId().getPackageId(),PPR.getSoftwarePackage(),PPR.getRationale());
    rationalDao.create(newPpr);
  }
}
Program: 24671
Project: 24671
Buggy source:
public HashMap<Integer,Integer> copyPackageRequirementRating(Project project,Project originalProject){
  System.out.println("String_Node_Str");
  HashMap<Integer,Integer> map=new HashMap<Integer,Integer>();
  List<ProjectPackageRequirementRating> PPRR=projectPackageRequirementRatingDao.getAllRatingsNoGwt(originalProject);
  for (  ProjectPackageRequirementRating pprr : PPRR) {
    System.out.println("String_Node_Str" + pprr.getId().getProjectId());
    System.out.println("String_Node_Str" + pprr.getSoftwarePackage());
    System.out.println("String_Node_Str" + pprr.getRequirement());
    System.out.println("String_Node_Str" + pprr.getRating());
  }
  System.out.println("String_Node_Str");
  for (  ProjectPackageRequirementRating pprr : PPRR) {
    System.out.println("String_Node_Str" + pprr.getRating());
    ProjectPackageRequirementRating newPprr=new ProjectPackageRequirementRating(project.getId(),pprr.getId().getPackageId(),pprr.getId().getRequirementId(),pprr.getRating(),pprr.getSoftwarePackage(),pprr.getRequirement());
    projectPackageRequirementRatingDao.create(newPprr);
  }
  return map;
}

Fixed version (ground truth):
public HashMap<Integer,Integer> copyPackageRequirementRating(Project project,Project originalProject){
  System.out.println("String_Node_Str");
  HashMap<Integer,Integer> map=new HashMap<Integer,Integer>();
  List<ProjectPackageRequirementRating> PPRR=projectPackageRequirementRatingDao.getAllRatingsNoGwt(originalProject);
  for (  ProjectPackageRequirementRating pprr : PPRR) {
    System.out.println("String_Node_Str" + pprr.getId().getProjectId());
    System.out.println("String_Node_Str" + searchNewRequirementId(project,originalProject,pprr.getId().getRequirementId()));
    System.out.println("String_Node_Str" + pprr.getSoftwarePackage());
    System.out.println("String_Node_Str" + pprr.getRequirement());
    System.out.println("String_Node_Str" + pprr.getRating());
  }
  System.out.println(project.getRequirements().toString());
  System.out.println(project.getRequirements());
  System.out.println("String_Node_Str" + project.getRequirements().toArray());
  for (int i=0; i < project.getRequirements().size(); i++) {
    System.out.println("String_Node_Str" + project.getRequirements().toString().indexOf(i));
    System.out.println("String_Node_Str" + originalProject.getRequirements().toString().indexOf(i));
  }
  System.out.println("String_Node_Str");
  for (  ProjectPackageRequirementRating pprr : PPRR) {
    ProjectPackageRequirementRating newPprr=new ProjectPackageRequirementRating(project.getId(),pprr.getId().getPackageId(),searchNewRequirementId(project,originalProject,pprr.getId().getRequirementId()),pprr.getRating(),pprr.getSoftwarePackage(),pprr.getRequirement());
    projectPackageRequirementRatingDao.create(newPprr);
  }
  return map;
}
Program: 24672
Project: 24672
Buggy source:
@Override public List<ProjectPackageAttributeRating> getAllRatingsForProjectNoGwt(Project project){
  System.out.println("String_Node_Str");
  List<ProjectPackageAttributeRating> lines=null;
  String query="String_Node_Str";
  Query q=getSession().createQuery(query);
  q.setParameter("String_Node_Str",project.getId());
  System.out.println(project.getId());
  lines=(List<ProjectPackageAttributeRating>)q.list();
  System.out.println(lines);
  List<ProjectPackageAttributeRating> result=new ArrayList<ProjectPackageAttributeRating>();
  ProjectPackageAttributeRating current=null;
  QualityAttribute qa;
  SoftwarePackage sp;
  for (int i=0; i < lines.size(); ++i) {
    current=new ProjectPackageAttributeRating();
    current.setIdInt(project.getId(),lines.get(i).getSoftwarePackage().getId(),lines.get(i).getQualityAttribute().getId());
    qa=new QualityAttribute();
    qa.setDescription(lines.get(i).getQualityAttribute().getDescription());
    qa.setName(lines.get(i).getQualityAttribute().getName());
    qa.setId(lines.get(i).getQualityAttribute().getId());
    sp=new SoftwarePackage();
    sp.setDescription(lines.get(i).getSoftwarePackage().getDescription());
    sp.setName(lines.get(i).getSoftwarePackage().getName());
    sp.setId(lines.get(i).getSoftwarePackage().getId());
    current.setQualityAttribute(qa);
    current.setSoftwarePackage(sp);
    current.setRating(lines.get(i).getRating());
    result.add(current);
  }
  return result;
}

Fixed version (ground truth):
@Override public List<ProjectPackageAttributeRating> getAllRatingsForProjectNoGwt(Project project){
  List<ProjectPackageAttributeRating> lines=null;
  String query="String_Node_Str";
  Query q=getSession().createQuery(query);
  q.setParameter("String_Node_Str",project.getId());
  lines=(List<ProjectPackageAttributeRating>)q.list();
  List<ProjectPackageAttributeRating> result=new ArrayList<ProjectPackageAttributeRating>();
  ProjectPackageAttributeRating current=null;
  QualityAttribute qa;
  SoftwarePackage sp;
  for (int i=0; i < lines.size(); ++i) {
    current=new ProjectPackageAttributeRating();
    current.setIdInt(project.getId(),lines.get(i).getSoftwarePackage().getId(),lines.get(i).getQualityAttribute().getId());
    qa=new QualityAttribute();
    qa.setDescription(lines.get(i).getQualityAttribute().getDescription());
    qa.setName(lines.get(i).getQualityAttribute().getName());
    qa.setId(lines.get(i).getQualityAttribute().getId());
    sp=new SoftwarePackage();
    sp.setDescription(lines.get(i).getSoftwarePackage().getDescription());
    sp.setName(lines.get(i).getSoftwarePackage().getName());
    sp.setId(lines.get(i).getSoftwarePackage().getId());
    current.setQualityAttribute(qa);
    current.setSoftwarePackage(sp);
    current.setRating(lines.get(i).getRating());
    result.add(current);
  }
  return result;
}
Program: 24673
Project: 24673
Buggy source:
/** 
 * This sends an email to the user 
 * @param updateUser
 * @throws MessagingException
 * @throws SquareException
 */
protected void sendMail(User updateUser,SimpleMailMessage templateMessage,String velocityTemplate) throws SquareException {
  try {
    Map<String,Object> model=new Hashtable<String,Object>();
    model.put("String_Node_Str",updateUser);
    String text=VelocityEngineUtils.mergeTemplateIntoString(velocityEngine,velocityTemplate,model);
    if (updateUser.getEmail() == null || !(updateUser.getEmail().matches(EMAIL_VALIDATOR))) {
      SquareException se=new SquareException("String_Node_Str");
      se.setType(ExceptionType.invalidEmail);
      throw se;
    }
    templateMessage.setTo(updateUser.getEmail());
    templateMessage.setText(text);
    mailSender.send(templateMessage);
  }
 catch (  SquareException se) {
    throw se;
  }
catch (  Throwable m) {
    SquareException se=new SquareException("String_Node_Str",m);
    se.setType(ExceptionType.mailError);
    throw se;
  }
}

Fixed version (ground truth):
/** 
 * This sends an email to the user 
 * @param updateUser
 * @throws MessagingException
 * @throws SquareException
 */
protected void sendMail(User updateUser,SimpleMailMessage templateMessage,String velocityTemplate) throws SquareException {
  try {
    Map<String,Object> model=new Hashtable<String,Object>();
    model.put("String_Node_Str",updateUser);
    String text=VelocityEngineUtils.mergeTemplateIntoString(velocityEngine,velocityTemplate,model);
    System.out.println("String_Node_Str");
    if (updateUser.getEmail() == null || !(updateUser.getEmail().matches(EMAIL_VALIDATOR))) {
      SquareException se=new SquareException("String_Node_Str");
      se.setType(ExceptionType.invalidEmail);
      throw se;
    }
    System.out.println("String_Node_Str");
    templateMessage.setTo(updateUser.getEmail());
    templateMessage.setText(text);
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
  }
 catch (  SquareException se) {
    throw se;
  }
catch (  Throwable m) {
    System.out.println(m.getLocalizedMessage());
    SquareException se=new SquareException("String_Node_Str",m);
    se.setType(ExceptionType.mailError);
    throw se;
  }
}
Program: 24674
Project: 24674
Buggy source:
@AllowedRoles(roles={Roles.Administrator}) public GwtUser createUser(GwtUser userToCreate,String password,boolean emailPassword) throws SquareException {
  if (userToCreate == null) {
    throw new SquareException("String_Node_Str");
  }
  try {
    User user=null;
    System.out.println("String_Node_Str");
    if (password.trim().length() != 0) {
      user=new User(userToCreate,password.trim());
    }
 else {
      throw new SquareException("String_Node_Str");
    }
    System.out.println("String_Node_Str");
    userDao.create(user);
    System.out.println("String_Node_Str");
    if (emailPassword) {
      sendMail(user,userCreatedMessage,"String_Node_Str");
    }
    System.out.println("String_Node_Str");
    return user.createGwtUser();
  }
 catch (  Throwable t) {
    throw new SquareException("String_Node_Str",t);
  }
}

Fixed version (ground truth):
@AllowedRoles(roles={Roles.Administrator}) public GwtUser createUser(GwtUser userToCreate,String password,boolean emailPassword) throws SquareException {
  if (userToCreate == null) {
    throw new SquareException("String_Node_Str");
  }
  try {
    User user=null;
    System.out.println("String_Node_Str");
    if (password.trim().length() != 0) {
      user=new User(userToCreate,password.trim());
    }
 else {
      throw new SquareException("String_Node_Str");
    }
    System.out.println("String_Node_Str");
    userDao.create(user);
    System.out.println("String_Node_Str");
    if (emailPassword) {
      sendMail(user,userCreatedMessage,"String_Node_Str");
    }
    System.out.println("String_Node_Str");
    return user.createGwtUser();
  }
 catch (  Throwable t) {
    System.out.println();
    throw new SquareException("String_Node_Str",t);
  }
}
Program: 24675
Project: 24675
Buggy source:
@Override public void onChange(ChangeEvent event){
  final String status=statusList.getItemText(statusList.getSelectedIndex());
  if (step.getStatus() != StepStatus.NotStarted && StepStatus.convertLabel(status) == StepStatus.NotStarted) {
    Window.alert(messages.cannotChangeToNotStarted());
    if (step.getStatus() == StepStatus.InProgress)     statusList.setSelectedIndex(1);
    if (step.getStatus() == StepStatus.Complete)     statusList.setSelectedIndex(2);
    return;
  }
  if (step.getStatus() == StepStatus.Complete && StepStatus.convertLabel(status) == StepStatus.InProgress) {
    int stepNo=Integer.valueOf(step.getDescription().charAt(5));
    for (int i=0; i < listOfSteps.size(); i++) {
      int stepNumber=Integer.valueOf(listOfSteps.get(i).getStep().getDescription().charAt(5));
      if (stepNumber < stepNo) {
        updateStepStatus(projectId,listOfSteps.get(i).getStep().getId(),"String_Node_Str");
      }
    }
  }
  updateStepStatus(projectId,step.getId(),status);
  step.setStatus(StepStatus.convertLabel(status));
}

Fixed version (ground truth):
@Override public void onChange(ChangeEvent event){
  final String status=statusList.getItemText(statusList.getSelectedIndex());
  if (step.getStatus() != StepStatus.NotStarted && StepStatus.convertLabel(status) == StepStatus.NotStarted) {
    Window.alert(messages.cannotChangeToNotStarted());
    if (step.getStatus() == StepStatus.InProgress)     statusList.setSelectedIndex(1);
    if (step.getStatus() == StepStatus.Complete)     statusList.setSelectedIndex(2);
    return;
  }
  if (step.getStatus() == StepStatus.Complete && StepStatus.convertLabel(status) == StepStatus.InProgress) {
    int stepNo=Integer.valueOf(step.getDescription().charAt(5));
    for (int i=0; i < listOfSteps.size(); i++) {
      int stepNumber=Integer.valueOf(listOfSteps.get(i).getStep().getDescription().charAt(5));
      if (stepNumber < stepNo) {
        updateStepStatus(projectId,listOfSteps.get(i).getStep().getId(),"String_Node_Str");
      }
    }
  }
  if (step.getStatus() == StepStatus.NotStarted && (StepStatus.convertLabel(status) == StepStatus.InProgress || StepStatus.convertLabel(status) == StepStatus.Complete)) {
    analysisResults.clear();
    analysisResults.add(new Hyperlink(step.getDescription(),StepRouter.CreateStepLink(step)));
  }
  updateStepStatus(projectId,step.getId(),status);
  step.setStatus(StepStatus.convertLabel(status));
}
Program: 24678
Project: 24678
Buggy source:
public void removeRequirement(int requirementId){
  boolean response=Window.confirm(messages.confirmDelete());
  if (response) {
    this.requirementService.deleteRequirement(requirementId,currentState.getProjectID(),new AsyncCallback<Void>(){
      public void onFailure(      Throwable caught){
        ExceptionHelper.SquareRootRPCExceptionHandler(caught,messages.errorRemovingRequirements());
      }
      public void onSuccess(      Void result){
        History.newItem(ReviewOfRequirementsByAcquisitionPilot.generateNavigationId(ReviewOfRequirementsByAcquisitionPilot.PageId.home));
      }
    }
);
  }
}

Fixed version (ground truth):
public void removeRequirement(int requirementId){
  boolean response=Window.confirm(messages.confirmDelete());
  if (response) {
    this.requirementService.deleteRequirement(requirementId,currentState.getProjectID(),new AsyncCallback<Void>(){
      public void onFailure(      Throwable caught){
        ExceptionHelper.SquareRootRPCExceptionHandler(caught,messages.errorRemovingRequirements());
      }
      public void onSuccess(      Void result){
        History.newItem(ReviewOfRequirementsByAcquisitionPilot.generateNavigationId(ReviewOfRequirementsByAcquisitionPilot.PageId.start));
      }
    }
);
  }
}
Program: 24679
Project: 24679
Buggy source:
public void changeStatusToApproveRequirement(final GwtRequirement gwtRequirement){
  this.showStatusBar("String_Node_Str");
  ReviewOfRequirementsByAcquisitionServiceAsync service1=GWT.create(ReviewOfRequirementsByAcquisitionService.class);
  ServiceDefTarget endpoint=(ServiceDefTarget)service1;
  endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "String_Node_Str");
  GwtProject project=new GwtProject();
  project.setId(this.getCurrentState().getProjectID());
  System.out.println("String_Node_Str" + gwtRequirement);
  service1.changeStatusToApproveRequirement(currentState.getProjectID(),gwtRequirement,new AsyncCallback<Void>(){
    public void onFailure(    Throwable caught){
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
    @Override public void onSuccess(    Void result){
      System.out.println("String_Node_Str");
      History.newItem(ReviewOfRequirementsByAcquisitionPilot.generateNavigationId(ReviewOfRequirementsByAcquisitionPilot.PageId.home));
    }
  }
);
}

Fixed version (ground truth):
public void changeStatusToApproveRequirement(final GwtRequirement gwtRequirement){
  this.showStatusBar("String_Node_Str");
  ReviewOfRequirementsByAcquisitionServiceAsync service1=GWT.create(ReviewOfRequirementsByAcquisitionService.class);
  ServiceDefTarget endpoint=(ServiceDefTarget)service1;
  endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "String_Node_Str");
  GwtProject project=new GwtProject();
  project.setId(this.getCurrentState().getProjectID());
  System.out.println("String_Node_Str" + gwtRequirement);
  service1.changeStatusToApproveRequirement(currentState.getProjectID(),gwtRequirement,new AsyncCallback<Void>(){
    public void onFailure(    Throwable caught){
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
    @Override public void onSuccess(    Void result){
      System.out.println("String_Node_Str");
      History.newItem(ReviewOfRequirementsByAcquisitionPilot.generateNavigationId(ReviewOfRequirementsByAcquisitionPilot.PageId.start));
    }
  }
);
}
Program: 24680
Project: 24680
Buggy source:
public void changeStatusToRequestRevisionRequirement(final GwtRequirement gwtRequirement){
  this.showStatusBar("String_Node_Str");
  ReviewOfRequirementsByAcquisitionServiceAsync service1=GWT.create(ReviewOfRequirementsByAcquisitionService.class);
  ServiceDefTarget endpoint=(ServiceDefTarget)service1;
  endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "String_Node_Str");
  GwtProject project=new GwtProject();
  project.setId(this.getCurrentState().getProjectID());
  service1.changeStatusToRequestRevisionRequirement(currentState.getProjectID(),gwtRequirement,new AsyncCallback<Void>(){
    public void onFailure(    Throwable caught){
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
    @Override public void onSuccess(    Void result){
      System.out.println("String_Node_Str");
      History.newItem(ReviewOfRequirementsByAcquisitionPilot.generateNavigationId(ReviewOfRequirementsByAcquisitionPilot.PageId.home));
    }
  }
);
}

Fixed version (ground truth):
public void changeStatusToRequestRevisionRequirement(final GwtRequirement gwtRequirement){
  this.showStatusBar("String_Node_Str");
  ReviewOfRequirementsByAcquisitionServiceAsync service1=GWT.create(ReviewOfRequirementsByAcquisitionService.class);
  ServiceDefTarget endpoint=(ServiceDefTarget)service1;
  endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "String_Node_Str");
  GwtProject project=new GwtProject();
  project.setId(this.getCurrentState().getProjectID());
  service1.changeStatusToRequestRevisionRequirement(currentState.getProjectID(),gwtRequirement,new AsyncCallback<Void>(){
    public void onFailure(    Throwable caught){
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
    @Override public void onSuccess(    Void result){
      System.out.println("String_Node_Str");
      History.newItem(ReviewOfRequirementsByAcquisitionPilot.generateNavigationId(ReviewOfRequirementsByAcquisitionPilot.PageId.start));
    }
  }
);
}
Program: 24682
Project: 24682
Buggy source:
public void PaneInitialization(){
  this.hideStatusBar();
  this.contetHasChanged=false;
  this.save=new Button(messages.save());
  this.cancel=new Button(messages.cancel());
  this.save.setWidth("String_Node_Str");
  this.cancel.setWidth("String_Node_Str");
  this.getContent().clear();
  getContent().add(loadRiskNavigator());
  this.disPanel=new DisclosurePanel();
  this.disPanel.setAnimationEnabled(true);
  errorMessage=new Label(messages.labelFieldsRequired());
  errorMessage.setStyleName("String_Node_Str");
  this.disPanel.add(errorMessage);
  this.getContent().add(disPanel);
  this.matrix=new FlexTable();
  this.requirementTitleTextBox.addChangeHandler(new contentChanged());
  this.requirementDescriptionTextBox.addChangeHandler(new contentChanged());
  this.getContent().add(this.matrix);
  loadRequirementForm();
  this.save.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      saveRequirement(currentRequirementId);
    }
  }
);
  cancel.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      if (CommandTypes.insert == currentCommand) {
        History.newItem(ReviewOfRequirementsByAcquisitionPilot.generateNavigationId(ReviewOfRequirementsByAcquisitionPilot.PageId.home));
      }
 else {
        currentCommand=CommandTypes.read;
        PaneInitialization();
      }
    }
  }
);
}

Fixed version (ground truth):
public void PaneInitialization(){
  this.hideStatusBar();
  this.contetHasChanged=false;
  this.save=new Button(messages.save());
  this.cancel=new Button(messages.cancel());
  this.save.setWidth("String_Node_Str");
  this.cancel.setWidth("String_Node_Str");
  this.getContent().clear();
  getContent().add(loadRiskNavigator());
  this.disPanel=new DisclosurePanel();
  this.disPanel.setAnimationEnabled(true);
  errorMessage=new Label(messages.labelFieldsRequired());
  errorMessage.setStyleName("String_Node_Str");
  this.disPanel.add(errorMessage);
  this.getContent().add(disPanel);
  this.matrix=new FlexTable();
  this.requirementTitleTextBox.addChangeHandler(new contentChanged());
  this.requirementDescriptionTextBox.addChangeHandler(new contentChanged());
  this.getContent().add(this.matrix);
  loadRequirementForm();
  this.save.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      saveRequirement(currentRequirementId);
    }
  }
);
  cancel.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      if (CommandTypes.insert == currentCommand) {
        History.newItem(ReviewOfRequirementsByAcquisitionPilot.generateNavigationId(ReviewOfRequirementsByAcquisitionPilot.PageId.start));
      }
 else {
        currentCommand=CommandTypes.read;
        PaneInitialization();
      }
    }
  }
);
}
Program: 24683
Project: 24683
Buggy source:
@Override public void onSuccess(Void result){
  System.out.println("String_Node_Str");
  History.newItem(ReviewOfRequirementsByAcquisitionPilot.generateNavigationId(ReviewOfRequirementsByAcquisitionPilot.PageId.home));
}

Fixed version (ground truth):
@Override public void onSuccess(Void result){
  System.out.println("String_Node_Str");
  History.newItem(ReviewOfRequirementsByAcquisitionPilot.generateNavigationId(ReviewOfRequirementsByAcquisitionPilot.PageId.start));
}
Program: 24686
Project: 24686
Buggy source:
@Override public void execute(){
  if (copyConfirmDialog != null && copyConfirmDialog.isConfirmed()) {
    System.out.println("String_Node_Str");
    caller.showStatusBar(messages.copying());
    copyProject(listOfProjects.get(lastRowClicked - 1));
    copyConfirmDialog.setConfirmed(false);
  }
 else   if (confirmDialog != null && confirmDialog.isConfirmed()) {
    System.out.println("String_Node_Str");
    caller.showStatusBar(messages.removing());
    deleteProject(lastProjectIdClicked);
    confirmDialog.setConfirmed(false);
  }
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
@Override public void execute(){
  if (copyConfirmDialog != null && copyConfirmDialog.isConfirmed()) {
    caller.showStatusBar(messages.copying());
    copyProject(listOfProjects.get(lastRowClicked - 1));
    copyConfirmDialog.setConfirmed(false);
  }
 else   if (confirmDialog != null && confirmDialog.isConfirmed()) {
    caller.showStatusBar(messages.removing());
    deleteProject(lastProjectIdClicked);
    confirmDialog.setConfirmed(false);
  }
}
Program: 24687
Project: 24687
Buggy source:
private void initializeDialog(String dialogMessage){
  super.setModal(true);
  super.setAnimationEnabled(true);
  this.warningImage.setSize("String_Node_Str","String_Node_Str");
  this.descriptionLayout.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
  this.descriptionLayout.add(new HTML(dialogMessage));
  this.descriptionLayout.add(warningImage);
  this.descriptionLayout.setWidth("String_Node_Str");
  this.descriptionLayout.setSpacing(15);
  this.confirmButton.setWidth("String_Node_Str");
  this.cancelButton.setWidth("String_Node_Str");
  this.buttonLayout.setWidget(0,0,confirmButton);
  this.buttonLayout.setWidget(0,1,cancelButton);
  this.buttonLayout.setWidth("String_Node_Str");
  this.buttonLayout.getCellFormatter().setHorizontalAlignment(0,0,HasHorizontalAlignment.ALIGN_LEFT);
  this.buttonLayout.getCellFormatter().setHorizontalAlignment(0,1,HasHorizontalAlignment.ALIGN_RIGHT);
  this.confirmButton.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      confirmed=true;
      System.out.println("String_Node_Str");
      caller.execute();
      hide();
    }
  }
);
  this.cancelButton.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      confirmed=false;
      hide();
    }
  }
);
  this.layout.setSpacing(6);
  this.layout.add(descriptionLayout);
  this.layout.add(buttonLayout);
  this.setWidget(layout);
}

Fixed version (ground truth):
private void initializeDialog(String dialogMessage){
  super.setModal(true);
  super.setAnimationEnabled(true);
  this.warningImage.setSize("String_Node_Str","String_Node_Str");
  this.descriptionLayout.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
  this.descriptionLayout.add(new HTML(dialogMessage));
  this.descriptionLayout.add(warningImage);
  this.descriptionLayout.setWidth("String_Node_Str");
  this.descriptionLayout.setSpacing(15);
  this.confirmButton.setWidth("String_Node_Str");
  this.cancelButton.setWidth("String_Node_Str");
  this.buttonLayout.setWidget(0,0,confirmButton);
  this.buttonLayout.setWidget(0,1,cancelButton);
  this.buttonLayout.setWidth("String_Node_Str");
  this.buttonLayout.getCellFormatter().setHorizontalAlignment(0,0,HasHorizontalAlignment.ALIGN_LEFT);
  this.buttonLayout.getCellFormatter().setHorizontalAlignment(0,1,HasHorizontalAlignment.ALIGN_RIGHT);
  this.confirmButton.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      confirmed=true;
      caller.execute();
      hide();
    }
  }
);
  this.cancelButton.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      confirmed=false;
      hide();
    }
  }
);
  this.layout.setSpacing(6);
  this.layout.add(descriptionLayout);
  this.layout.add(buttonLayout);
  this.setWidget(layout);
}
Program: 24689
Project: 24689
Buggy source:
public HashMap<Integer,Integer> copyRequirements(Project project,Project originalProject){
  HashMap<Integer,Integer> map=new HashMap<Integer,Integer>();
  Project oldProject=projectDao.fetch(originalProject.getId());
  Set<Requirement> requirements=oldProject.getRequirements();
  for (  Requirement r : requirements) {
    Requirement requirement=new Requirement();
    requirement.setDescription(r.getDescription());
    requirement.setPriority(r.getPriority());
    requirement.setTitle(r.getTitle());
    Date now=new Date();
    requirement.setDateCreated(now);
    requirement.setDateModified(now);
    requirement.setProject(project);
    requirementDao.create(requirement);
    map.put(r.getId(),requirement.getId());
  }
  return map;
}

Fixed version (ground truth):
public HashMap<Integer,Integer> copyRequirements(Project project,Project originalProject){
  HashMap<Integer,Integer> map=new HashMap<Integer,Integer>();
  Project oldProject=projectDao.fetch(originalProject.getId());
  Set<Requirement> requirements=oldProject.getRequirements();
  for (  Requirement r : requirements) {
    Requirement requirement=new Requirement();
    requirement.setDescription(r.getDescription());
    requirement.setPriority(r.getPriority());
    requirement.setStatus(r.getStatus());
    requirement.setTitle(r.getTitle());
    Date now=new Date();
    requirement.setDateCreated(now);
    requirement.setDateModified(now);
    requirement.setProject(project);
    requirementDao.create(requirement);
    map.put(r.getId(),requirement.getId());
  }
  return map;
}
Program: 24690
Project: 24690
Buggy source:
@AllowedRoles(roles=Roles.Lead_Requirements_Engineer) public void mergeCategories(Integer categoryFromId,Integer categoryToId) throws SquareException {
  try {
    List<Requirement> requirements=requirementDao.findByCategoryId(categoryFromId);
    Category categoryFrom=new Category(categoryFromId);
    Category categoryTo=new Category(categoryToId);
    for (    Requirement requirement : requirements) {
      Set<Category> requirementCategories=requirement.getCategories();
      requirementCategories.remove(categoryFrom);
      requirementCategories.add(categoryTo);
    }
    categoryDao.deleteById(categoryFromId);
  }
 catch (  Throwable t) {
    throw new SquareException("String_Node_Str",t);
  }
}

Fixed version (ground truth):
@AllowedRoles(roles=Roles.Lead_Requirements_Engineer) public void mergeCategories(Integer categoryFromId,Integer categoryToId) throws SquareException {
  try {
    List<Requirement> requirements=requirementDao.findByCategoryId(categoryFromId);
    Category categoryFrom=new Category(categoryFromId);
    Category categoryTo=new Category(categoryToId);
    for (    Requirement requirement : requirements) {
    }
    categoryDao.deleteById(categoryFromId);
  }
 catch (  Throwable t) {
    throw new SquareException("String_Node_Str",t);
  }
}
Program: 24691
Project: 24691
Buggy source:
@AllowedRoles(roles={Roles.All}) public void addCategoryToRequirements(List<GwtRequirement> requirements,GwtCategory category) throws SquareException {
  try {
    Category cat=new Category(category);
    for (    GwtRequirement r : requirements) {
      Requirement req=requirementDao.fetch(r.getId());
      req.getCategories().add(cat);
    }
  }
 catch (  Throwable t) {
    throw new SquareException("String_Node_Str",t);
  }
}

Fixed version (ground truth):
@AllowedRoles(roles={Roles.All}) public void addCategoryToRequirements(List<GwtRequirement> requirements,GwtCategory category) throws SquareException {
  try {
    Category cat=new Category(category);
    for (    GwtRequirement r : requirements) {
      Requirement req=requirementDao.fetch(r.getId());
    }
  }
 catch (  Throwable t) {
    throw new SquareException("String_Node_Str",t);
  }
}
Program: 24692
Project: 24692
Buggy source:
@Override public GwtStepVerficationResult verifyStep(Project project) throws SquareException {
  GwtStepVerficationResult result=new GwtStepVerficationResult();
  Set<Category> categories=new HashSet<Category>();
  Set<Requirement> requirements=project.getRequirements();
  int count=0;
  for (  Requirement r : requirements) {
    if (r.getCategories().size() == 0) {
      count++;
    }
  }
  if (categories.size() == 0) {
    result.getMessages().add("String_Node_Str");
    result.setHasWarning(true);
  }
  if (count > 0) {
    result.getMessages().add("String_Node_Str" + count + "String_Node_Str");
    result.setHasWarning(true);
  }
  return result;
}

Fixed version (ground truth):
@Override public GwtStepVerficationResult verifyStep(Project project) throws SquareException {
  GwtStepVerficationResult result=new GwtStepVerficationResult();
  Set<Category> categories=new HashSet<Category>();
  Set<Requirement> requirements=project.getRequirements();
  int count=0;
  for (  Requirement r : requirements) {
  }
  if (categories.size() == 0) {
    result.getMessages().add("String_Node_Str");
    result.setHasWarning(true);
  }
  if (count > 0) {
    result.getMessages().add("String_Node_Str" + count + "String_Node_Str");
    result.setHasWarning(true);
  }
  return result;
}
Program: 24693
Project: 24693
Buggy source:
@AllowedRoles(roles={Roles.All}) public void removeCategoryFromRequirements(List<GwtRequirement> requirements,GwtCategory category) throws SquareException {
  try {
    Category cat=new Category(category);
    for (    GwtRequirement r : requirements) {
      Requirement req=requirementDao.fetch(r.getId());
      req.getCategories().remove(cat);
    }
  }
 catch (  Throwable t) {
    throw new SquareException("String_Node_Str",t);
  }
}

Fixed version (ground truth):
@AllowedRoles(roles={Roles.All}) public void removeCategoryFromRequirements(List<GwtRequirement> requirements,GwtCategory category) throws SquareException {
  try {
    Category cat=new Category(category);
    for (    GwtRequirement r : requirements) {
      Requirement req=requirementDao.fetch(r.getId());
    }
  }
 catch (  Throwable t) {
    throw new SquareException("String_Node_Str",t);
  }
}
Program: 24694
Project: 24694
Buggy source:
@Override public void onChange(ChangeEvent event){
  final String status=statusList.getItemText(statusList.getSelectedIndex());
  if (step.getStatus() != StepStatus.NotStarted && StepStatus.convertLabel(status) == StepStatus.NotStarted) {
    Window.alert(messages.cannotChangeToNotStarted());
    if (step.getStatus() == StepStatus.InProgress)     statusList.setSelectedIndex(1);
    if (step.getStatus() == StepStatus.Complete)     statusList.setSelectedIndex(2);
    return;
  }
  if (step.getStatus() == StepStatus.Complete && StepStatus.convertLabel(status) == StepStatus.InProgress) {
    int stepNo=Integer.valueOf(step.getDescription().charAt(5));
    System.out.println("String_Node_Str" + stepNo);
    for (int i=0; i < listOfSteps.size(); i++) {
      int stepNumber=Integer.valueOf(listOfSteps.get(i).getStep().getDescription().charAt(5));
      if (stepNumber < stepNo) {
        updateStepStatus(projectId,listOfSteps.get(i).getStep().getId(),"String_Node_Str");
      }
    }
  }
  updateStepStatus(projectId,step.getId(),status);
  step.setStatus(StepStatus.convertLabel(status));
}

Fixed version (ground truth):
@Override public void onChange(ChangeEvent event){
  final String status=statusList.getItemText(statusList.getSelectedIndex());
  if (step.getStatus() != StepStatus.NotStarted && StepStatus.convertLabel(status) == StepStatus.NotStarted) {
    Window.alert(messages.cannotChangeToNotStarted());
    if (step.getStatus() == StepStatus.InProgress)     statusList.setSelectedIndex(1);
    if (step.getStatus() == StepStatus.Complete)     statusList.setSelectedIndex(2);
    return;
  }
  if (step.getStatus() == StepStatus.Complete && StepStatus.convertLabel(status) == StepStatus.InProgress) {
    int stepNo=Integer.valueOf(step.getDescription().charAt(5));
    for (int i=0; i < listOfSteps.size(); i++) {
      int stepNumber=Integer.valueOf(listOfSteps.get(i).getStep().getDescription().charAt(5));
      if (stepNumber < stepNo) {
        updateStepStatus(projectId,listOfSteps.get(i).getStep().getId(),"String_Node_Str");
      }
    }
  }
  updateStepStatus(projectId,step.getId(),status);
  step.setStatus(StepStatus.convertLabel(status));
}
Program: 24696
Project: 24696
Buggy source:
/** 
 * Retrieve the steps from the database.  Steps are going to be returned in numeric order with 
 * @return
 */
public static String CreateStepLink(GwtStep step){
  String stepDescription=step.getDescription();
  for (  StepEnum se : StepEnum.values()) {
    if (se.getDescription().equals(stepDescription)) {
      return se.getLink();
    }
  }
  return ChooseCasePilot.generateNavigationId(ChooseCasePilot.PageId.FourOhFour);
}

Fixed version (ground truth):
/** 
 * Retrieve the steps from the database.  Steps are going to be returned in numeric order with 
 * @return
 */
public static String CreateStepLink(GwtStep step){
  String stepDescription=step.getDescription();
  for (  StepEnum se : StepEnum.values()) {
    if (se.getDescription().equals(stepDescription)) {
      System.out.println("String_Node_Str" + se.getDescription() + "String_Node_Str"+ se.getLink());
      return se.getLink();
    }
  }
  return ChooseCasePilot.generateNavigationId(ChooseCasePilot.PageId.FourOhFour);
}