nus-yam/ex-repair huggingface dataset:
Program: 24783
Project: 24783
Buggy source:
/** 
 * Sets up the controls in the dialog
 * @param SoftwarePackage The category to be updated in this dialog.
 */
private void initializeDialogReadOnly(GwtTradeoffReason tradeoffReason){
  VerticalPanel baseLayout=new VerticalPanel();
  VerticalPanel nameLayout=new VerticalPanel();
  VerticalPanel descriptionLayout=new VerticalPanel();
  HorizontalPanel buttonsLayout=new HorizontalPanel();
  this.setText(messages.editTradeoffReasonDialogBoxTitleReadOnly());
  nameLayout.add(new Label(messages.editTradeoffReasonDialogBoxName()));
  nameLayout.add(this.tradeoffReasonTextBox);
  this.tradeoffReasonTextBox.setWidth("String_Node_Str");
  this.tradeoffReasonTextBox.setSize("String_Node_Str","String_Node_Str");
  this.tradeoffReasonTextBox.setText(tradeoffReason.getTradeoffreason());
  Button okayButton=new Button(messages.editTradeoffReasonDialogBoxOkay(),new CancelHandler(this));
  this.tradeoffReasonTextBox.addKeyUpHandler(new KeyUpHandler(){
    public void onKeyUp(    KeyUpEvent event){
      configureButton();
    }
  }
);
  this.tradeoffReasonTextBox.addChangeHandler(new ChangeHandler(){
    public void onChange(    ChangeEvent event){
      configureButton();
    }
  }
);
  this.tradeoffReasonTextBox.addKeyDownHandler(new KeyDownHandler(){
    public void onKeyDown(    KeyDownEvent event){
      configureButton();
    }
  }
);
  okayButton.setWidth("String_Node_Str");
  buttonsLayout.setSpacing(10);
  buttonsLayout.add(okayButton);
  baseLayout.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
  baseLayout.add(nameLayout);
  baseLayout.add(descriptionLayout);
  baseLayout.add(buttonsLayout);
  baseLayout.setSpacing(5);
  this.setWidget(baseLayout);
}

Fixed version (ground truth):
/** 
 * Sets up the controls in the dialog
 * @param SoftwarePackage The category to be updated in this dialog.
 */
private void initializeDialogReadOnly(GwtTradeoffReason tradeoffReason){
  VerticalPanel baseLayout=new VerticalPanel();
  VerticalPanel nameLayout=new VerticalPanel();
  VerticalPanel descriptionLayout=new VerticalPanel();
  HorizontalPanel buttonsLayout=new HorizontalPanel();
  this.setText(messages.editTradeoffReasonDialogBoxTitleReadOnly());
  nameLayout.add(new Label(messages.editTradeoffReasonDialogBoxName()));
  nameLayout.add(this.tradeoffReasonTextBox);
  this.tradeoffReasonTextBox.setWidth("String_Node_Str");
  this.tradeoffReasonTextBox.setSize("String_Node_Str","String_Node_Str");
  this.tradeoffReasonTextBox.setText(tradeoffReason.getTradeoffreason());
  Button okayButton=new Button(messages.editTradeoffReasonDialogBoxOkay(),new CancelHandler(this));
  okayButton.setWidth("String_Node_Str");
  buttonsLayout.setSpacing(10);
  buttonsLayout.add(okayButton);
  baseLayout.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
  baseLayout.add(nameLayout);
  baseLayout.add(descriptionLayout);
  baseLayout.add(buttonsLayout);
  baseLayout.setSpacing(5);
  this.setWidget(baseLayout);
}
Program: 24785
Project: 24785
Buggy source:
public void PaneInitialization(){
  this.hideStatusBar();
  this.getContent().clear();
  HorizontalPanel hPanel=new HorizontalPanel();
  hPanel.setWidth("String_Node_Str");
  hPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
  if (currentState.getUserProjectRole() == ProjectRole.Lead_Requirements_Engineer || currentState.getUserProjectRole() == ProjectRole.Requirements_Engineer) {
    if (currentState.getMode().equals(GwtModesType.ReadWrite)) {
      createImportPanel(hPanel,getCurrentState().getProjectID());
    }
  }
  this.getContent().add(hPanel);
  loadRiskTable();
  this.getContent().add(requirementTable);
  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.getContent().add(buttonPanel);
}

