nus-yam/ex-repair huggingface dataset:
Program: 24825
Project: 24825
Buggy source:
public void determineAccessRights(String page,State currentState){
  if (currentState.getUserProjectRole() == ProjectRole.Acquisition_Organization_Engineer) {
    currentState.setMode(GwtModesType.NoAccess);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.Contractor) {
    currentState.setMode(GwtModesType.NoAccess);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.Security_Specialist) {
    currentState.setMode(GwtModesType.ReadWrite);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.COTS_Vendor) {
    currentState.setMode(GwtModesType.ReadOnly);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.None) {
    currentState.setMode(GwtModesType.NoAccess);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.Administrator) {
    currentState.setMode(GwtModesType.ReadWrite);
  }
 else {
    currentState.setMode(GwtModesType.ReadOnly);
  }
}

Fixed version (ground truth):
public void determineAccessRights(String page,State currentState){
  if (currentState.isSiteAdministrator() == true) {
    currentState.setMode(GwtModesType.ReadWrite);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.Acquisition_Organization_Engineer) {
    currentState.setMode(GwtModesType.NoAccess);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.Contractor) {
    currentState.setMode(GwtModesType.NoAccess);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.Security_Specialist) {
    currentState.setMode(GwtModesType.ReadWrite);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.COTS_Vendor) {
    currentState.setMode(GwtModesType.ReadOnly);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.None) {
    currentState.setMode(GwtModesType.NoAccess);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.Administrator) {
    currentState.setMode(GwtModesType.ReadWrite);
  }
 else {
    currentState.setMode(GwtModesType.ReadOnly);
  }
}
Program: 24826
Project: 24826
Buggy source:
public void setBreadCrumb(String viewId,String crumb){
  this.breadCrumbPane.clear();
  Hyperlink chooseCase=new Hyperlink(messages.chooseCase(),ChooseCasePilot.generateNavigationId(ChooseCasePilot.PageId.home));
  HorizontalPanel crumbBar=new HorizontalPanel();
  Label crumbText=new Label(crumb);
  crumbText.setStyleName("String_Node_Str");
  chooseCase.setStyleName("String_Node_Str");
  if (crumb.trim().length() != 0) {
    Hyperlink chooseStep=new Hyperlink(this.currentState.getProjectName(),ChooseStepPilot.generateNavigationId(ChooseStepPilot.PageId.home));
    Hyperlink chooseStepCase3=new Hyperlink(this.currentState.getProjectName(),ChooseStepCase3Pilot.generateNavigationId(ChooseStepCase3Pilot.PageId.home));
    chooseStep.setStyleName("String_Node_Str");
    crumbBar.add(chooseCase);
    Hyperlink chooseProject=new Hyperlink(this.currentState.getCaseName().name(),HomePilot.generateNavigationId(HomePilot.PageId.home));
    chooseProject.setStyleName("String_Node_Str");
    if (this.currentState.getProjectName() != "String_Node_Str") {
      crumbBar.add(new Label("String_Node_Str"));
      crumbBar.add(chooseProject);
      crumbBar.add(new Label("String_Node_Str"));
      if (this.currentState.getCaseID() == 1)       crumbBar.add(chooseStep);
      if (this.currentState.getCaseID() == 3)       crumbBar.add(chooseStepCase3);
    }
    crumbBar.add(new Label("String_Node_Str"));
    crumbBar.add(crumbText);
    crumbBar.setSpacing(4);
  }
  this.breadCrumbPane.add(crumbBar);
}

Fixed version (ground truth):
public void setBreadCrumb(String viewId,String crumb){
  this.breadCrumbPane.clear();
  Hyperlink chooseCase=new Hyperlink(messages.chooseCase(),ChooseCasePilot.generateNavigationId(ChooseCasePilot.PageId.home));
  HorizontalPanel crumbBar=new HorizontalPanel();
  Label crumbText=new Label(crumb);
  crumbText.setStyleName("String_Node_Str");
  chooseCase.setStyleName("String_Node_Str");
  if (crumb.trim().length() != 0) {
    Hyperlink chooseStep=new Hyperlink(this.currentState.getProjectName(),ChooseStepPilot.generateNavigationId(ChooseStepPilot.PageId.home));
    Hyperlink chooseStepCase3=new Hyperlink(this.currentState.getProjectName(),ChooseStepCase3Pilot.generateNavigationId(ChooseStepCase3Pilot.PageId.home));
    chooseStep.setStyleName("String_Node_Str");
    crumbBar.add(chooseCase);
    Hyperlink chooseProject=new Hyperlink(this.currentState.getCaseName(),HomePilot.generateNavigationId(HomePilot.PageId.home));
    chooseProject.setStyleName("String_Node_Str");
    if (this.currentState.getProjectName() != "String_Node_Str") {
      crumbBar.add(new Label("String_Node_Str"));
      crumbBar.add(chooseProject);
      crumbBar.add(new Label("String_Node_Str"));
      if (this.currentState.getCaseID() == 1)       crumbBar.add(chooseStep);
      if (this.currentState.getCaseID() == 3)       crumbBar.add(chooseStepCase3);
    }
    crumbBar.add(new Label("String_Node_Str"));
    crumbBar.add(crumbText);
    crumbBar.setSpacing(4);
  }
  this.breadCrumbPane.add(crumbBar);
}
Program: 24827
Project: 24827
Buggy source:
public void setCaseName(AsquareCase caseName){
  this.caseName=caseName;
  Cookies.setCookie("String_Node_Str",caseName.name());
  if (caseName != null) {
    super.fireEvent("String_Node_Str",caseName);
  }
}

Fixed version (ground truth):
public void setCaseName(String caseName){
  this.caseName=caseName;
  Cookies.setCookie("String_Node_Str",caseName);
  if (caseName.trim().length() > 0) {
    super.fireEvent("String_Node_Str",caseName);
  }
}
Program: 24828
Project: 24828
Buggy source:
public AsquareCase getCaseName(){
  return caseName;
}

Fixed version (ground truth):
public String getCaseName(){
  return caseName;
}
Program: 24829
Project: 24829
Buggy source:
public void clear(){
  setSessionID("String_Node_Str");
  setUserName("String_Node_Str");
  setProjectName("String_Node_Str");
  setCaseName(null);
  setCurrentView("String_Node_Str");
  setAuthenticated(null);
  setSiteAdministrator(false);
  setAccountLocked(false);
  setSkipTeachStep(false);
  setFullName("String_Node_Str");
  setProjectInspectionStatus(null);
  setUserProjectRole(null);
  setMode(GwtModesType.NoAccess);
  topPackageList.clear();
  this.topPackageList=new ArrayList<GwtSoftwarePackage>();
  setCurrentRisk(-1);
  setRiskCommand(0);
  setProjectID(-1);
  setCaseID(-1);
  setAppProperties(null);
}

