nus-yam/ex-repair huggingface dataset:
Program: 35640
Project: 35640
Buggy source:
@Override public void onClick(ClickEvent event){
  UpdateProjectFavorite updateCmd;
  int projectId=model.getId();
  if (projectId < 0)   projectId=model.get("String_Node_Str");
  if (isFavoriteProject(authentication.getUserId(),model)) {
    updateCmd=new UpdateProjectFavorite(projectId,UpdateProjectFavorite.UpdateType.REMOVE);
  }
 else {
    updateCmd=new UpdateProjectFavorite(projectId,UpdateProjectFavorite.UpdateType.ADD);
  }
  dispatcher.execute(updateCmd,new MaskingAsyncMonitor(projectTreePanel,I18N.CONSTANTS.loading()),new AsyncCallback<CreateResult>(){
    @Override public void onFailure(    Throwable caught){
      Log.error("String_Node_Str" + model.getId(),caught);
      MessageBox.alert(I18N.CONSTANTS.projectStarredError(),I18N.CONSTANTS.projectStarredErrorDetails(),null);
    }
    @Override public void onSuccess(    CreateResult result){
      if (result == null || result.getEntity() == null) {
        MessageBox.alert(I18N.CONSTANTS.projectStarredError(),I18N.CONSTANTS.projectStarredErrorDetails(),null);
      }
 else {
        ProjectDTOLight resultProject=(ProjectDTOLight)result.getEntity();
        model.setFavoriteUsers(resultProject.getFavoriteUsers());
        store.update(model);
        Notification.show(I18N.CONSTANTS.infoConfirmation(),I18N.CONSTANTS.projectStarred());
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void onClick(ClickEvent event){
  UpdateProjectFavorite updateCmd;
  int projectId=model.getId();
  if (projectId < 0) {
    projectId=(Integer)model.get("String_Node_Str");
  }
  if (isFavoriteProject(authentication.getUserId(),model)) {
    updateCmd=new UpdateProjectFavorite(projectId,UpdateProjectFavorite.UpdateType.REMOVE);
  }
 else {
    updateCmd=new UpdateProjectFavorite(projectId,UpdateProjectFavorite.UpdateType.ADD);
  }
  dispatcher.execute(updateCmd,new MaskingAsyncMonitor(projectTreePanel,I18N.CONSTANTS.loading()),new AsyncCallback<CreateResult>(){
    @Override public void onFailure(    Throwable caught){
      Log.error("String_Node_Str" + model.getId(),caught);
      MessageBox.alert(I18N.CONSTANTS.projectStarredError(),I18N.CONSTANTS.projectStarredErrorDetails(),null);
    }
    @Override public void onSuccess(    CreateResult result){
      if (result == null || result.getEntity() == null) {
        MessageBox.alert(I18N.CONSTANTS.projectStarredError(),I18N.CONSTANTS.projectStarredErrorDetails(),null);
      }
 else {
        ProjectDTOLight resultProject=(ProjectDTOLight)result.getEntity();
        model.setFavoriteUsers(resultProject.getFavoriteUsers());
        store.update(model);
        Notification.show(I18N.CONSTANTS.infoConfirmation(),I18N.CONSTANTS.projectStarred());
      }
    }
  }
);
}
Program: 35645
Project: 35645
Buggy source:
@Override public Object render(final OrgUnitDTOLight model,String property,ColumnData config,int rowIndex,int colIndex,ListStore<OrgUnitDTOLight> store,Grid<OrgUnitDTOLight> grid){
  final CountryDTO country=(CountryDTO)model.get(property);
  if (country == null) {
    return "String_Node_Str";
  }
 else {
    return country.getName() + "String_Node_Str" + country.getCodeISO()+ ')';
  }
}

Fixed version (ground truth):
@Override public Object render(OrgUnitDTOLight model,String property,ColumnData config,int rowIndex,int colIndex,ListStore<OrgUnitDTOLight> store,Grid<OrgUnitDTOLight> grid){
  final OrgUnitModelDTO orgUnitModel=(OrgUnitModelDTO)model.get(property);
  if (orgUnitModel == null) {
    return "String_Node_Str";
  }
 else {
    return orgUnitModel.getName();
  }
}
Program: 35646
Project: 35646
Buggy source:
private OrgUnitDTOLight light(OrgUnitDTOLight parent){
  final OrgUnitDTOLight light=new OrgUnitDTOLight();
  light.setId(getId());
  light.setName(getName());
  light.setFullName(getFullName());
  light.setTitle(getOrgUnitModel().getTitle());
  light.setCanContainProjects(getOrgUnitModel().getCanContainProjects());
  light.generateCompleteName();
  light.setParentDTO(parent);
  light.setOfficeLocationCountry(getOfficeLocationCountry());
  final HashSet<OrgUnitDTOLight> children=new HashSet<OrgUnitDTOLight>();
  for (  final OrgUnitDTO c : getChildren()) {
    children.add(c.light(light));
  }
  light.setChildrenDTO(children);
  light.setDeleted(getDeleted());
  return light;
}

Fixed version (ground truth):
private OrgUnitDTOLight light(OrgUnitDTOLight parent){
  final OrgUnitDTOLight light=new OrgUnitDTOLight();
  light.setId(getId());
  light.setName(getName());
  light.setFullName(getFullName());
  light.setTitle(getOrgUnitModel().getTitle());
  light.setCanContainProjects(getOrgUnitModel().getCanContainProjects());
  light.generateCompleteName();
  light.setParentDTO(parent);
  light.setOfficeLocationCountry(getOfficeLocationCountry());
  final HashSet<OrgUnitDTOLight> children=new HashSet<OrgUnitDTOLight>();
  for (  final OrgUnitDTO c : getChildren()) {
    children.add(c.light(light));
  }
  light.setChildrenDTO(children);
  light.setDeleted(getDeleted());
  light.setOrgUnitModel(getOrgUnitModel());
  return light;
}
Program: 35648
Project: 35648
Buggy source:
/** 
 * Builds the actions toolbar.
 * @return The actions toolbar.
 */
private ToolBar buildToolbar(){
  saveButton=new Button(I18N.CONSTANTS.save(),IconImageBundle.ICONS.save());
  saveButton.setEnabled(false);
  copyButton=new Button(I18N.CONSTANTS.copy());
  copyButton.setEnabled(true);
  pasteButton=new Button(I18N.CONSTANTS.paste());
  pasteButton.setEnabled(false);
  excelButton=new Button(I18N.CONSTANTS.exportToExcel(),IconImageBundle.ICONS.excel());
  excelButton.hide();
  excelForm=new FormPanel();
  excelForm.setBodyBorder(false);
  excelForm.setHeaderVisible(false);
  excelForm.setPadding(0);
  excelForm.setEncoding(Encoding.URLENCODED);
  excelForm.setMethod(Method.POST);
  excelForm.setAction(GWT.getModuleBaseURL() + "String_Node_Str");
  final ToolBar toolBar=new ToolBar();
  toolBar.setAlignment(HorizontalAlignment.RIGHT);
  toolBar.setBorders(false);
  toolBar.add(saveButton);
  toolBar.add(copyButton);
  toolBar.add(pasteButton);
  toolBar.add(new SeparatorToolItem());
  toolBar.add(excelButton);
  toolBar.add(excelForm);
  return toolBar;
}

Fixed version (ground truth):
/** 
 * Builds the actions toolbar.
 * @return The actions toolbar.
 */
private ToolBar buildToolbar(){
  saveButton=new Button(I18N.CONSTANTS.save(),IconImageBundle.ICONS.save());
  saveButton.setEnabled(false);
  copyButton=new Button(I18N.CONSTANTS.copy());
  copyButton.setEnabled(true);
  pasteButton=new Button(I18N.CONSTANTS.paste());
  pasteButton.setEnabled(false);
  excelButton=new Button(I18N.CONSTANTS.exportToExcel(),IconImageBundle.ICONS.excel());
  excelButton.hide();
  excelForm=new FormPanel();
  excelForm.setBodyBorder(false);
  excelForm.setHeaderVisible(false);
  excelForm.setPadding(0);
  excelForm.setEncoding(Encoding.URLENCODED);
  excelForm.setMethod(Method.POST);
  excelForm.setAction(GWT.getModuleBaseURL() + "String_Node_Str");
  final ToolBar toolBar=new ToolBar();
  toolBar.setAlignment(HorizontalAlignment.LEFT);
  toolBar.setBorders(false);
  toolBar.add(saveButton);
  toolBar.add(copyButton);
  toolBar.add(pasteButton);
  toolBar.add(new SeparatorToolItem());
  toolBar.add(excelButton);
  toolBar.add(excelForm);
  return toolBar;
}
Program: 35649
Project: 35649
Buggy source:
@Override public void update(User user,Object entity,PropertyMap changes){
  OrgUnitModel model=null;
  if (orgUnitModel != null) {
    model=em.find(OrgUnitModel.class,new Integer(orgUnitModel.getId()));
  }
  if (model != null) {
    if (changes.get(AdminUtil.PROP_OM_NAME) != null) {
      model=createOrgUnitModel(model,changes,user);
      model=em.merge(model);
    }
    if (changes.get(AdminUtil.PROP_FX_FLEXIBLE_ELEMENT) != null) {
      ModelUtil.persistFlexibleElement(em,mapper,changes,model);
      modelToUpdate=em.find(OrgUnitModel.class,model.getId());
    }
  }
}

Fixed version (ground truth):
@Override public void update(User user,Object entity,PropertyMap changes){
  OrgUnitModel model=null;
  if (orgUnitModel != null) {
    model=em.find(OrgUnitModel.class,new Integer(orgUnitModel.getId()));
  }
  if (model != null) {
    if (changes.get(AdminUtil.PROP_OM_NAME) != null) {
      model=createOrgUnitModel(model,changes,user);
      model=em.merge(model);
      modelToUpdate=em.find(OrgUnitModel.class,model.getId());
    }
    if (changes.get(AdminUtil.PROP_FX_FLEXIBLE_ELEMENT) != null) {
      ModelUtil.persistFlexibleElement(em,mapper,changes,model);
      modelToUpdate=em.find(OrgUnitModel.class,model.getId());
    }
  }
}
Program: 35650
Project: 35650
Buggy source:
protected void onDeleteConfirmed(final List<FlexibleElementDTO> selection){
  String notDeletableNames="String_Node_Str";
  List<Integer> ids=new ArrayList<Integer>();
  String names="String_Node_Str";
  for (  FlexibleElementDTO s : selection) {
    ids.add(s.getId());
    names=s.getLabel() + "String_Node_Str" + names;
    if (s instanceof DefaultFlexibleElementDTO) {
      notDeletableNames+=DefaultFlexibleElementType.getName(((DefaultFlexibleElementDTO)s).getType()).replace("String_Node_Str","String_Node_Str") + "String_Node_Str";
    }
  }
  if ("String_Node_Str".equals(notDeletableNames)) {
    final String toDelete=names;
    final DeleteFlexibleElements delete=new DeleteFlexibleElements(selection);
    dispatcher.execute(delete,null,new AsyncCallback<VoidResult>(){
      @Override public void onFailure(      Throwable caught){
        MessageBox.alert(I18N.CONSTANTS.error(),I18N.MESSAGES.entityDeleteEventError(toDelete),null);
      }
      @Override public void onSuccess(      VoidResult result){
        for (        FlexibleElementDTO s : selection) {
          view.getFieldsStore().remove(s);
        }
      }
    }
);
  }
 else {
    notDeletableNames=notDeletableNames.substring(0,notDeletableNames.lastIndexOf("String_Node_Str"));
    MessageBox.alert(I18N.CONSTANTS.error(),I18N.MESSAGES.adminErrorDeleteDefaultFlexible(notDeletableNames),null);
  }
}

Fixed version (ground truth):
protected void onDeleteConfirmed(final List<FlexibleElementDTO> selection){
  String notDeletableNames="String_Node_Str";
  List<Integer> ids=new ArrayList<Integer>();
  String names="String_Node_Str";
  for (  FlexibleElementDTO s : selection) {
    ids.add(s.getId());
    names=s.getLabel() + "String_Node_Str" + names;
    if (s instanceof DefaultFlexibleElementDTO) {
      notDeletableNames+=DefaultFlexibleElementType.getName(((DefaultFlexibleElementDTO)s).getType()) + "String_Node_Str";
    }
  }
  if ("String_Node_Str".equals(notDeletableNames)) {
    final String toDelete=names;
    final DeleteFlexibleElements delete=new DeleteFlexibleElements(selection);
    dispatcher.execute(delete,null,new AsyncCallback<VoidResult>(){
      @Override public void onFailure(      Throwable caught){
        MessageBox.alert(I18N.CONSTANTS.error(),I18N.MESSAGES.entityDeleteEventError(toDelete),null);
      }
      @Override public void onSuccess(      VoidResult result){
        for (        FlexibleElementDTO s : selection) {
          view.getFieldsStore().remove(s);
        }
      }
    }
);
  }
 else {
    notDeletableNames=notDeletableNames.substring(0,notDeletableNames.lastIndexOf("String_Node_Str"));
    MessageBox.alert(I18N.CONSTANTS.error(),I18N.MESSAGES.adminErrorDeleteDefaultFlexible(notDeletableNames),null);
  }
}
Program: 35656
Project: 35656
Buggy source:
/** 
 * Builds the actions toolbar.
 * @return The actions toolbar.
 */
private ToolBar buildToolbar(){
  saveButton=new Button(I18N.CONSTANTS.save(),IconImageBundle.ICONS.save());
  saveButton.setEnabled(false);
  copyButton=new Button(I18N.CONSTANTS.copy());
  copyButton.setEnabled(true);
  pasteButton=new Button(I18N.CONSTANTS.paste());
  pasteButton.setEnabled(false);
  excelButton=new Button(I18N.CONSTANTS.exportToExcel(),IconImageBundle.ICONS.excel());
  excelButton.hide();
  excelForm=new FormPanel();
  excelForm.setBodyBorder(false);
  excelForm.setHeaderVisible(false);
  excelForm.setPadding(0);
  excelForm.setEncoding(Encoding.URLENCODED);
  excelForm.setMethod(Method.POST);
  excelForm.setAction(GWT.getModuleBaseURL() + "String_Node_Str");
  final ToolBar toolBar=new ToolBar();
  toolBar.setAlignment(HorizontalAlignment.LEFT);
  toolBar.setBorders(false);
  toolBar.add(saveButton);
  toolBar.add(copyButton);
  toolBar.add(pasteButton);
  toolBar.add(new SeparatorToolItem());
  toolBar.add(excelButton);
  toolBar.add(excelForm);
  return toolBar;
}

Fixed version (ground truth):
/** 
 * Builds the actions toolbar.
 * @return The actions toolbar.
 */
private ToolBar buildToolbar(){
  saveButton=new Button(I18N.CONSTANTS.save(),IconImageBundle.ICONS.save());
  saveButton.setEnabled(false);
  copyButton=new Button(I18N.CONSTANTS.copy());
  copyButton.setEnabled(true);
  pasteButton=new Button(I18N.CONSTANTS.paste());
  pasteButton.setEnabled(false);
  excelButton=new Button(I18N.CONSTANTS.exportToExcel(),IconImageBundle.ICONS.excel());
  excelButton.hide();
  excelForm=new FormPanel();
  excelForm.setBodyBorder(false);
  excelForm.setHeaderVisible(false);
  excelForm.setPadding(0);
  excelForm.setEncoding(Encoding.URLENCODED);
  excelForm.setMethod(Method.POST);
  excelForm.setAction(GWT.getModuleBaseURL() + "String_Node_Str");
  final ToolBar toolBar=new ToolBar();
  toolBar.setBorders(false);
  toolBar.add(saveButton);
  toolBar.add(new FillToolItem());
  toolBar.add(copyButton);
  toolBar.add(pasteButton);
  toolBar.add(new SeparatorToolItem());
  toolBar.add(excelButton);
  toolBar.add(excelForm);
  return toolBar;
}
Program: 35662
Project: 35662
Buggy source:
/** 
 * Fills combobox with the children of the given root org units.
 * @param root The root org unit.
 */
private void fillOrgUnitsList(OrgUnitDTOLight root){
  for (  final OrgUnitDTOLight child : root.getChildrenDTO()) {
    recursiveFillOrgUnitsList(child);
  }
}

Fixed version (ground truth):
/** 
 * Fills combobox with the children of the given root org units.
 * @param root The root org unit.
 */
private void fillOrgUnitsList(OrgUnitDTOLight root){
  orgUnitsStore.add(root);
  for (  final OrgUnitDTOLight child : root.getChildrenDTO()) {
    recursiveFillOrgUnitsList(child);
  }
}
Program: 35663
Project: 35663
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public Object create(User executingUser,PropertyMap properties){
  LayoutGroup groupToPersist=null;
  LayoutGroupDTO layoutGroupDTOToPersist=(LayoutGroupDTO)properties.get(AdminUtil.PROP_NEW_GROUP_LAYOUT);
  ProjectModelDTO projectModelDTO=(ProjectModelDTO)properties.get(AdminUtil.ADMIN_PROJECT_MODEL);
  OrgUnitModelDTO orgUnitModelDTO=(OrgUnitModelDTO)properties.get(AdminUtil.ADMIN_ORG_UNIT_MODEL);
  groupToPersist=mapper.map(layoutGroupDTOToPersist,LayoutGroup.class);
  if (layoutGroupDTOToPersist.getId() > 0) {
    groupToPersist=em.merge(groupToPersist);
  }
 else {
    if (groupToPersist != null) {
      groupToPersist.setId(null);
      em.persist(groupToPersist);
    }
  }
  LayoutGroupDTO groupPersisted=null;
  if (groupToPersist != null) {
    groupPersisted=mapper.map(groupToPersist,LayoutGroupDTO.class);
  }
  return groupPersisted;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public Object create(User executingUser,PropertyMap properties){
  LayoutGroup groupToPersist=null;
  LayoutGroupDTO layoutGroupDTOToPersist=(LayoutGroupDTO)properties.get(AdminUtil.PROP_NEW_GROUP_LAYOUT);
  ProjectModelDTO projectModelDTO=(ProjectModelDTO)properties.get(AdminUtil.ADMIN_PROJECT_MODEL);
  OrgUnitModelDTO orgUnitModelDTO=(OrgUnitModelDTO)properties.get(AdminUtil.ADMIN_ORG_UNIT_MODEL);
  groupToPersist=mapper.map(layoutGroupDTOToPersist,LayoutGroup.class);
  if (groupToPersist.getParentLayout().getRowsCount() <= groupToPersist.getRow()) {
    Layout layout=groupToPersist.getParentLayout();
    layout.setRowsCount(groupToPersist.getRow() + 1);
    em.merge(layout);
  }
  if (layoutGroupDTOToPersist.getId() > 0) {
    groupToPersist=em.merge(groupToPersist);
  }
 else {
    if (groupToPersist != null) {
      groupToPersist.setId(null);
      em.persist(groupToPersist);
    }
  }
  LayoutGroupDTO groupPersisted=null;
  if (groupToPersist != null) {
    groupPersisted=mapper.map(groupToPersist,LayoutGroupDTO.class);
  }
  return groupPersisted;
}
Program: 35668
Project: 35668
Buggy source:
@Override public int getOrgUnitId(){
  return (Integer)get("String_Node_Str");
}

Fixed version (ground truth):
@Override public int getOrgUnitId(){
  Integer value=(Integer)get("String_Node_Str");
  if (value != null)   return value.intValue();
 else   return -1;
}
Program: 35669
Project: 35669
Buggy source:
private void showSpecificAttributes(String type,FlexibleElementDTO flexibleElement,boolean onSelectAction){
  initSpecifics(flexibleElement);
  if (ElementTypeEnum.getName(ElementTypeEnum.CHECKBOX).equals(type)) {
  }
 else   if (ElementTypeEnum.getName(ElementTypeEnum.FILES_LIST).equals(type)) {
    if (onSelectAction) {
      maxLimitField.clear();
    }
    maxLimitField.show();
    specificsPanel.show();
  }
 else   if (ElementTypeEnum.getName(ElementTypeEnum.INDICATORS).equals(type)) {
  }
 else   if (ElementTypeEnum.getName(ElementTypeEnum.MESSAGE).equals(type)) {
  }
 else   if (ElementTypeEnum.getName(ElementTypeEnum.QUESTION).equals(type)) {
    linkedCategory.show();
    isMultipleQ.show();
    questionChoice.show();
    addChoiceButton.show();
    for (    ClickableLabel selected : selectableChoices.values()) {
      if (selected.getText() != null) {
        selected.show();
      }
    }
    qChoicesAddGrid.setVisible(true);
    specificsPanel.show();
  }
 else   if (ElementTypeEnum.getName(ElementTypeEnum.REPORT).equals(type) || ElementTypeEnum.getName(ElementTypeEnum.REPORT_LIST).equals(type)) {
    reportModelList.show();
    specificsPanel.show();
  }
 else   if (ElementTypeEnum.getName(ElementTypeEnum.TEXT_AREA).equals(type)) {
    if (onSelectAction) {
      maxLimitField.clear();
    }
    textAreaTypeList.show();
    lengthField.show();
    isDecimal.show();
    minLimitField.show();
    maxLimitField.show();
    specificsPanel.show();
  }
}

Fixed version (ground truth):
private void showSpecificAttributes(String type,FlexibleElementDTO flexibleElement,boolean onSelectAction){
  initSpecifics(flexibleElement);
  if (ElementTypeEnum.getName(ElementTypeEnum.DEFAULT).equals(type)) {
    isBanner.show();
    posBanner.show();
    specificsPanel.show();
  }
 else   if (ElementTypeEnum.getName(ElementTypeEnum.CHECKBOX).equals(type)) {
  }
 else   if (ElementTypeEnum.getName(ElementTypeEnum.FILES_LIST).equals(type)) {
    if (onSelectAction) {
      maxLimitField.clear();
    }
    maxLimitField.show();
    specificsPanel.show();
  }
 else   if (ElementTypeEnum.getName(ElementTypeEnum.INDICATORS).equals(type)) {
  }
 else   if (ElementTypeEnum.getName(ElementTypeEnum.MESSAGE).equals(type)) {
  }
 else   if (ElementTypeEnum.getName(ElementTypeEnum.QUESTION).equals(type)) {
    linkedCategory.show();
    isMultipleQ.show();
    questionChoice.show();
    addChoiceButton.show();
    for (    ClickableLabel selected : selectableChoices.values()) {
      if (selected.getText() != null) {
        selected.show();
      }
    }
    qChoicesAddGrid.setVisible(true);
    specificsPanel.show();
  }
 else   if (ElementTypeEnum.getName(ElementTypeEnum.REPORT).equals(type) || ElementTypeEnum.getName(ElementTypeEnum.REPORT_LIST).equals(type)) {
    reportModelList.show();
    specificsPanel.show();
  }
 else   if (ElementTypeEnum.getName(ElementTypeEnum.TEXT_AREA).equals(type)) {
    if (onSelectAction) {
      maxLimitField.clear();
    }
    textAreaTypeList.show();
    lengthField.show();
    isDecimal.show();
    minLimitField.show();
    maxLimitField.show();
    specificsPanel.show();
  }
}
Program: 35670
Project: 35670
Buggy source:
private void hideAllSpecificAttributes(){
  linkedCategory.hide();
  isLinkedToQuality.hide();
  isMultipleQ.hide();
  questionChoice.hide();
  addChoiceButton.hide();
  for (  ClickableLabel selected : selectableChoices.values()) {
    selected.hide();
  }
  qChoicesAddGrid.setVisible(false);
  textAreaTypeList.hide();
  maxLimitField.hide();
  minLimitField.hide();
  lengthField.hide();
  isDecimal.hide();
  reportModelList.hide();
  specificsPanel.hide();
}

Fixed version (ground truth):
private void hideAllSpecificAttributes(){
  linkedCategory.hide();
  isLinkedToQuality.hide();
  isMultipleQ.hide();
  questionChoice.hide();
  addChoiceButton.hide();
  for (  ClickableLabel selected : selectableChoices.values()) {
    selected.hide();
  }
  qChoicesAddGrid.setVisible(false);
  textAreaTypeList.hide();
  maxLimitField.hide();
  minLimitField.hide();
  lengthField.hide();
  isDecimal.hide();
  reportModelList.hide();
  isBanner.hide();
  posBanner.hide();
  specificsPanel.hide();
}
Program: 35675
Project: 35675
Buggy source:
private static void changePositionInBanner(EntityManager em,Integer posB,Object model,FlexibleElement flexibleElt,LayoutConstraint oldBannerLayoutConstraint){
  LayoutGroup bannerGroup=null;
  if (model instanceof ProjectModel)   bannerGroup=((ProjectModel)model).getProjectBanner().getLayout().getGroups().get(posB);
 else   if (model instanceof OrgUnitModel)   bannerGroup=((OrgUnitModel)model).getBanner().getLayout().getGroups().get(posB);
  for (  LayoutConstraint lc : bannerGroup.getConstraints()) {
    em.remove(lc);
  }
  oldBannerLayoutConstraint.setElement(flexibleElt);
  oldBannerLayoutConstraint.setParentLayoutGroup(bannerGroup);
  oldBannerLayoutConstraint.setSortOrder(new Integer(posB));
  em.merge(oldBannerLayoutConstraint);
}

Fixed version (ground truth):
private static void changePositionInBanner(EntityManager em,Integer posB,Object model,FlexibleElement flexibleElt,LayoutConstraint oldBannerLayoutConstraint){
  LayoutGroup bannerGroup=null;
  if (model instanceof ProjectModel)   bannerGroup=((ProjectModel)model).getProjectBanner().getLayout().getGroups().get(posB);
 else   if (model instanceof OrgUnitModel)   bannerGroup=((OrgUnitModel)model).getBanner().getLayout().getGroups().get(posB);
  for (  LayoutConstraint lc : bannerGroup.getConstraints()) {
    em.remove(lc);
  }
  oldBannerLayoutConstraint.setElement(flexibleElt);
  oldBannerLayoutConstraint.setParentLayoutGroup(bannerGroup);
  oldBannerLayoutConstraint.setSortOrder(new Integer(posB + 1));
  em.merge(oldBannerLayoutConstraint);
}
Program: 35676
Project: 35676
Buggy source:
private static void changeBanner(EntityManager em,Integer posB,Object model,FlexibleElement flexibleElt){
  LayoutGroup bannerGroup=null;
  if (model instanceof ProjectModel)   bannerGroup=((ProjectModel)model).getProjectBanner().getLayout().getGroups().get(posB);
 else   if (model instanceof OrgUnitModel)   bannerGroup=((OrgUnitModel)model).getBanner().getLayout().getGroups().get(posB);
  LayoutConstraint newLayoutConstraint=null;
  boolean positionTaken=false;
  for (  LayoutConstraint lc : bannerGroup.getConstraints()) {
    if (posB.equals(lc.getSortOrder())) {
      positionTaken=true;
      newLayoutConstraint=lc;
      lc.setElement(flexibleElt);
      newLayoutConstraint=em.merge(lc);
    }
  }
  if (!positionTaken) {
    newLayoutConstraint=new LayoutConstraint();
    newLayoutConstraint.setElement(flexibleElt);
    newLayoutConstraint.setParentLayoutGroup(bannerGroup);
    newLayoutConstraint.setSortOrder(new Integer(posB));
    em.persist(newLayoutConstraint);
  }
}

Fixed version (ground truth):
private static void changeBanner(EntityManager em,Integer posB,Object model,FlexibleElement flexibleElt){
  LayoutGroup bannerGroup=null;
  if (model instanceof ProjectModel)   bannerGroup=((ProjectModel)model).getProjectBanner().getLayout().getGroups().get(posB);
 else   if (model instanceof OrgUnitModel)   bannerGroup=((OrgUnitModel)model).getBanner().getLayout().getGroups().get(posB);
  LayoutConstraint newLayoutConstraint=null;
  boolean positionTaken=false;
  for (  LayoutConstraint lc : bannerGroup.getConstraints()) {
    if (posB.equals(lc.getSortOrder())) {
      positionTaken=true;
      newLayoutConstraint=lc;
      lc.setElement(flexibleElt);
      newLayoutConstraint=em.merge(lc);
    }
  }
  if (!positionTaken) {
    newLayoutConstraint=new LayoutConstraint();
    newLayoutConstraint.setElement(flexibleElt);
    newLayoutConstraint.setParentLayoutGroup(bannerGroup);
    newLayoutConstraint.setSortOrder(new Integer(posB + 1));
    em.persist(newLayoutConstraint);
  }
}
Program: 35681
Project: 35681
Buggy source:
@Override public void onSuccess(UpdateModelResult result){
  if (!isUpdate) {
    window.hide();
    AdminFlexibleElementsView.this.getFieldsStore().add((FlexibleElementDTO)result.getAnnexEntity());
    AdminFlexibleElementsView.this.getFieldsStore().commitChanges();
  }
 else {
    window.hide();
    if (projectModel != null) {
      ProjectModelDTO modelUpdated=(ProjectModelDTO)result.getEntity();
      AdminFlexibleElementsView.this.setProjectModel(modelUpdated);
    }
 else {
      OrgUnitModelDTO modelUpdated=(OrgUnitModelDTO)result.getEntity();
      AdminFlexibleElementsView.this.setOrgUnitModel(modelUpdated);
    }
    AdminFlexibleElementsView.this.getFieldsStore().remove(model);
    AdminFlexibleElementsView.this.getFieldsStore().add((FlexibleElementDTO)result.getAnnexEntity());
    AdminFlexibleElementsView.this.getFieldsStore().commitChanges();
  }
}

Fixed version (ground truth):
@Override public void onSuccess(UpdateModelResult result){
  if (!isUpdate) {
    window.hide();
    AdminFlexibleElementsView.this.getFieldsStore().add((FlexibleElementDTO)result.getAnnexEntity());
    AdminFlexibleElementsView.this.getFieldsStore().commitChanges();
  }
 else {
    window.hide();
    if (projectModel != null) {
      ProjectModelDTO modelUpdated=(ProjectModelDTO)result.getEntity();
      AdminFlexibleElementsView.this.refreshProjectModel(modelUpdated);
    }
 else {
      OrgUnitModelDTO modelUpdated=(OrgUnitModelDTO)result.getEntity();
      AdminFlexibleElementsView.this.refreshOrgUnitModel(modelUpdated);
    }
    AdminFlexibleElementsView.this.getFieldsStore().remove(model);
    AdminFlexibleElementsView.this.getFieldsStore().add((FlexibleElementDTO)result.getAnnexEntity());
    AdminFlexibleElementsView.this.getFieldsStore().commitChanges();
  }
}
Program: 35682
Project: 35682
Buggy source:
/** 
 * Displays the log frame content in the log frame grid (specific objectives, expected results, prerequisites, activities);
 * @param table The log frame grid.
 * @param enabled If the log frame is read only or not.
 * @param logFrame The log frame.
 */
public void displayLogFrame(int databaseId,LogFrameDTO logFrame,boolean enabled){
  this.logFrame=logFrame;
  this.databaseId=databaseId;
  this.logFrameModel=logFrame.getLogFrameModel();
  this.readOnly=!enabled;
  ensureLogFrame();
  resetTable();
  initTable();
  initCodePolicies();
  for (  final LogFrameGroupDTO group : logFrame.getGroups()) {
switch (group.getType()) {
case SPECIFIC_OBJECTIVE:
      if (logFrameModel.getEnableSpecificObjectivesGroups()) {
        addSpecificObjectivesGroup(group);
      }
    break;
case EXPECTED_RESULT:
  if (logFrameModel.getEnableExpectedResultsGroups()) {
    addExpectedResultsGroup(group);
  }
break;
case PREREQUISITE:
if (logFrameModel.getEnablePrerequisitesGroups()) {
addPrerequisitesGroup(group);
}
break;
case ACTIVITY:
if (logFrameModel.getEnableActivitiesGroups()) {
addActivitiesGroup(group);
}
break;
}
}
for (final SpecificObjectiveDTO objective : logFrame.getSpecificObjectives()) {
addSpecificObjective(objective);
}
for (final PrerequisiteDTO prerequisite : logFrame.getPrerequisites()) {
addPrerequisite(prerequisite);
}
}

Fixed version (ground truth):
/** 
 * Displays the log frame content in the log frame grid (specific objectives, expected results, prerequisites, activities);
 * @param table The log frame grid.
 * @param enabled If the log frame is read only or not.
 * @param logFrame The log frame.
 */
public void displayLogFrame(int databaseId,LogFrameDTO logFrame,boolean enabled){
  this.logFrame=logFrame;
  this.databaseId=databaseId;
  this.logFrameModel=logFrame.getLogFrameModel();
  this.readOnly=!enabled;
  ensureLogFrame();
  resetTable();
  initTable();
  for (  final LogFrameGroupDTO group : logFrame.getGroups()) {
switch (group.getType()) {
case SPECIFIC_OBJECTIVE:
      if (logFrameModel.getEnableSpecificObjectivesGroups()) {
        addSpecificObjectivesGroup(group);
      }
    break;
case EXPECTED_RESULT:
  if (logFrameModel.getEnableExpectedResultsGroups()) {
    addExpectedResultsGroup(group);
  }
break;
case PREREQUISITE:
if (logFrameModel.getEnablePrerequisitesGroups()) {
addPrerequisitesGroup(group);
}
break;
case ACTIVITY:
if (logFrameModel.getEnableActivitiesGroups()) {
addActivitiesGroup(group);
}
break;
}
}
for (final SpecificObjectiveDTO objective : logFrame.getSpecificObjectives()) {
addSpecificObjective(objective);
}
for (final PrerequisiteDTO prerequisite : logFrame.getPrerequisites()) {
addPrerequisite(prerequisite);
}
}
Program: 35687
Project: 35687
Buggy source:
@UiHandler("String_Node_Str") void onClick(ClickEvent e){
  final IndicatorDTO newIndicator=new IndicatorDTO();
  newIndicator.setCollectIntervention(true);
  newIndicator.setAggregation(IndicatorDTO.AGGREGATE_SUM);
  newIndicator.setDatabaseId(databaseId);
  newIndicator.setCategory(element.getGroup().getLabel());
  final IndicatorForm form=new IndicatorForm(dispatcher);
  form.getBinding().bind(newIndicator);
  form.setIdVisible(false);
  form.setCategoryVisible(false);
  final FormDialogImpl<IndicatorForm> dialog=new FormDialogImpl<IndicatorForm>(form);
  dialog.setHeading(I18N.CONSTANTS.newIndicatorGroup());
  dialog.setWidth(form.getPreferredDialogWidth());
  dialog.setHeight(form.getPreferredDialogHeight());
  dialog.setScrollMode(Scroll.AUTOY);
  dialog.show(new FormDialogCallback(){
    @Override public void onValidated(){
      dialog.hide();
      element.getIndicators().add(newIndicator);
      indicatorList.getStore().add(newIndicator);
    }
  }
);
}

Fixed version (ground truth):
@UiHandler("String_Node_Str") void onClick(ClickEvent e){
  final IndicatorDTO newIndicator=new IndicatorDTO();
  newIndicator.setCollectIntervention(true);
  newIndicator.setAggregation(IndicatorDTO.AGGREGATE_SUM);
  newIndicator.setDatabaseId(databaseId);
  newIndicator.setCategory((element.getFormattedCode() + "String_Node_Str" + element.getDescription()).trim());
  showDialog(newIndicator,new FormDialogCallback(){
    @Override public void onValidated(    FormDialogTether dlg){
      dlg.hide();
      element.getIndicators().add(newIndicator);
      indicatorList.getStore().add(newIndicator);
    }
  }
);
}
Program: 35688
Project: 35688
Buggy source:
@Override public void handleEvent(ListViewEvent<IndicatorDTO> be){
}

Fixed version (ground truth):
@Override public void handleEvent(ListViewEvent<IndicatorDTO> be){
  onIndicatorClicked(be.getModel());
}
Program: 35689
Project: 35689
Buggy source:
public IndicatorListWidget(Dispatcher dispatcher,int databaseId,LogFrameElementDTO element){
  this.dispatcher=dispatcher;
  this.databaseId=databaseId;
  this.element=element;
  initWidget(uiBinder.createAndBindUi(this));
  ListStore<IndicatorDTO> store=new ListStore<IndicatorDTO>();
  store.add(element.getIndicators());
  indicatorList.setTemplate("String_Node_Str" + style.indicator() + "String_Node_Str"+ "String_Node_Str"+ style.indicatorLabel()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ style.sourceOfVerification()+ "String_Node_Str"+ I18N.CONSTANTS.sourceOfVerification()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  indicatorList.setStore(store);
  indicatorList.setBorders(false);
  indicatorList.setOverStyle(style.indicatorOver());
  indicatorList.setSelectStyle(style.indicatorSelected());
  indicatorList.setItemSelector("String_Node_Str" + style.indicator());
  indicatorList.addListener(Events.Select,new Listener<ListViewEvent<IndicatorDTO>>(){
    @Override public void handleEvent(    ListViewEvent<IndicatorDTO> be){
    }
  }
);
  new ListViewDragSource(indicatorList).setGroup(DRAG_AND_DROP_GROUP);
  new ListViewDropTarget(indicatorList).setGroup(DRAG_AND_DROP_GROUP);
}

Fixed version (ground truth):
public IndicatorListWidget(Dispatcher dispatcher,int databaseId,LogFrameElementDTO element){
  this.dispatcher=dispatcher;
  this.databaseId=databaseId;
  this.element=element;
  initWidget(uiBinder.createAndBindUi(this));
  ListStore<IndicatorDTO> store=new ListStore<IndicatorDTO>();
  store.add(element.getIndicators());
  indicatorList.setTemplate("String_Node_Str" + style.indicator() + "String_Node_Str"+ "String_Node_Str"+ style.indicatorLabel()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ style.sourceOfVerification()+ "String_Node_Str"+ I18N.CONSTANTS.sourceOfVerification()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  indicatorList.setStore(store);
  indicatorList.setBorders(false);
  indicatorList.setOverStyle(style.indicatorOver());
  indicatorList.setSelectStyle(style.indicatorSelected());
  indicatorList.setItemSelector("String_Node_Str" + style.indicator());
  indicatorList.addListener(Events.Select,new Listener<ListViewEvent<IndicatorDTO>>(){
    @Override public void handleEvent(    ListViewEvent<IndicatorDTO> be){
      onIndicatorClicked(be.getModel());
    }
  }
);
  new ListViewDragSource(indicatorList).setGroup(DRAG_AND_DROP_GROUP);
  new ListViewDropTarget(indicatorList).setGroup(DRAG_AND_DROP_GROUP);
}
Program: 35690
Project: 35690
Buggy source:
@Override public void onValidated(){
  dialog.hide();
  element.getIndicators().add(newIndicator);
  indicatorList.getStore().add(newIndicator);
}

Fixed version (ground truth):
@Override public void onValidated(FormDialogTether dlg){
  dlg.hide();
  indicatorList.refresh();
}
Program: 35691
Project: 35691
Buggy source:
public String getLabel(){
  return get("String_Node_Str");
}

Fixed version (ground truth):
@Override public String getLabel(){
  return get("String_Node_Str");
}
Program: 35692
Project: 35692
Buggy source:
public String getLabel(){
  return get("String_Node_Str");
}

Fixed version (ground truth):
@Override public String getLabel(){
  return get("String_Node_Str");
}
Program: 35693
Project: 35693
Buggy source:
/** 
 * Builds the all window.
 * @param info info.
 */
private static void build(){
  final Widget versionPanel=getVersionPanel();
  final Widget rolesPanel=getManagersPartnersPanel();
  final Widget devConPanel=getDevelopersContributorsPanel();
  final VerticalPanel vPanel=new VerticalPanel();
  vPanel.setSpacing(0);
  vPanel.add(rolesPanel);
  vPanel.setCellVerticalAlignment(rolesPanel,HasVerticalAlignment.ALIGN_TOP);
  vPanel.add(devConPanel);
  vPanel.setCellVerticalAlignment(devConPanel,HasVerticalAlignment.ALIGN_TOP);
  final HorizontalPanel hPanel=new HorizontalPanel();
  hPanel.setSpacing(0);
  hPanel.add(versionPanel);
  hPanel.setCellVerticalAlignment(versionPanel,HasVerticalAlignment.ALIGN_MIDDLE);
  hPanel.setCellHorizontalAlignment(versionPanel,HasHorizontalAlignment.ALIGN_CENTER);
  hPanel.setCellWidth(versionPanel,"String_Node_Str");
  versionPanel.getElement().getStyle().setMarginRight(45,Unit.PX);
  hPanel.add(vPanel);
  hPanel.setCellVerticalAlignment(vPanel,HasVerticalAlignment.ALIGN_TOP);
  final VerticalPanel mainPanel=new VerticalPanel();
  mainPanel.setSpacing(10);
  mainPanel.add(hPanel);
  mainPanel.add(getCreditsPanel());
  window=new Window();
  window.setWidth(735);
  window.setHeight(535);
  window.setHeading(I18N.CONSTANTS.credits());
  window.setPlain(true);
  window.setModal(true);
  window.setBlinkModal(true);
  window.setLayout(new FitLayout());
  final ContentPanel p=new ContentPanel();
  p.setLayout(new FitLayout());
  p.setHeaderVisible(false);
  p.add(mainPanel);
  window.add(p);
}

Fixed version (ground truth):
/** 
 * Builds the all window.
 * @param info info.
 */
private static void build(){
  final Widget versionPanel=getVersionPanel();
  final Widget rolesPanel=getManagersPartnersPanel();
  final Widget devConPanel=getDevelopersContributorsPanel();
  final VerticalPanel vPanel=new VerticalPanel();
  vPanel.setSpacing(0);
  vPanel.add(rolesPanel);
  vPanel.setCellVerticalAlignment(rolesPanel,HasVerticalAlignment.ALIGN_TOP);
  vPanel.add(devConPanel);
  vPanel.setCellVerticalAlignment(devConPanel,HasVerticalAlignment.ALIGN_TOP);
  final HorizontalPanel hPanel=new HorizontalPanel();
  hPanel.setSpacing(0);
  hPanel.add(versionPanel);
  hPanel.setCellVerticalAlignment(versionPanel,HasVerticalAlignment.ALIGN_MIDDLE);
  hPanel.setCellHorizontalAlignment(versionPanel,HasHorizontalAlignment.ALIGN_CENTER);
  hPanel.setCellWidth(versionPanel,"String_Node_Str");
  versionPanel.getElement().getStyle().setMarginRight(45,Unit.PX);
  hPanel.add(vPanel);
  hPanel.setCellVerticalAlignment(vPanel,HasVerticalAlignment.ALIGN_TOP);
  final VerticalPanel mainPanel=new VerticalPanel();
  mainPanel.setSpacing(10);
  mainPanel.add(hPanel);
  mainPanel.add(getCreditsPanel());
  window=new Window();
  window.setWidth(735);
  window.setHeight(570);
  window.setHeading(I18N.CONSTANTS.credits());
  window.setPlain(true);
  window.setModal(true);
  window.setBlinkModal(true);
  window.setLayout(new FitLayout());
  final ContentPanel p=new ContentPanel();
  p.setLayout(new FitLayout());
  p.setHeaderVisible(false);
  p.add(mainPanel);
  window.add(p);
}
Program: 35694
Project: 35694
Buggy source:
@Inject public ProjectPresenter(final Dispatcher dispatcher,View view,Authentication authentication,final EventBus eventBus,final UserLocalCache cache,ProjectIndicatorsContainer projectIndicators,ProjectPivotContainer pivot){
  this.dispatcher=dispatcher;
  this.view=view;
  this.authentication=authentication;
  this.cache=cache;
  final DummyPresenter dummyPresenter=new DummyPresenter();
  this.presenters=new SubPresenter[]{new ProjectDashboardPresenter(dispatcher,eventBus,authentication,this,cache),new ProjectDetailsPresenter(eventBus,dispatcher,authentication,this,cache),new ProjectLogFramePresenter(dispatcher,authentication,this),projectIndicators,pivot,new ProjectCalendarPresenter(dispatcher,authentication,this),new ProjectReportsPresenter(authentication,dispatcher,eventBus,this),dummyPresenter};
  for (int i=0; i < MAIN_TABS.length; i++) {
    final int index=i;
    String tabTitle=MAIN_TABS[i];
    final HBoxLayoutData layoutData=new HBoxLayoutData();
    layoutData.setMargins(new Margins(0,10,0,0));
    final ToggleAnchor anchor=new ToggleAnchor(tabTitle);
    anchor.setAnchorMode(true);
    anchor.addClickHandler(new ClickHandler(){
      @Override public void onClick(      ClickEvent event){
        eventBus.fireEvent(new NavigationEvent(NavigationHandler.NavigationRequested,currentState.deriveTo(index)));
      }
    }
);
    this.view.getTabPanel().add(anchor,layoutData);
  }
}

Fixed version (ground truth):
@Inject public ProjectPresenter(final Dispatcher dispatcher,View view,Authentication authentication,final EventBus eventBus,final UserLocalCache cache,ProjectIndicatorsContainer projectIndicators,ProjectPivotContainer pivot){
  this.dispatcher=dispatcher;
  this.view=view;
  this.authentication=authentication;
  this.cache=cache;
  final DummyPresenter dummyPresenter=new DummyPresenter();
  this.presenters=new SubPresenter[]{new ProjectDashboardPresenter(dispatcher,eventBus,authentication,this,cache),new ProjectDetailsPresenter(eventBus,dispatcher,authentication,this,cache),new ProjectLogFramePresenter(dispatcher,authentication,this),projectIndicators,pivot,new ProjectCalendarPresenter(dispatcher,authentication,this),new ProjectReportsPresenter(authentication,dispatcher,eventBus,this)};
  for (int i=0; i < MAIN_TABS.length; i++) {
    final int index=i;
    String tabTitle=MAIN_TABS[i];
    final HBoxLayoutData layoutData=new HBoxLayoutData();
    layoutData.setMargins(new Margins(0,10,0,0));
    final ToggleAnchor anchor=new ToggleAnchor(tabTitle);
    anchor.setAnchorMode(true);
    anchor.addClickHandler(new ClickHandler(){
      @Override public void onClick(      ClickEvent event){
        eventBus.fireEvent(new NavigationEvent(NavigationHandler.NavigationRequested,currentState.deriveTo(index)));
      }
    }
);
    this.view.getTabPanel().add(anchor,layoutData);
  }
}
Program: 35695
Project: 35695
Buggy source:
/** 
 * Builds the actions toolbar.
 * @return The actions toolbar.
 */
private ToolBar buildToolbar(){
  saveButton=new Button(I18N.CONSTANTS.save(),IconImageBundle.ICONS.save());
  saveButton.setEnabled(false);
  copyButton=new Button(I18N.CONSTANTS.copy());
  copyButton.setEnabled(true);
  pasteButton=new Button(I18N.CONSTANTS.paste());
  pasteButton.setEnabled(false);
  excelButton=new Button(I18N.CONSTANTS.exportToExcel(),IconImageBundle.ICONS.excel());
  excelForm=new FormPanel();
  excelForm.setBodyBorder(false);
  excelForm.setHeaderVisible(false);
  excelForm.setPadding(0);
  excelForm.setEncoding(Encoding.URLENCODED);
  excelForm.setMethod(Method.POST);
  excelForm.setAction(GWT.getModuleBaseURL() + "String_Node_Str");
  final ToolBar toolBar=new ToolBar();
  toolBar.setAlignment(HorizontalAlignment.RIGHT);
  toolBar.setBorders(false);
  toolBar.add(saveButton);
  toolBar.add(copyButton);
  toolBar.add(pasteButton);
  toolBar.add(new SeparatorToolItem());
  toolBar.add(excelButton);
  toolBar.add(excelForm);
  return toolBar;
}

Fixed version (ground truth):
/** 
 * Builds the actions toolbar.
 * @return The actions toolbar.
 */
private ToolBar buildToolbar(){
  saveButton=new Button(I18N.CONSTANTS.save(),IconImageBundle.ICONS.save());
  saveButton.setEnabled(false);
  copyButton=new Button(I18N.CONSTANTS.copy());
  copyButton.setEnabled(true);
  pasteButton=new Button(I18N.CONSTANTS.paste());
  pasteButton.setEnabled(false);
  excelButton=new Button(I18N.CONSTANTS.exportToExcel(),IconImageBundle.ICONS.excel());
  excelButton.hide();
  excelForm=new FormPanel();
  excelForm.setBodyBorder(false);
  excelForm.setHeaderVisible(false);
  excelForm.setPadding(0);
  excelForm.setEncoding(Encoding.URLENCODED);
  excelForm.setMethod(Method.POST);
  excelForm.setAction(GWT.getModuleBaseURL() + "String_Node_Str");
  final ToolBar toolBar=new ToolBar();
  toolBar.setAlignment(HorizontalAlignment.RIGHT);
  toolBar.setBorders(false);
  toolBar.add(saveButton);
  toolBar.add(copyButton);
  toolBar.add(pasteButton);
  toolBar.add(new SeparatorToolItem());
  toolBar.add(excelButton);
  toolBar.add(excelForm);
  return toolBar;
}
Program: 35696
Project: 35696
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public CommandResult execute(GetProfiles cmd,User user) throws CommandException {
  List<ProfileDTOLight> profiles=new ArrayList<ProfileDTOLight>();
  final Query query=em.createQuery("String_Node_Str");
  final List<Profile> resultProfiles=(List<Profile>)query.getResultList();
  if (resultProfiles != null) {
    for (    final Profile oneProfile : resultProfiles) {
      ProfileDTOLight profile=mapper.map(oneProfile,ProfileDTOLight.class);
      profiles.add(profile);
    }
  }
  return new ProfileListResult(profiles);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public CommandResult execute(GetProfiles cmd,User user) throws CommandException {
  List<ProfileDTOLight> profiles=new ArrayList<ProfileDTOLight>();
  final Query query=em.createQuery("String_Node_Str");
  query.setParameter("String_Node_Str",user.getOrganization().getId());
  final List<Profile> resultProfiles=(List<Profile>)query.getResultList();
  if (resultProfiles != null) {
    for (    final Profile oneProfile : resultProfiles) {
      ProfileDTOLight profile=mapper.map(oneProfile,ProfileDTOLight.class);
      profiles.add(profile);
    }
  }
  return new ProfileListResult(profiles);
}
Program: 35698
Project: 35698
Buggy source:
@Override public <X>X get(String property){
  StringBuilder html=new StringBuilder();
  html.append(indicator == mappedSelection.getValue() ? MAP_ICON : EMPTY_MAP_ICON);
  html.append("String_Node_Str" + CSS.indicatorLabel() + "String_Node_Str");
  html.append(Format.htmlEncode(indicator.getName()).replace("String_Node_Str","String_Node_Str"));
  html.append("String_Node_Str");
  html.append(indicator.getCode());
  html.append("String_Node_Str");
  return (X)html.toString();
}

Fixed version (ground truth):
@Override public <X>X get(String property){
  StringBuilder html=new StringBuilder();
  html.append(indicator == mappedSelection.getValue() ? MAP_ICON : EMPTY_MAP_ICON);
  html.append(Format.htmlEncode(indicator.getName()));
  html.append("String_Node_Str");
  return (X)html.toString();
}
Program: 35699
Project: 35699
Buggy source:
@Inject public IndicatorDialog(SiteGridPanel siteGridPanel){
  setWidth(475);
  setHeight(300);
  setHeading("String_Node_Str");
  setClosable(true);
  indicatorForm=new IndicatorForm();
  indicatorForm.setHeaderVisible(false);
  indicatorForm.setScrollMode(Scroll.AUTOY);
  indicatorForm.setStyleAttribute("String_Node_Str","String_Node_Str");
  TabItem defTab=new TabItem("String_Node_Str");
  defTab.setLayout(new FitLayout());
  defTab.add(indicatorForm);
  this.siteGridPanel=siteGridPanel;
  TabItem valuesTab=new TabItem(I18N.CONSTANTS.value());
  valuesTab.setLayout(new FitLayout());
  valuesTab.add(siteGridPanel);
  TabItem linkTab=new TabItem("String_Node_Str");
  TabPanel tabPanel=new TabPanel();
  tabPanel.add(defTab);
  tabPanel.add(valuesTab);
  tabPanel.add(linkTab);
  setLayout(new FitLayout());
  add(tabPanel);
}

Fixed version (ground truth):
@Inject public IndicatorDialog(SiteGridPanel siteGridPanel){
  setWidth(475);
  setHeight(300);
  setHeading("String_Node_Str");
  setClosable(true);
  indicatorForm=new IndicatorForm();
  indicatorForm.setHeaderVisible(false);
  indicatorForm.setScrollMode(Scroll.AUTOY);
  indicatorForm.setStyleAttribute("String_Node_Str","String_Node_Str");
  TabItem defTab=new TabItem("String_Node_Str");
  defTab.setLayout(new FitLayout());
  defTab.add(indicatorForm);
  this.siteGridPanel=siteGridPanel;
  TabItem valuesTab=new TabItem(I18N.CONSTANTS.value());
  valuesTab.setLayout(new FitLayout());
  valuesTab.add(siteGridPanel);
  TabPanel tabPanel=new TabPanel();
  tabPanel.add(defTab);
  tabPanel.add(valuesTab);
  setLayout(new FitLayout());
  add(tabPanel);
}
Program: 35700
Project: 35700
Buggy source:
protected ColumnModel createColumnModel(){
  List<ColumnConfig> columns=new ArrayList<ColumnConfig>();
  ColumnConfig nameColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.name(),150);
  nameColumn.setRenderer(new DesignTreeGridCellRenderer(mappedIndicator));
  columns.add(nameColumn);
  ColumnConfig objectiveColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.objecive(),75);
  objectiveColumn.setRenderer(new IndicatorValueRenderer());
  objectiveColumn.setEditor(new CellEditor(new NumberField()));
  columns.add(objectiveColumn);
  ColumnConfig valueColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.value(),75);
  valueColumn.setRenderer(new IndicatorValueRenderer());
  valueColumn.setEditor(new CellEditor(new NumberField()));
  columns.add(valueColumn);
  return new ColumnModel(columns);
}

Fixed version (ground truth):
protected ColumnModel createColumnModel(){
  List<ColumnConfig> columns=new ArrayList<ColumnConfig>();
  ColumnConfig nameColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.name(),150);
  nameColumn.setRenderer(new DesignTreeGridCellRenderer(mappedIndicator));
  columns.add(nameColumn);
  ColumnConfig objectiveColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.objecive(),75);
  objectiveColumn.setRenderer(new IndicatorValueRenderer());
  objectiveColumn.setEditor(new CellEditor(new NumberField()));
  objectiveColumn.setAlignment(HorizontalAlignment.RIGHT);
  columns.add(objectiveColumn);
  ColumnConfig valueColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.value(),75);
  valueColumn.setRenderer(new IndicatorValueRenderer());
  valueColumn.setAlignment(HorizontalAlignment.RIGHT);
  columns.add(valueColumn);
  return new ColumnModel(columns);
}
Program: 35701
Project: 35701
Buggy source:
public void bindIndicator(int databaseId,IndicatorDTO indicator,Store store){
  indicatorForm.getBinding().setStore(store);
  indicatorForm.getBinding().bind(indicator);
  Filter siteFilter=new Filter();
  siteFilter.addRestriction(DimensionType.Database,databaseId);
  siteGridPanel.load(siteFilter,Collections.singleton(indicator));
}

Fixed version (ground truth):
public void bindIndicator(int databaseId,IndicatorDTO indicator){
  indicatorForm.getBinding().bind(indicator);
  Filter siteFilter=new Filter();
  siteFilter.addRestriction(DimensionType.Database,databaseId);
  siteGridPanel.load(siteFilter,Collections.singleton(indicator));
}