Fixed version (ground truth):
public void PaneInitialization(){
  this.hideStatusBar();
  this.getContent().clear();
  HorizontalPanel hPanel=new HorizontalPanel();
  hPanel.setWidth("String_Node_Str");
  hPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
  if (currentState.getUserProjectRole() == ProjectRole.Lead_Requirements_Engineer || currentState.getUserProjectRole() == ProjectRole.Requirements_Engineer) {
    if (currentState.getMode().equals(GwtModesType.ReadWrite)) {
      createImportPanel(hPanel,getCurrentState().getProjectID());
    }
  }
  this.getContent().add(hPanel);
  loadRiskTable();
  this.getContent().add(requirementTable);
  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.getContent().add(buttonPanel);
}
Program: 24786
Project: 24786
Buggy source:
public void updateRequirement(int requirementId,GwtRequirement gwtRequirement){
  gwtRequirement.setId(requirementId);
  this.requirementService.updateRequirement(gwtRequirement,new AsyncCallback<Void>(){
    public void onFailure(    Throwable caught){
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,messages.errorUpdatingRequirements());
    }
    public void onSuccess(    Void result){
      currentCommand=CommandTypes.read;
      loadProjectRequirements();
    }
  }
);
}

Fixed version (ground truth):
public void updateRequirement(int requirementId,GwtRequirement gwtRequirement){
  gwtRequirement.setId(requirementId);
  System.out.println("String_Node_Str");
  this.requirementService.updateRequirement(gwtRequirement,new AsyncCallback<Void>(){
    public void onFailure(    Throwable caught){
      System.out.println("String_Node_Str" + caught);
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,messages.errorUpdatingRequirements());
    }
    public void onSuccess(    Void result){
      currentCommand=CommandTypes.read;
      loadProjectRequirements();
    }
  }
);
}
Program: 24787
Project: 24787
Buggy source:
public void onClick(ClickEvent event){
  riskDialogBox=new RiskDialogBox(riksPane,listOfProjectFilteredRisks,listOfRiksMapppedToRequirement);
  riskDialogBox.setModal(true);
  riskDialogBox.center();
  currentDialog="String_Node_Str";
  riskDialogBox.show();
}

Fixed version (ground truth):
public void onClick(ClickEvent event){
  artifactDialog=new ArtifactDialogBox(riksPane,listOfProjectArtifacts,listOfArtifactsMappedToRequirement,messages.associateArtifacts());
  artifactDialog.setModal(true);
  artifactDialog.center();
  artifactDialog.show();
  currentDialog="String_Node_Str";
}
Program: 24788
Project: 24788
Buggy source:
public void saveRequirement(int requirementId){
  if (validateRequiredFields()) {
    GwtRequirement gwtRequirement=getFormRiskValues();
    if (requirementId == -1) {
      addRequirementToProject(gwtRequirement);
    }
 else {
      updateRequirement(requirementId,gwtRequirement);
    }
  }
}

Fixed version (ground truth):
public void saveRequirement(int requirementId){
  if (validateRequiredFields()) {
    GwtRequirement gwtRequirement=getFormRiskValues();
    if (requirementId == -1) {
      addRequirementToProject(gwtRequirement);
    }
 else {
      System.out.println("String_Node_Str" + requirementId + "String_Node_Str"+ gwtRequirement);
      updateRequirement(requirementId,gwtRequirement);
    }
  }
}
Program: 24789
Project: 24789
Buggy source:
@AllowedRoles(roles={Roles.Contractor,Roles.Security_Specialist,Roles.Administrator,Roles.Acquisition_Organization_Engineer}) 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,Roles.Acquisition_Organization_Engineer}) 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);
  requirementDao.update(r);
}
Program: 24790
Project: 24790
Buggy source:
@AllowedRoles(roles={Roles.Contractor,Roles.Security_Specialist,Roles.Administrator,Roles.Acquisition_Organization_Engineer}) public int addRequirementToProject(Integer projectId,GwtRequirement gwtRequirement) throws SquareException {
  Project p=projectDao.fetch(projectId);
  Requirement requirement=new Requirement(gwtRequirement);
  requirement.setProject(p);
  if (gwtRequirement.getArtifacts().isEmpty()) {
    SquareException se=new SquareException("String_Node_Str");
    se.setType(ExceptionType.missingLink);
    throw se;
  }
  requirementDao.create(requirement);
  p.getRequirements().add(requirement);
  return requirement.getId();
}