Fixed version (ground truth):
public void clear(){
  setSessionID("String_Node_Str");
  setUserName("String_Node_Str");
  setProjectName("String_Node_Str");
  setCaseName("String_Node_Str");
  setCurrentView("String_Node_Str");
  setAuthenticated(null);
  setSiteAdministrator(false);
  setAccountLocked(false);
  setSkipTeachStep(false);
  setFullName("String_Node_Str");
  setProjectInspectionStatus(null);
  setUserProjectRole(null);
  setMode(GwtModesType.NoAccess);
  topPackageList.clear();
  this.topPackageList=new ArrayList<GwtSoftwarePackage>();
  setCurrentRisk(-1);
  setRiskCommand(0);
  setProjectID(-1);
  setCaseID(-1);
  setAppProperties(null);
}
Program: 24830
Project: 24830
Buggy source:
public void determineAccessRights(String page,State currentState){
  currentState.setMode(GwtModesType.ReadOnly);
}

Fixed version (ground truth):
public void determineAccessRights(String page,State currentState){
  currentState.setMode(GwtModesType.ReadWrite);
}
Program: 24831
Project: 24831
Buggy source:
/** 
 * This function is temporary here. It should be placed in the chose project step.
 * @param projectID
 * @param userName
 */
public void loadRoles(final GwtProject project,final String userName){
  this.showLoadingStatusBar();
  currentState.setProjectName(project.getName());
  for (  AsquareCase ac : AsquareCase.values()) {
    if (ac.getLabel().equals(project.getClass().getName())) {
      currentState.setCaseName(ac);
    }
  }
  currentState.setProjectInspectionStatus(null);
  if (project.getInspectionStatus() != null) {
    currentState.setProjectInspectionStatus(project.getInspectionStatus().getLabel());
  }
  for (  ProjectRole pr : ProjectRole.values()) {
    if (pr.getLabel().equals(project.getCurrentRole().getName())) {
      currentState.setUserProjectRole(pr);
    }
  }
  System.out.println("String_Node_Str" + project.getCases().getId());
  if (project.getCases().getId() == 1) {
    System.out.println("String_Node_Str");
    History.newItem(ChooseStepPilot.generateNavigationId(ChooseStepPilot.PageId.home));
  }
 else   if (project.getCases().getId() == 3) {
    System.out.println("String_Node_Str");
    History.newItem(ChooseStepCase3Pilot.generateNavigationId(ChooseStepCase3Pilot.PageId.home));
  }
}

Fixed version (ground truth):
/** 
 * This function is temporary here. It should be placed in the chose project step.
 * @param projectID
 * @param userName
 */
public void loadRoles(final GwtProject project,final String userName){
  this.showLoadingStatusBar();
  currentState.setProjectName(project.getName());
  currentState.setCaseName(project.getCases().getName());
  currentState.setProjectInspectionStatus(null);
  if (project.getInspectionStatus() != null) {
    currentState.setProjectInspectionStatus(project.getInspectionStatus().getLabel());
  }
  for (  ProjectRole pr : ProjectRole.values()) {
    if (pr.getLabel().equals(project.getCurrentRole().getName())) {
      currentState.setUserProjectRole(pr);
    }
  }
  System.out.println("String_Node_Str" + project.getCases().getId());
  if (project.getCases().getId() == 1) {
    System.out.println("String_Node_Str");
    History.newItem(ChooseStepPilot.generateNavigationId(ChooseStepPilot.PageId.home));
  }
 else   if (project.getCases().getId() == 3) {
    System.out.println("String_Node_Str");
    History.newItem(ChooseStepCase3Pilot.generateNavigationId(ChooseStepCase3Pilot.PageId.home));
  }
}
Program: 24833
Project: 24833
Buggy source:
/** 
 * This remove a selected elicitation technique from the selected project.
 * @param gwtElicitTechnique The technique that wanted to be removed.
 * @param projectId TODO
 * @throws SquareException
 */
void removeSoftwarePackage(GwtSoftwarePackage gwtSoftwarePackage,Integer projectId) throws SquareException ;

Fixed version (ground truth):
/** 
 * This remove a selected elicitation technique from the selected project.
 * @param gwtElicitTechnique The technique that wanted to be removed.
 * @param projectId TODO
 * @throws SquareException
 */
void removeSoftwarePackage(GwtSoftwarePackage gwtSoftwarePackage,GwtProject project) throws SquareException ;
Program: 24834
Project: 24834
Buggy source:
/** 
 * This remove a selected evaluation criteria from the selected project.
 * @param gwtElicitEvaluation  The evaluation that wanted to be removed.
 * @throws SquareException
 */
void removeQualityAttribute(GwtQualityAttribute gwtQualityAttribute) throws SquareException ;

Fixed version (ground truth):
/** 
 * This remove a selected evaluation criteria from the selected project.
 * @param gwtElicitEvaluation  The evaluation that wanted to be removed.
 * @throws SquareException
 */
void removeQualityAttribute(GwtQualityAttribute gwtQualityAttribute,GwtProject project) throws SquareException ;
Program: 24835
Project: 24835
Buggy source:
/** 
 * This remove a selected elicitation technique from the selected project.
 * @param gwtElicitTechnique The technique that wanted to be removed.
 * @throws SquareException
 */
void removeSoftwarePackage(GwtSoftwarePackage gwtElicitTechnique,Integer projectId,AsyncCallback<Void> callback);

Fixed version (ground truth):
/** 
 * This remove a selected elicitation technique from the selected project.
 * @param gwtElicitTechnique The technique that wanted to be removed.
 * @throws SquareException
 */
void removeSoftwarePackage(GwtSoftwarePackage gwtElicitTechnique,GwtProject project,AsyncCallback<Void> callback);
Program: 24836
Project: 24836
Buggy source:
/** 
 * This remove a selected evaluation criteria from the selected project.
 * @param gwtElicitEvaluation  The evaluation that wanted to be removed.
 * @throws SquareException
 */
void removeQualityAttribute(GwtQualityAttribute gwtElicitEvaluation,AsyncCallback<Void> callback);