Fixed version (ground truth):
@AllowedRoles(roles={Roles.Contractor,Roles.Security_Specialist,Roles.Administrator,Roles.Acquisition_Organization_Engineer}) public int addRequirementToProject(Integer projectId,GwtRequirement gwtRequirement) throws SquareException {
  Project p=projectDao.fetch(projectId);
  Requirement requirement=new Requirement(gwtRequirement);
  requirement.setProject(p);
  requirementDao.create(requirement);
  p.getRequirements().add(requirement);
  return requirement.getId();
}
Program: 24793
Project: 24793
Buggy source:
public void loadSubGoalsFromProject(){
  IdentifyGoalsAssetsServiceAsync service=GWT.create(IdentifyGoalsAssetsService.class);
  ServiceDefTarget endpoint=(ServiceDefTarget)service;
  endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "String_Node_Str");
  service.loadBusinessGoalInfo(getCurrentState().getProjectID(),new AsyncCallback<GwtBusinessGoal>(){
    public void onFailure(    Throwable caught){
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
    public void onSuccess(    GwtBusinessGoal result){
      businessGoalInfo=result;
      listOfProjectSubGoals=businessGoalInfo.getSubGoals();
      loadArtifactsFromProject();
      System.out.println("String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
public void loadSubGoalsFromProject(){
  IdentifyGoalsAssetsServiceAsync service=GWT.create(IdentifyGoalsAssetsService.class);
  ServiceDefTarget endpoint=(ServiceDefTarget)service;
  endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "String_Node_Str");
  service.loadBusinessGoalInfo(getCurrentState().getProjectID(),new AsyncCallback<GwtBusinessGoal>(){
    public void onFailure(    Throwable caught){
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
    public void onSuccess(    GwtBusinessGoal result){
      businessGoalInfo=result;
      listOfProjectSubGoals=businessGoalInfo.getSubGoals();
      loadArtifactsFromProject();
    }
  }
);
}
Program: 24794
Project: 24794
Buggy source:
public void loadArtifactsFromProject(){
  System.out.println("String_Node_Str");
  CollectArtifactsServiceAsync service=GWT.create(CollectArtifactsService.class);
  int projectId=this.getCurrentState().getProjectID();
  ServiceDefTarget endpoint=(ServiceDefTarget)service;
  endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "String_Node_Str");
  service.getAllArtifacts(projectId,new AsyncCallback<List<GwtArtifact>>(){
    public void onFailure(    Throwable caught){
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
    public void onSuccess(    List<GwtArtifact> result){
      loadProjectRequirements();
      System.out.println("String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
public void loadArtifactsFromProject(){
  CollectArtifactsServiceAsync service=GWT.create(CollectArtifactsService.class);
  int projectId=this.getCurrentState().getProjectID();
  ServiceDefTarget endpoint=(ServiceDefTarget)service;
  endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "String_Node_Str");
  service.getAllArtifacts(projectId,new AsyncCallback<List<GwtArtifact>>(){
    public void onFailure(    Throwable caught){
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
    public void onSuccess(    List<GwtArtifact> result){
      loadProjectRequirements();
      System.out.println("String_Node_Str");
    }
  }
);
}
Program: 24795
Project: 24795
Buggy source:
@AllowedRoles(roles={Roles.Contractor,Roles.Security_Specialist,Roles.Administrator,Roles.Acquisition_Organization_Engineer}) 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);
  requirementDao.update(r);
}

Fixed version (ground truth):
@AllowedRoles(roles={Roles.Contractor,Roles.Security_Specialist,Roles.Administrator,Roles.Acquisition_Organization_Engineer}) 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);
  System.out.println("String_Node_Str" + r.getStatus());
  System.out.println("String_Node_Str" + r.getTitle());
  requirementDao.update(r);
}
Program: 24796
Project: 24796
Buggy source:
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);
}
}
);
}

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);
loadRequirementRatings();
}
}
);
}
Program: 24797
Project: 24797
Buggy source:
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");
    }
  }
);
}

Fixed version (ground truth):
private void loadRatings(){
  service.getRateValues(currentProject.getId(),new AsyncCallback<List<GwtRating>>(){
    @Override public void onSuccess(    List<GwtRating> result){
      loadRequirementRatings();
      ratings=result;
      drawRateMatrix();
      getTotalsFromMatrix();
      PaneInitialization();
    }
    @Override public void onFailure(    Throwable caught){
      Window.alert(messages.ratingsRetrievalError());
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
  }
);
}
Program: 24798
Project: 24798
Buggy source:
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");
    }
  }
);
}

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();
      loadAttributes();
    }
    @Override public void onFailure(    Throwable caught){
      Window.alert(messages.ratingsRetrievalError());
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
  }
);
}
Program: 24799
Project: 24799
Buggy source:
private void setRequirementRateValue(final int packageID,final int requirementID,final int value){
  this.performTradeoffService.setRequirementRateValue(currentProject.getId(),requirementID,packageID,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){
setValueFromlistOfRequirementRateValues(requirementID,packageID,value);
}
}
);
}

Fixed version (ground truth):
private void setRequirementRateValue(final int packageID,final int requirementID,final int value){
  this.performTradeoffService.setRequirementRateValue(currentProject.getId(),requirementID,packageID,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){
setValueFromlistOfRequirementRateValues(requirementID,packageID,value);
loadRequirementRatings();
}
}
);
}
Program: 24800
Project: 24800
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,Roles.Acquisition_Organization_Engineer}) 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);
}
Program: 24801
Project: 24801
Buggy source:
@AllowedRoles(roles={Roles.Contractor,Roles.Security_Specialist,Roles.Administrator}) public int addRequirementToProject(Integer projectId,GwtRequirement gwtRequirement) throws SquareException {
  Project p=projectDao.fetch(projectId);
  Requirement requirement=new Requirement(gwtRequirement);
  requirement.setProject(p);
  if (gwtRequirement.getArtifacts().isEmpty()) {
    SquareException se=new SquareException("String_Node_Str");
    se.setType(ExceptionType.missingLink);
    throw se;
  }
  requirementDao.create(requirement);
  p.getRequirements().add(requirement);
  return requirement.getId();
}

Fixed version (ground truth):
@AllowedRoles(roles={Roles.Contractor,Roles.Security_Specialist,Roles.Administrator,Roles.Acquisition_Organization_Engineer}) public int addRequirementToProject(Integer projectId,GwtRequirement gwtRequirement) throws SquareException {
  Project p=projectDao.fetch(projectId);
  Requirement requirement=new Requirement(gwtRequirement);
  requirement.setProject(p);
  if (gwtRequirement.getArtifacts().isEmpty()) {
    SquareException se=new SquareException("String_Node_Str");
    se.setType(ExceptionType.missingLink);
    throw se;
  }
  requirementDao.create(requirement);
  p.getRequirements().add(requirement);
  return requirement.getId();
}
Program: 24802
Project: 24802
Buggy source:
@AllowedRoles(roles={Roles.Contractor,Roles.Security_Specialist,Roles.Administrator}) public void deleteRequirement(Integer requirementId,Integer projectId) throws SquareException {
  requirementDao.deleteById(requirementId);
  requirementDao.zeroOutPriorities(projectId);
}