Fixed version (ground truth):
/** 
 * This remove a selected evaluation criteria from the selected project.
 * @param gwtElicitEvaluation  The evaluation that wanted to be removed.
 * @throws SquareException
 */
void removeQualityAttribute(GwtQualityAttribute gwtElicitEvaluation,GwtProject project,AsyncCallback<Void> callback);
Program: 24837
Project: 24837
Buggy source:
private void setPackagePriority(final int packageID,final int priority){
  System.out.println("String_Node_Str" + currentProject.getId());
  this.performTradeoffService.setPriority(currentProject.getId(),packageID,priority,new AsyncCallback<Void>(){
    public void onFailure(    Throwable caught){
      if (caught instanceof SquareException) {
        SquareException se=(SquareException)caught;
switch (se.getType()) {
case authorization:
          Window.alert(messages.rateAuthorization());
        break;
default :
      Window.alert(messages.error());
    break;
}
}
 else {
Window.alert(messages.error());
}
}
public void onSuccess(Void result){
}
}
);
}

Fixed version (ground truth):
private void setPackagePriority(final int packageID,final int priority){
  this.performTradeoffService.setPriority(currentProject.getId(),packageID,priority,new AsyncCallback<Void>(){
    public void onFailure(    Throwable caught){
      if (caught instanceof SquareException) {
        SquareException se=(SquareException)caught;
switch (se.getType()) {
case authorization:
          Window.alert(messages.rateAuthorization());
        break;
default :
      Window.alert(messages.error());
    break;
}
}
 else {
Window.alert(messages.error());
}
}
public void onSuccess(Void result){
}
}
);
}
Program: 24838
Project: 24838
Buggy source:
private void setRateValue(final int packageID,final int attributeID,final int value){
  System.out.println("String_Node_Str" + packageID + "String_Node_Str"+ attributeID+ "String_Node_Str"+ value);
  this.service.setRateValue(currentProject.getId(),packageID,attributeID,value,new AsyncCallback<Void>(){
    public void onFailure(    Throwable caught){
      if (caught instanceof SquareException) {
        SquareException se=(SquareException)caught;
switch (se.getType()) {
case authorization:
          Window.alert(messages.rateAuthorization());
        break;
default :
      Window.alert(messages.error());
    break;
}
}
 else {
Window.alert(messages.error());
}
}
public void onSuccess(Void result){
setValueFromlistOfRateValues(packageID,attributeID,value);
}
}
);
}