Fixed version (ground truth):
@AllowedRoles(roles={Roles.Contractor,Roles.Security_Specialist,Roles.Administrator,Roles.Acquisition_Organization_Engineer}) public void deleteRequirement(Integer requirementId,Integer projectId) throws SquareException {
  requirementDao.deleteById(requirementId);
  requirementDao.zeroOutPriorities(projectId);
}
Program: 24803
Project: 24803
Buggy source:
public void loadRationale(){
  System.out.println("String_Node_Str");
  finalProductSelectionService.getRationale(currentProject,new AsyncCallback<GwtRationale>(){
    @Override public void onSuccess(    GwtRationale result){
      rationale=result;
      if (result == null) {
        rationaleLabel=new Label("String_Node_Str");
      }
 else {
        rationaleLabel=new Label(result.getRationale());
      }
      rationaleLabel.setWidth("String_Node_Str");
      rationaleLabel.setSize("String_Node_Str","String_Node_Str");
    }
    @Override public void onFailure(    Throwable caught){
      Window.alert(messages.rationaleRetrievalError());
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
public void loadRationale(){
  System.out.println("String_Node_Str");
  finalProductSelectionService.getRationale(currentProject,new AsyncCallback<GwtRationale>(){
    @Override public void onSuccess(    GwtRationale result){
      rationale=result;
      if (result == null) {
        rationaleLabel=new Label("String_Node_Str");
      }
 else {
        rationaleLabel=new Label(result.getRationale());
      }
      rationaleLabel.setWidth("String_Node_Str");
      rationaleLabel.setSize("String_Node_Str","String_Node_Str");
      loadTradeoffReasons();
    }
    @Override public void onFailure(    Throwable caught){
      Window.alert(messages.rationaleRetrievalError());
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
  }
);
}
Program: 24804
Project: 24804
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;
      loadRationale();
    }
    @Override public void onFailure(    Throwable caught){
      Window.alert(messages.ratingsRetrievalError());
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
  }
);
}
Program: 24805
Project: 24805
Buggy source:
public FinalProductSelectionPane(final State stateInfo){
  super(stateInfo);
  this.showLoadingStatusBar();
  ServiceDefTarget endpoint=(ServiceDefTarget)service;
  endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "String_Node_Str");
  ServiceDefTarget endpoint2=(ServiceDefTarget)finalProductSelectionService;
  endpoint2.setServiceEntryPoint(GWT.getModuleBaseURL() + "String_Node_Str");
  currentProject=new GwtProject();
  currentProject.setId(this.getCurrentState().getProjectID());
  isReadOnly=true;
  loadAttributes();
  loadRationale();
  loadTradeoffReasons();
}

Fixed version (ground truth):
public FinalProductSelectionPane(final State stateInfo){
  super(stateInfo);
  this.showLoadingStatusBar();
  ServiceDefTarget endpoint=(ServiceDefTarget)service;
  endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "String_Node_Str");
  ServiceDefTarget endpoint2=(ServiceDefTarget)finalProductSelectionService;
  endpoint2.setServiceEntryPoint(GWT.getModuleBaseURL() + "String_Node_Str");
  currentProject=new GwtProject();
  currentProject.setId(this.getCurrentState().getProjectID());
  isReadOnly=true;
  loadAttributes();
}
Program: 24806
Project: 24806
Buggy source:
private void loadTradeoffReasons(){
  finalProductSelectionService.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(){
  finalProductSelectionService.getTradeoffReasons(currentProject.getId(),new AsyncCallback<List<GwtTradeoffReason>>(){
    @Override public void onSuccess(    List<GwtTradeoffReason> result){
      tradeoffReasons=result;
      loadRequirementRatings();
    }
    @Override public void onFailure(    Throwable caught){
      Window.alert(messages.ratingsRetrievalError());
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
  }
);
}
Program: 24807
Project: 24807
Buggy source:
private void loadRequirementRatings(){
  finalProductSelectionService.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(){
  finalProductSelectionService.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: 24808
Project: 24808
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();
    }
    @Override public void onFailure(    Throwable caught){
      Window.alert(messages.packagesRetrievalError());
      ExceptionHelper.SquareRootRPCExceptionHandler(caught,"String_Node_Str");
    }
  }
);
}
Program: 24809
Project: 24809
Buggy source:
protected void updateQAinDB(GwtQualityAttribute gwtQualityAttribute){
  this.service.updateQualityAttribute(gwtQualityAttribute,currentProject,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){
loadAttributes();
}
}
);
}

Fixed version (ground truth):
protected void updateQAinDB(GwtQualityAttribute gwtQualityAttribute){
  this.service.updateQualityAttribute(gwtQualityAttribute,currentProject,new AsyncCallback<Void>(){
    public void onFailure(    Throwable caught){
      if (caught instanceof SquareException) {
        SquareException se=(SquareException)caught;
switch (se.getType()) {
case authorization:
          Window.alert(messages.QAAuthorization());
        break;
default :
      Window.alert(messages.error());
    break;
}
}
 else {
Window.alert(messages.error());
}
}
public void onSuccess(Void result){
loadAttributes();
}
}
);
}
Program: 24810
Project: 24810
Buggy source:
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());
}
}

Fixed version (ground truth):
public void onFailure(Throwable caught){
  if (caught instanceof SquareException) {
    SquareException se=(SquareException)caught;
switch (se.getType()) {
case authorization:
      Window.alert(messages.QAAuthorization());
    break;
default :
  Window.alert(messages.error());
break;
}
}
 else {
Window.alert(messages.error());
}
}
Program: 24811
Project: 24811
Buggy source:
/** 
 * Contains RPC call to Set the rates
 * @param packageID
 * @param attributeID
 * @param value
 */
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);
}
}
);
}

Fixed version (ground truth):
/** 
 * Contains RPC call to Set the rates
 * @param packageID
 * @param attributeID
 * @param value
 */
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);
drawRateMatrix();
}
}
);
}
Program: 24812
Project: 24812
Buggy source:
public void removeSoftwarePackage(GwtSoftwarePackage current){
  this.service.removeSoftwarePackage(current,currentProject,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){
loadAttributes();
}
}
);
}

Fixed version (ground truth):
public void removeSoftwarePackage(GwtSoftwarePackage current){
  this.service.removeSoftwarePackage(current,currentProject,new AsyncCallback<Void>(){
    public void onFailure(    Throwable caught){
      if (caught instanceof SquareException) {
        SquareException se=(SquareException)caught;
switch (se.getType()) {
case authorization:
          Window.alert(messages.SPAuthorization());
        break;
default :
      Window.alert(messages.error());
    break;
}
}
 else {
Window.alert(messages.error());
}
}
public void onSuccess(Void result){
loadAttributes();
}
}
);
}
Program: 24813
Project: 24813
Buggy source:
public void removeQualityAttribute(GwtQualityAttribute current){
  this.service.removeQualityAttribute(current,currentProject,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){
loadAttributes();
}
}
);
}

Fixed version (ground truth):
public void removeQualityAttribute(GwtQualityAttribute current){
  this.service.removeQualityAttribute(current,currentProject,new AsyncCallback<Void>(){
    public void onFailure(    Throwable caught){
      if (caught instanceof SquareException) {
        SquareException se=(SquareException)caught;
switch (se.getType()) {
case authorization:
          Window.alert(messages.QAAuthorization());
        break;
default :
      Window.alert(messages.error());
    break;
}
}
 else {
Window.alert(messages.error());
}
}
public void onSuccess(Void result){
loadAttributes();
}
}
);
}
Program: 24814
Project: 24814
Buggy source:
public void onChange(ChangeEvent event){
  if (rateValueTextbox.getText().trim().length() == 0) {
    rateValueTextbox.setText("String_Node_Str");
  }
  char keyCode;
  if (rateValueTextbox.getText().trim().length() == 1) {
    keyCode=rateValueTextbox.getText().trim().charAt(0);
    if (keyCode >= '0' && keyCode <= '3') {
      getTotalsFromMatrix();
      setRateValue(rateValueTextbox.getTecniqueID(),rateValueTextbox.getEvaluationID(),Integer.parseInt(rateValueTextbox.getText()));
      rateValueTextbox.setOldValue(rateValueTextbox.getText());
    }
 else {
      rateValueTextbox.setText(rateValueTextbox.getOldValue());
    }
  }
 else {
    rateValueTextbox.setText(rateValueTextbox.getOldValue());
  }
}

Fixed version (ground truth):
public void onChange(ChangeEvent event){
  if (rateValueTextbox.getText().trim().length() == 0) {
    rateValueTextbox.setText("String_Node_Str");
  }
  char keyCode;
  if (rateValueTextbox.getText().trim().length() == 1) {
    keyCode=rateValueTextbox.getText().trim().charAt(0);
    if (keyCode >= '0' && keyCode <= '3') {
      getTotalsFromMatrix();
      setRateValue(rateValueTextbox.getPackageID(),rateValueTextbox.getAttributeID(),Integer.parseInt(rateValueTextbox.getText()));
      rateValueTextbox.setOldValue(rateValueTextbox.getText());
    }
 else {
      rateValueTextbox.setText(rateValueTextbox.getOldValue());
    }
  }
 else {
    rateValueTextbox.setText(rateValueTextbox.getOldValue());
  }
}
Program: 24815
Project: 24815
Buggy source:
private void addSPtoDB(GwtSoftwarePackage qa){
  this.service.addSoftwarePackage(currentProject,qa,new AsyncCallback<GwtSoftwarePackage>(){
    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(GwtSoftwarePackage result){
loadAttributes();
}
}
);
}