Fixed version (ground truth):
private void setRateValue(final int packageID,final int attributeID,final int value){
  this.service.setRateValue(currentProject.getId(),packageID,attributeID,value,new AsyncCallback<Void>(){
    public void onFailure(    Throwable caught){
      if (caught instanceof SquareException) {
        SquareException se=(SquareException)caught;
switch (se.getType()) {
case authorization:
          Window.alert(messages.rateAuthorization());
        break;
default :
      Window.alert(messages.error());
    break;
}
}
 else {
Window.alert(messages.error());
}
}
public void onSuccess(Void result){
setValueFromlistOfRateValues(packageID,attributeID,value);
}
}
);
}
Program: 24839
Project: 24839
Buggy source:
private void loadRatings(){
  service.getRateValues(currentProject.getId(),new AsyncCallback<List<GwtRating>>(){
    @Override public void onSuccess(    List<GwtRating> result){
      System.out.println("String_Node_Str" + result.size());
      System.out.println("String_Node_Str" + result.get(0).getPackageId());
      ratings=result;
      drawRateMatrix();
      getTotalsFromMatrix();
      PaneInitialization();
    }
    @Override public void onFailure(    Throwable caught){
      Window.alert(messages.ratingsRetrievalError());
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
private void loadRatings(){
  service.getRateValues(currentProject.getId(),new AsyncCallback<List<GwtRating>>(){
    @Override public void onSuccess(    List<GwtRating> result){
      ratings=result;
      drawRateMatrix();
      getTotalsFromMatrix();
      PaneInitialization();
    }
    @Override public void onFailure(    Throwable caught){
      Window.alert(messages.ratingsRetrievalError());
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
  }
);
}
Program: 24840
Project: 24840
Buggy source:
private void loadTradeoffReasons(){
  performTradeoffService.getTradeoffReasons(currentProject.getId(),new AsyncCallback<List<GwtTradeoffReason>>(){
    @Override public void onSuccess(    List<GwtTradeoffReason> result){
      System.out.println("String_Node_Str" + result.size());
      System.out.println("String_Node_Str" + result.get(0).getTradeoffreason());
      tradeoffReasons=result;
      drawRateMatrix();
      getTotalsFromMatrix();
      PaneInitialization();
    }
    @Override public void onFailure(    Throwable caught){
      Window.alert(messages.ratingsRetrievalError());
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
private void loadTradeoffReasons(){
  performTradeoffService.getTradeoffReasons(currentProject.getId(),new AsyncCallback<List<GwtTradeoffReason>>(){
    @Override public void onSuccess(    List<GwtTradeoffReason> result){
      tradeoffReasons=result;
      drawRateMatrix();
      getTotalsFromMatrix();
      PaneInitialization();
    }
    @Override public void onFailure(    Throwable caught){
      Window.alert(messages.ratingsRetrievalError());
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
  }
);
}
Program: 24841
Project: 24841
Buggy source:
private void loadRequirementRatings(){
  performTradeoffService.getRequirementRateValues(currentProject.getId(),new AsyncCallback<List<GwtRequirementRating>>(){
    @Override public void onSuccess(    List<GwtRequirementRating> result){
      System.out.println("String_Node_Str" + result.size());
      System.out.println("String_Node_Str" + result.get(0).getPackageId());
      requirementRatings=result;
      drawRateMatrix();
      getTotalsFromMatrix();
      PaneInitialization();
    }
    @Override public void onFailure(    Throwable caught){
      Window.alert(messages.ratingsRetrievalError());
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
private void loadRequirementRatings(){
  performTradeoffService.getRequirementRateValues(currentProject.getId(),new AsyncCallback<List<GwtRequirementRating>>(){
    @Override public void onSuccess(    List<GwtRequirementRating> result){
      requirementRatings=result;
      drawRateMatrix();
      getTotalsFromMatrix();
      PaneInitialization();
    }
    @Override public void onFailure(    Throwable caught){
      Window.alert(messages.ratingsRetrievalError());
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
  }
);
}
Program: 24842
Project: 24842
Buggy source:
private void loadPackages(){
  final StepStatus stepStatus=StepStatus.NotStarted;
  service.getSoftwarePackages(currentProject,stepStatus,new AsyncCallback<List<GwtSoftwarePackage>>(){
    @Override public void onSuccess(    List<GwtSoftwarePackage> result){
      softwarePackages=result;
      System.out.println("String_Node_Str" + result.size());
      loadRatings();
      loadRequirementRatings();
    }
    @Override public void onFailure(    Throwable caught){
      Window.alert(messages.packagesRetrievalError());
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
private void loadPackages(){
  final StepStatus stepStatus=StepStatus.NotStarted;
  service.getSoftwarePackages(currentProject,stepStatus,new AsyncCallback<List<GwtSoftwarePackage>>(){
    @Override public void onSuccess(    List<GwtSoftwarePackage> result){
      softwarePackages=result;
      loadRatings();
      loadRequirementRatings();
    }
    @Override public void onFailure(    Throwable caught){
      Window.alert(messages.packagesRetrievalError());
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
  }
);
}
Program: 24843
Project: 24843
Buggy source:
public void drawRateMatrix(){
  matrix.clear();
  matrix.setWidth("String_Node_Str");
  matrix.setStyleName("String_Node_Str");
  matrix.setCellSpacing(0);
  drawRateMatrixHeaderTechniques();
  drawRateMatrixEvaluationCriteriaColum();
  drawRateMatrixValues();
}

Fixed version (ground truth):
public void drawRateMatrix(){
  matrix.clear();
  matrix.setWidth("String_Node_Str");
  matrix.setStyleName("String_Node_Str");
  matrix.setCellSpacing(0);
  drawAttributesAndRequirements();
  drawSoftwarePackages();
  drawRateMatrixValues();
}
Program: 24844
Project: 24844
Buggy source:
public void onClick(ClickEvent event){
  History.newItem(ChooseStepPilot.generateNavigationId(ChooseStepPilot.PageId.home));
}

Fixed version (ground truth):
public void onClick(ClickEvent event){
  if (caseid == 1)   History.newItem(ChooseStepPilot.generateNavigationId(ChooseStepPilot.PageId.home));
  if (caseid == 3)   History.newItem(ChooseStepCase3Pilot.generateNavigationId(ChooseStepCase3Pilot.PageId.home));
}
Program: 24845
Project: 24845
Buggy source:
private void addDoneButton(){
  FlexTable buttonPanel=new FlexTable();
  Button done=new Button(messages.done());
  done.addStyleName("String_Node_Str");
  done.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      History.newItem(ChooseStepPilot.generateNavigationId(ChooseStepPilot.PageId.home));
    }
  }
);
  buttonPanel.setWidget(0,0,new Label("String_Node_Str"));
  buttonPanel.setWidget(1,0,done);
  buttonPanel.setWidth("String_Node_Str");
  buttonPanel.getCellFormatter().setHorizontalAlignment(1,0,HasHorizontalAlignment.ALIGN_RIGHT);
  this.vPane.add(buttonPanel);
}

Fixed version (ground truth):
private void addDoneButton(){
  FlexTable buttonPanel=new FlexTable();
  Button done=new Button(messages.done());
  done.addStyleName("String_Node_Str");
  final int caseid=this.getCurrentState().getCaseID();
  done.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      if (caseid == 1)       History.newItem(ChooseStepPilot.generateNavigationId(ChooseStepPilot.PageId.home));
      if (caseid == 3)       History.newItem(ChooseStepCase3Pilot.generateNavigationId(ChooseStepCase3Pilot.PageId.home));
    }
  }
);
  buttonPanel.setWidget(0,0,new Label("String_Node_Str"));
  buttonPanel.setWidget(1,0,done);
  buttonPanel.setWidth("String_Node_Str");
  buttonPanel.getCellFormatter().setHorizontalAlignment(1,0,HasHorizontalAlignment.ALIGN_RIGHT);
  this.vPane.add(buttonPanel);
}
Program: 24846
Project: 24846
Buggy source:
public void onClick(ClickEvent event){
  History.newItem(ChooseStepPilot.generateNavigationId(ChooseStepPilot.PageId.home));
}

Fixed version (ground truth):
public void onClick(ClickEvent event){
  if (caseid == 1)   History.newItem(ChooseStepPilot.generateNavigationId(ChooseStepPilot.PageId.home));
  if (caseid == 3)   History.newItem(ChooseStepCase3Pilot.generateNavigationId(ChooseStepCase3Pilot.PageId.home));
}
Program: 24848
Project: 24848
Buggy source:
public void initializePane(){
  this.hideStatusBar();
  VerticalPanel layout=new VerticalPanel();
  drawRateMatrix();
  getTotalsFromMatrix();
  drawQualityAttributes();
  drawSoftwarePackages();
  drawMatrixPage();
  this.getContent().clear();
  this.getContent().add(vPane);
  loadRequirementsTable();
  this.getContent().add(vPaneCots);
  loadCotsTable();
}

Fixed version (ground truth):
public void initializePane(){
  this.hideStatusBar();
  VerticalPanel layout=new VerticalPanel();
  drawRateMatrix();
  getTotalsFromMatrix();
  drawQualityAttributes();
  drawSoftwarePackages();
  drawMatrixPage();
  this.getContent().clear();
  this.getContent().add(vPane);
  loadRequirementsTable();
  this.getContent().add(vPaneCots);
  vPaneCotsData.add(layout);
  layout.add(matrixHeader);
  this.getContent().add(vPaneCotsData);
  loadCotsTable();
}
Program: 24849
Project: 24849
Buggy source:
public void loadRequirementsTable(){
  System.out.println("String_Node_Str");
  filterRequirements(lastSearch);
  vPane.clear();
  vPane.setSpacing(0);
  vPane.setWidth("String_Node_Str");
  vPane.setHeight("String_Node_Str");
  vPane.add(getRequirementHeaderRow());
  vPane.add(vPaneData);
  loadRequirementTableData();
}

Fixed version (ground truth):
public void loadRequirementsTable(){
  filterRequirements(lastSearch);
  vPane.clear();
  vPane.setSpacing(0);
  vPane.setWidth("String_Node_Str");
  vPane.setHeight("String_Node_Str");
  vPane.add(getRequirementHeaderRow());
  vPane.add(vPaneData);
  loadRequirementTableData();
}
Program: 24850
Project: 24850
Buggy source:
private void drawMatrixPage(){
  FlexCellFormatter formatter1=this.matrixHeader.getFlexCellFormatter();
  this.matrixHeader.setWidth("String_Node_Str");
  this.matrixHeader.setWidget(1,1,new Label(messages.matrixLableX()));
  this.matrixHeader.setWidget(3,0,new Label(messages.matrixLableY()));
  this.matrixHeader.setWidget(4,1,new Label(messages.rateLegend()));
  formatter1.setHorizontalAlignment(0,0,HasHorizontalAlignment.ALIGN_LEFT);
  formatter1.setHorizontalAlignment(1,1,HasHorizontalAlignment.ALIGN_CENTER);
  formatter1.setHorizontalAlignment(2,1,HasHorizontalAlignment.ALIGN_RIGHT);
  formatter1.setHorizontalAlignment(3,1,HasHorizontalAlignment.ALIGN_LEFT);
  formatter1.setVerticalAlignment(3,0,HasVerticalAlignment.ALIGN_MIDDLE);
  formatter1.setHorizontalAlignment(4,1,HasHorizontalAlignment.ALIGN_LEFT);
  formatter1.setHorizontalAlignment(5,1,HasHorizontalAlignment.ALIGN_RIGHT);
}

Fixed version (ground truth):
private void drawMatrixPage(){
  FlexCellFormatter formatter1=this.matrixHeader.getFlexCellFormatter();
  this.matrixHeader.setWidth("String_Node_Str");
  VerticalPanel XPanel=new VerticalPanel();
  VerticalPanel YPanel=new VerticalPanel();
  XPanel.add(new Label(messages.matrixLableX()));
  YPanel.add(new Label(messages.matrixLableY()));
  this.matrixHeader.setWidget(1,1,XPanel);
  this.matrixHeader.setWidget(3,0,YPanel);
  this.matrixHeader.setWidget(4,1,new Label(messages.rateLegend()));
  formatter1.setHorizontalAlignment(0,0,HasHorizontalAlignment.ALIGN_LEFT);
  formatter1.setHorizontalAlignment(1,1,HasHorizontalAlignment.ALIGN_CENTER);
  formatter1.setHorizontalAlignment(2,1,HasHorizontalAlignment.ALIGN_RIGHT);
  formatter1.setHorizontalAlignment(3,1,HasHorizontalAlignment.ALIGN_LEFT);
  formatter1.setHorizontalAlignment(4,1,HasHorizontalAlignment.ALIGN_LEFT);
  formatter1.setHorizontalAlignment(5,1,HasHorizontalAlignment.ALIGN_RIGHT);
  formatter1.setVerticalAlignment(3,0,HasVerticalAlignment.ALIGN_MIDDLE);
  if (isReadOnly) {
    if (GwtModesType.ReadWrite == this.currentState.getMode()) {
    }
    this.matrixHeader.setWidget(3,1,matrix);
  }
 else {
    this.matrixHeader.setWidget(3,1,matrix);
  }
}
Program: 24851
Project: 24851
Buggy source:
public void loadCotsTable(){
  vPaneCots.setSpacing(0);
  vPaneCots.setWidth("String_Node_Str");
  vPaneCots.setHeight("String_Node_Str");
  vPaneCots.add(getCotsTableHeaderRow());
  vPaneCots.add(vPaneCotsData);
  loadCotsTableData();
}

Fixed version (ground truth):
public void loadCotsTable(){
  vPaneCots.setSpacing(0);
  vPaneCots.setWidth("String_Node_Str");
  vPaneCots.setHeight("String_Node_Str");
  vPaneCots.add(getCotsTableHeaderRow());
}
Program: 24852
Project: 24852
Buggy source:
/** 
 * Contains RPC Calls to retrieve the evaluation criteria for the project
 */
private void loadAttributes(){
  final StepStatus stepStatus=StepStatus.NotStarted;
  packageService.getQualityAttributes(currentProject,stepStatus,new AsyncCallback<List<GwtQualityAttribute>>(){
    @Override public void onSuccess(    List<GwtQualityAttribute> result){
      System.out.println("String_Node_Str" + result.size());
      System.out.println("String_Node_Str" + result.toString());
      attributes=result;
      loadPackages();
    }
    @Override public void onFailure(    Throwable caught){
      Window.alert(messages.attributesRetrievalError());
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
private void loadAttributes(){
  final StepStatus stepStatus=StepStatus.NotStarted;
  packageService.getQualityAttributes(currentProject,stepStatus,new AsyncCallback<List<GwtQualityAttribute>>(){
    @Override public void onSuccess(    List<GwtQualityAttribute> result){
      System.out.println("String_Node_Str" + result.size());
      attributes=result;
      loadPackages();
    }
    @Override public void onFailure(    Throwable caught){
      Window.alert(messages.attributesRetrievalError());
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
  }
);
}
Program: 24853
Project: 24853
Buggy source:
@Test public void testloadDefaultTerms(){
  try {
    agreeOnDefinitionsBusiness.loadDefaultTerms(testProject.getId(),createDefaultTerms());
    List<GwtTerm> terms=agreeOnDefinitionsBusiness.getTerms(new GwtProject(testProject.getId()));
    Assert.assertEquals(5,terms.size());
  }
 catch (  SquareException e) {
    fail("String_Node_Str" + e);
  }
}

Fixed version (ground truth):
@Test public void testloadDefaultTerms(){
  try {
    agreeOnDefinitionsBusiness.loadDefaultTerms(testProject.getId(),createDefaultTerms());
    List<GwtTerm> terms=agreeOnDefinitionsBusiness.getTerms(new GwtProject(testProject.getId()));
    Assert.assertEquals(5,terms.size());
  }
 catch (  SquareException e) {
    e.printStackTrace();
  }
}
Program: 24854
Project: 24854
Buggy source:
@Test public void testAddTerm(){
  try {
    GwtTerm gwtTerm=new GwtTerm();
    gwtTerm.setTerm("String_Node_Str");
    gwtTerm.setDefinition("String_Node_Str");
    GwtProject gwtProject=testProject;
    agreeOnDefinitionsBusiness.addTerm(gwtProject,gwtTerm);
    List<GwtTerm> terms=agreeOnDefinitionsBusiness.getTerms(gwtProject);
    assertTrue(terms.size() == 1);
  }
 catch (  SquareException e) {
    fail("String_Node_Str" + e);
  }
}

Fixed version (ground truth):
@Test public void testAddTerm(){
  try {
    GwtTerm gwtTerm=new GwtTerm();
    gwtTerm.setTerm("String_Node_Str");
    gwtTerm.setDefinition("String_Node_Str");
    GwtProject gwtProject=testProject;
    agreeOnDefinitionsBusiness.addTerm(gwtProject,gwtTerm);
    List<GwtTerm> terms=agreeOnDefinitionsBusiness.getTerms(gwtProject);
    assertTrue(terms.size() == 1);
  }
 catch (  SquareException e) {
    e.printStackTrace();
  }
}
Program: 24855
Project: 24855
Buggy source:
@Test public void testRemoveTerm(){
  try {
    GwtTerm gwtTerm=new GwtTerm();
    gwtTerm.setTerm("String_Node_Str");
    gwtTerm.setDefinition("String_Node_Str");
    GwtTerm gwtTerm2=new GwtTerm();
    gwtTerm2.setTerm("String_Node_Str");
    gwtTerm2.setDefinition("String_Node_Str");
    GwtProject gwtProject=testProject;
    gwtTerm=agreeOnDefinitionsBusiness.addTerm(gwtProject,gwtTerm);
    gwtTerm2=agreeOnDefinitionsBusiness.addTerm(gwtProject,gwtTerm2);
    List<GwtTerm> terms=agreeOnDefinitionsBusiness.getTerms(gwtProject);
    assertTrue(terms.size() == 2);
    agreeOnDefinitionsBusiness.removeTerm(gwtTerm);
    terms=agreeOnDefinitionsBusiness.getTerms(gwtProject);
    assertTrue(terms.size() == 1);
  }
 catch (  SquareException e) {
    fail("String_Node_Str" + e);
  }
}

Fixed version (ground truth):
@Test public void testRemoveTerm(){
  try {
    GwtTerm gwtTerm=new GwtTerm();
    gwtTerm.setTerm("String_Node_Str");
    gwtTerm.setDefinition("String_Node_Str");
    GwtTerm gwtTerm2=new GwtTerm();
    gwtTerm2.setTerm("String_Node_Str");
    gwtTerm2.setDefinition("String_Node_Str");
    GwtProject gwtProject=testProject;
    gwtTerm=agreeOnDefinitionsBusiness.addTerm(gwtProject,gwtTerm);
    gwtTerm2=agreeOnDefinitionsBusiness.addTerm(gwtProject,gwtTerm2);
    List<GwtTerm> terms=agreeOnDefinitionsBusiness.getTerms(gwtProject);
    assertTrue(terms.size() == 2);
    agreeOnDefinitionsBusiness.removeTerm(gwtTerm);
    terms=agreeOnDefinitionsBusiness.getTerms(gwtProject);
    assertTrue(terms.size() == 1);
  }
 catch (  SquareException e) {
    e.printStackTrace();
  }
}
Program: 24856
Project: 24856
Buggy source:
@Test public void testUpdateTerm(){
  try {
    GwtTerm gwtTerm=new GwtTerm();
    gwtTerm.setTerm("String_Node_Str");
    gwtTerm.setDefinition("String_Node_Str");
    GwtProject gwtProject=testProject;
    gwtTerm=agreeOnDefinitionsBusiness.addTerm(gwtProject,gwtTerm);
    gwtTerm.setTerm("String_Node_Str");
    gwtTerm.setDefinition("String_Node_Str");
    agreeOnDefinitionsBusiness.updateTerm(gwtProject,gwtTerm);
    List<GwtTerm> terms=agreeOnDefinitionsBusiness.getTerms(gwtProject);
    terms=agreeOnDefinitionsBusiness.getTerms(gwtProject);
    assertTrue(terms.get(0).getTerm().equals(gwtTerm.getTerm()));
  }
 catch (  SquareException e) {
    fail("String_Node_Str" + e);
  }
}

Fixed version (ground truth):
@Test public void testUpdateTerm(){
  try {
    GwtTerm gwtTerm=new GwtTerm();
    gwtTerm.setTerm("String_Node_Str");
    gwtTerm.setDefinition("String_Node_Str");
    GwtProject gwtProject=testProject;
    gwtTerm=agreeOnDefinitionsBusiness.addTerm(gwtProject,gwtTerm);
    gwtTerm.setTerm("String_Node_Str");
    gwtTerm.setDefinition("String_Node_Str");
    agreeOnDefinitionsBusiness.updateTerm(gwtProject,gwtTerm);
    List<GwtTerm> terms=agreeOnDefinitionsBusiness.getTerms(gwtProject);
    terms=agreeOnDefinitionsBusiness.getTerms(gwtProject);
    assertTrue(terms.get(0).getTerm().equals(gwtTerm.getTerm()));
  }
 catch (  SquareException e) {
    e.printStackTrace();
  }
}
Program: 24858
Project: 24858
Buggy source:
@Test public void testCreateStepsProject(){
  try {
    GwtUser gwtUser=((User)testMap.get("String_Node_Str")).createGwtUser();
    GwtProject project=new GwtProject();
    project.setName("String_Node_Str");
    project.setSecurity(true);
    project.setPrivacy(false);
    project.setLite(false);
    project.setLeadRequirementEngineer(gwtUser);
    project=mps.createProject(project,this.createDefaultTerms(),this.createDefaultTechnique(),this.createDefaultInspections(),this.createDefaultEvaluation());
  }
 catch (  Exception e) {
    fail("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testCreateStepsProject(){
  try {
    GwtUser gwtUser=((User)testMap.get("String_Node_Str")).createGwtUser();
    GwtProject project=new GwtProject();
    project.setName("String_Node_Str");
    project.setSecurity(true);
    project.setPrivacy(false);
    project.setLite(false);
    project.setLeadRequirementEngineer(gwtUser);
    project=mps.createProject(project,this.createDefaultTerms(),this.createDefaultTechnique(),this.createDefaultInspections(),this.createDefaultEvaluation());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 24859
Project: 24859
Buggy source:
@AllowedRoles(roles={Roles.Contractor,Roles.Security_Specialist,Roles.Administrator}) public void updateRequirement(GwtRequirement gwtRequirement) throws SquareException {
  Requirement r=requirementDao.fetch(gwtRequirement.getId());
  r.getRisks().clear();
  r.getArtifacts().clear();
  r.getGoals().clear();
  r.update(gwtRequirement);
  if (gwtRequirement.getRisks().isEmpty()) {
    SquareException se=new SquareException("String_Node_Str");
    se.setType(ExceptionType.missingLink);
    throw se;
  }
  if (gwtRequirement.getArtifacts().isEmpty()) {
    SquareException se=new SquareException("String_Node_Str");
    se.setType(ExceptionType.missingLink);
    throw se;
  }
  requirementDao.update(r);
}

Fixed version (ground truth):
@AllowedRoles(roles={Roles.Contractor,Roles.Security_Specialist,Roles.Administrator}) public void updateRequirement(GwtRequirement gwtRequirement) throws SquareException {
  Requirement r=requirementDao.fetch(gwtRequirement.getId());
  r.getRisks().clear();
  r.getArtifacts().clear();
  r.getGoals().clear();
  r.update(gwtRequirement);
  if (gwtRequirement.getArtifacts().isEmpty()) {
    SquareException se=new SquareException("String_Node_Str");
    se.setType(ExceptionType.missingLink);
    throw se;
  }
  requirementDao.update(r);
}
Program: 24860
Project: 24860
Buggy source:
public GwtProject(){
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public GwtProject(){
}
Program: 24861
Project: 24861
Buggy source:
@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="String_Node_Str",nullable=false) public AsquareCase getCases(){
  return this.cases;
}

Fixed version (ground truth):
@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="String_Node_Str",nullable=true) public AsquareCase getCases(){
  return this.cases;
}
Program: 24862
Project: 24862
Buggy source:
public GwtProject(){
}

Fixed version (ground truth):
public GwtProject(){
  System.out.println("String_Node_Str");
}
Program: 24863
Project: 24863
Buggy source:
public CreateProjectDialog(int projectId,String projectName,int leadRequirementId,List<GwtProject> projects,List<GwtUser> users,ProjectGrid caller){
  super();
  this.listOfProjects=projects;
  this.listOfUsers=users;
  this.caller=caller;
  this.initializeDialog(new GwtProject(projectId,projectName,leadRequirementId));
}

Fixed version (ground truth):
public CreateProjectDialog(int projectId,String projectName,int leadRequirementId,List<GwtProject> projects,List<GwtUser> users,ProjectGrid caller,int casesId){
  super();
  this.listOfProjects=projects;
  this.listOfUsers=users;
  this.caller=caller;
  this.initializeDialog(new GwtProject(projectId,projectName,leadRequirementId,casesId));
}
Program: 24864
Project: 24864
Buggy source:
private void loadCreateDialog(final GwtProject project){
  final ProjectGrid caller=this;
  ServiceDefTarget endpoint=(ServiceDefTarget)manageSiteService;
  endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "String_Node_Str");
  manageSiteService.getAllUsers(new AsyncCallback<List<GwtUser>>(){
    public void onFailure(    Throwable caught){
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,messages.retrievingUsers());
    }
    public void onSuccess(    List<GwtUser> result){
      if (project.isInDatabase()) {
        CreateProjectDialog dialog=new CreateProjectDialog(project.getId(),project.getName(),project.getLeadRequirementEngineer().getUserId(),listOfProjects,result,caller);
        dialog.center();
        dialog.setModal(true);
        dialog.show();
      }
 else {
        CreateProjectDialog dialog=new CreateProjectDialog(listOfProjects,result,caller);
        dialog.center();
        dialog.setModal(true);
        dialog.show();
      }
    }
  }
);
}

Fixed version (ground truth):
private void loadCreateDialog(final GwtProject project){
  final ProjectGrid caller=this;
  ServiceDefTarget endpoint=(ServiceDefTarget)manageSiteService;
  endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "String_Node_Str");
  manageSiteService.getAllUsers(new AsyncCallback<List<GwtUser>>(){
    public void onFailure(    Throwable caught){
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,messages.retrievingUsers());
    }
    public void onSuccess(    List<GwtUser> result){
      if (project.isInDatabase()) {
        CreateProjectDialog dialog=new CreateProjectDialog(project.getId(),project.getName(),project.getLeadRequirementEngineer().getUserId(),listOfProjects,result,caller,project.getCases().getId());
        dialog.center();
        dialog.setModal(true);
        dialog.show();
      }
 else {
        CreateProjectDialog dialog=new CreateProjectDialog(listOfProjects,result,caller);
        dialog.center();
        dialog.setModal(true);
        dialog.show();
      }
    }
  }
);
}
Program: 24865
Project: 24865
Buggy source:
/** 
 * This function is temporary here. It should be placed in the chose project step.
 * @param projectID
 * @param userName
 */
public void loadRoles(final GwtProject project,final String userName){
  this.showLoadingStatusBar();
  currentState.setProjectName(project.getName());
  currentState.setProjectInspectionStatus(null);
  if (project.getInspectionStatus() != null) {
    currentState.setProjectInspectionStatus(project.getInspectionStatus().getLabel());
  }
  for (  ProjectRole pr : ProjectRole.values()) {
    if (pr.getLabel().equals(project.getCurrentRole().getName())) {
      currentState.setUserProjectRole(pr);
    }
  }
  History.newItem(ChooseStepPilot.generateNavigationId(ChooseStepPilot.PageId.home));
}

Fixed version (ground truth):
/** 
 * This function is temporary here. It should be placed in the chose project step.
 * @param projectID
 * @param userName
 */
public void loadRoles(final GwtProject project,final String userName){
  this.showLoadingStatusBar();
  currentState.setProjectName(project.getName());
  currentState.setProjectInspectionStatus(null);
  if (project.getInspectionStatus() != null) {
    currentState.setProjectInspectionStatus(project.getInspectionStatus().getLabel());
  }
  for (  ProjectRole pr : ProjectRole.values()) {
    if (pr.getLabel().equals(project.getCurrentRole().getName())) {
      currentState.setUserProjectRole(pr);
    }
  }
  System.out.println("String_Node_Str" + project.getCases().getId());
  History.newItem(ChooseStepPilot.generateNavigationId(ChooseStepPilot.PageId.home));
}
Program: 24866
Project: 24866
Buggy source:
public AsquareCase(GwtAsquareCase gwtCase){
  this.id=gwtCase.getId();
  this.name=gwtCase.getName();
  this.description=gwtCase.getDescription();
}

Fixed version (ground truth):
public AsquareCase(GwtAsquareCase gwtCase){
  if (gwtCase == null) {
    return;
  }
  this.id=gwtCase.getId();
  this.name=gwtCase.getName();
  this.description=gwtCase.getDescription();
}
Program: 24867
Project: 24867
Buggy source:
public static Calendar parseTimestamp(String timestamp){
  String dateFormat;
  Calendar calendar=Calendar.getInstance();
  if (timestamp.length() == 31) {
    dateFormat="String_Node_Str";
  }
 else   if (timestamp.length() == 29 || timestamp.length() == 35) {
    dateFormat="String_Node_Str";
  }
 else {
    dateFormat="String_Node_Str";
  }
  DateFormat df=new SimpleDateFormat(dateFormat);
  try {
    calendar.setTime(df.parse(timestamp));
  }
 catch (  ParseException ex) {
    ex.printStackTrace();
  }
  return calendar;
}

Fixed version (ground truth):
public static Calendar parseTimestamp(String timestamp){
  Pattern p1=Pattern.compile("String_Node_Str");
  Pattern p2=Pattern.compile("String_Node_Str");
  Pattern p3=Pattern.compile("String_Node_Str");
  String dateFormat;
  Calendar calendar=Calendar.getInstance();
  if (p1.matcher(timestamp).matches()) {
    dateFormat="String_Node_Str";
  }
 else   if (p2.matcher(timestamp).matches()) {
    dateFormat="String_Node_Str";
  }
 else   if (p3.matcher(timestamp).matches()) {
    StringTokenizer t1=new StringTokenizer(timestamp,"String_Node_Str");
    String date=t1.nextToken();
    String time=t1.nextToken();
    String mk=t1.nextToken();
    StringTokenizer t2=new StringTokenizer(date,"String_Node_Str");
    String month=t2.nextToken();
    String day=t2.nextToken();
    String year=t2.nextToken();
    if (month.length() == 1)     month="String_Node_Str" + month;
    if (day.length() == 1)     day="String_Node_Str" + month;
    StringTokenizer t3=new StringTokenizer(time,"String_Node_Str");
    String hour=t3.nextToken();
    String min=t3.nextToken();
    String sec=t3.nextToken();
    if (hour.length() == 1)     hour="String_Node_Str" + hour;
    timestamp=month + "String_Node_Str" + day+ "String_Node_Str"+ year+ "String_Node_Str"+ hour+ "String_Node_Str"+ min+ "String_Node_Str"+ sec+ "String_Node_Str"+ mk;
    dateFormat="String_Node_Str";
  }
 else {
    dateFormat="String_Node_Str";
  }
  DateFormat df=new SimpleDateFormat(dateFormat,Locale.US);
  try {
    calendar.setTime(df.parse(timestamp));
  }
 catch (  ParseException ex) {
    ex.printStackTrace();
  }
  return calendar;
}
Program: 24870
Project: 24870
Buggy source:
@Override public void loadFromXML(Node node) throws XMLException {
  File newSrc=null;
  Map<String,String> newParams=new HashMap<String,String>();
  NodeList nodes=node.getChildNodes();
  for (int index=0; index < nodes.getLength(); index++) {
    Node n=nodes.item(index);
    if (n.getNodeName().equals("String_Node_Str")) {
      try {
        URI inURI=new URI(n.getFirstChild().getNodeValue());
        if (formFile != null) {
          inURI=formFile.toURI().resolve(inURI);
        }
        newSrc=new File(inURI);
      }
 catch (      DOMException dome) {
        throw new XMLException("String_Node_Str","String_Node_Str",dome);
      }
catch (      URISyntaxException urise) {
        throw new XMLException("String_Node_Str","String_Node_Str",urise);
      }
    }
 else     if (n.getNodeName().equals("String_Node_Str")) {
      newParams.put("String_Node_Str",n.getFirstChild().getNodeValue());
      NamedNodeMap p=n.getAttributes();
      for (int pindex=0; pindex < p.getLength(); pindex++) {
        Node pn=p.item(pindex);
        newParams.put(pn.getNodeName(),pn.getNodeValue());
      }
    }
  }
  srcFile=newSrc;
  params=newParams;
}

Fixed version (ground truth):
@Override public void loadFromXML(Node node) throws XMLException {
  File newSrc=null;
  Map<String,String> newParams=new HashMap<String,String>();
  NodeList nodes=node.getChildNodes();
  for (int index=0; index < nodes.getLength(); index++) {
    Node n=nodes.item(index);
    if (n.getNodeName().equals("String_Node_Str")) {
      try {
        URI inURI=new URI(n.getFirstChild().getNodeValue());
        if (formFile != null) {
          inURI=getFormulaTargetURI().resolve(inURI);
        }
        newSrc=new File(inURI);
      }
 catch (      DOMException dome) {
        throw new XMLException("String_Node_Str","String_Node_Str",dome);
      }
catch (      URISyntaxException urise) {
        throw new XMLException("String_Node_Str","String_Node_Str",urise);
      }
    }
 else     if (n.getNodeName().equals("String_Node_Str")) {
      newParams.put("String_Node_Str",n.getFirstChild().getNodeValue());
      NamedNodeMap p=n.getAttributes();
      for (int pindex=0; pindex < p.getLength(); pindex++) {
        Node pn=p.item(pindex);
        newParams.put(pn.getNodeName(),pn.getNodeValue());
      }
    }
  }
  srcFile=newSrc;
  params=newParams;
}
Program: 24871
Project: 24871
Buggy source:
@Override public Node toXML(Document document,String name){
  Element out=document.createElement(name);
  URI outURI=srcFile.toURI();
  if (formFile != null) {
    outURI=formFile.toURI().relativize(outURI);
  }
  Element src=document.createElement("String_Node_Str");
  src.appendChild(document.createTextNode(outURI.toString()));
  out.appendChild(src);
  Element ldr=document.createElement("String_Node_Str");
  ldr.appendChild(document.createTextNode(getLoaderName()));
  for (  Map.Entry<String,String> param : params.entrySet()) {
    if (!param.getKey().equals("String_Node_Str")) {
      ldr.setAttribute(param.getKey(),param.getValue());
    }
  }
  out.appendChild(ldr);
  return out;
}

Fixed version (ground truth):
@Override public Node toXML(Document document,String name){
  Element out=document.createElement(name);
  URI outURI=srcFile.toURI();
  if (formFile != null) {
    outURI=getFormulaTargetURI().relativize(outURI);
  }
  Element src=document.createElement("String_Node_Str");
  src.appendChild(document.createTextNode(outURI.toString()));
  out.appendChild(src);
  Element ldr=document.createElement("String_Node_Str");
  ldr.appendChild(document.createTextNode(getLoaderName()));
  for (  Map.Entry<String,String> param : params.entrySet()) {
    if (!param.getKey().equals("String_Node_Str")) {
      ldr.setAttribute(param.getKey(),param.getValue());
    }
  }
  out.appendChild(ldr);
  return out;
}