Fixed version (ground truth):
private void addSPtoDB(GwtSoftwarePackage qa){
  this.service.addSoftwarePackage(currentProject,qa,new AsyncCallback<GwtSoftwarePackage>(){
    public void onFailure(    Throwable caught){
      if (caught instanceof SquareException) {
        SquareException se=(SquareException)caught;
switch (se.getType()) {
case authorization:
          Window.alert(messages.SPAuthorization());
        break;
default :
      Window.alert(messages.error());
    break;
}
}
 else {
Window.alert(messages.error());
}
}
public void onSuccess(GwtSoftwarePackage result){
loadAttributes();
}
}
);
}
Program: 24817
Project: 24817
Buggy source:
protected void updateSPinDB(GwtSoftwarePackage gwtSoftwarePackage){
  this.service.updateSoftwarePackage(gwtSoftwarePackage,currentProject,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){
loadAttributes();
}
}
);
}

Fixed version (ground truth):
protected void updateSPinDB(GwtSoftwarePackage gwtSoftwarePackage){
  this.service.updateSoftwarePackage(gwtSoftwarePackage,currentProject,new AsyncCallback<Void>(){
    public void onFailure(    Throwable caught){
      if (caught instanceof SquareException) {
        SquareException se=(SquareException)caught;
switch (se.getType()) {
case authorization:
          Window.alert(messages.SPAuthorization());
        break;
default :
      Window.alert(messages.error());
    break;
}
}
 else {
Window.alert(messages.error());
}
}
public void onSuccess(Void result){
loadAttributes();
}
}
);
}
Program: 24818
Project: 24818
Buggy source:
private void addQAtoDB(GwtQualityAttribute qa){
  this.service.addQualityAttribute(currentProject,qa,new AsyncCallback<GwtQualityAttribute>(){
    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(GwtQualityAttribute result){
loadAttributes();
}
}
);
}

Fixed version (ground truth):
private void addQAtoDB(GwtQualityAttribute qa){
  this.service.addQualityAttribute(currentProject,qa,new AsyncCallback<GwtQualityAttribute>(){
    public void onFailure(    Throwable caught){
      if (caught instanceof SquareException) {
        SquareException se=(SquareException)caught;
switch (se.getType()) {
case authorization:
          Window.alert(messages.QAAuthorization());
        break;
default :
      Window.alert(messages.error());
    break;
}
}
 else {
Window.alert(messages.error());
}
}
public void onSuccess(GwtQualityAttribute result){
loadAttributes();
}
}
);
}
Program: 24820
Project: 24820
Buggy source:
public void determineAccessRights(String page,State currentState){
  if (currentState.getUserProjectRole() == ProjectRole.Acquisition_Organization_Engineer) {
    currentState.setMode(GwtModesType.ReadWrite);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.Contractor) {
    currentState.setMode(GwtModesType.ReadOnly);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.Security_Specialist) {
    currentState.setMode(GwtModesType.NoAccess);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.COTS_Vendor) {
    currentState.setMode(GwtModesType.NoAccess);
  }
 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.ReadWrite);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.Contractor) {
    currentState.setMode(GwtModesType.ReadOnly);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.Security_Specialist) {
    currentState.setMode(GwtModesType.NoAccess);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.COTS_Vendor) {
    currentState.setMode(GwtModesType.NoAccess);
  }
 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: 24821
Project: 24821
Buggy source:
public void determineAccessRights(String page,State currentState){
  if (currentState.getUserProjectRole() == ProjectRole.Acquisition_Organization_Engineer) {
    currentState.setMode(GwtModesType.ReadOnly);
  }
 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.ReadOnly);
  }
 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: 24822
Project: 24822
Buggy source:
public void determineAccessRights(String page,State currentState){
  if (currentState.getUserProjectRole() == ProjectRole.Acquisition_Organization_Engineer) {
    currentState.setMode(GwtModesType.ReadWrite);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.Contractor) {
    currentState.setMode(GwtModesType.NoAccess);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.Security_Specialist) {
    currentState.setMode(GwtModesType.NoAccess);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.COTS_Vendor) {
    currentState.setMode(GwtModesType.ReadOnly);
  }
 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.ReadWrite);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.Contractor) {
    currentState.setMode(GwtModesType.NoAccess);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.Security_Specialist) {
    currentState.setMode(GwtModesType.NoAccess);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.COTS_Vendor) {
    currentState.setMode(GwtModesType.ReadOnly);
  }
 else   if (currentState.getUserProjectRole() == ProjectRole.Administrator) {
    currentState.setMode(GwtModesType.ReadWrite);
  }
 else {
    currentState.setMode(GwtModesType.ReadOnly);
  }
}