nus-yam/ex-repair huggingface dataset:
Program: 35436
Project: 35436
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected FormPanel buildHeaderForm(){
  nameField=Forms.text(I18N.CONSTANTS.adminProjectModelsName(),true);
  statusField=Forms.combobox(I18N.CONSTANTS.adminProjectModelsStatus(),true,EnumModel.VALUE_FIELD,EnumModel.DISPLAY_FIELD);
  modelTypeField=new ProjectModelTypeField(I18N.CONSTANTS.adminProjectModelType(),true,Orientation.VERTICAL);
  defaultProfiles=new ListComboBox<ProfileDTO>(ProfileDTO.ID,ProfileDTO.NAME);
  defaultProfiles.setNoAvailableValueTooltip(I18N.CONSTANTS.noAvailableProfileToAddInDefaultTeamMemberProfiles());
  defaultProfiles.initComponent();
  defaultProfiles.addStyleName("String_Node_Str");
  final FormPanel headerForm=Forms.panel(140);
  headerForm.setAutoHeight(true);
  headerForm.add(nameField);
  headerForm.add(statusField);
  headerForm.add(getMaintenanceGroupField());
  headerForm.add(modelTypeField);
  headerForm.add(Forms.adapter(I18N.CONSTANTS.adminProjectModelsDefaultProfilesForTeamMembers(),defaultProfiles));
  return headerForm;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected FormPanel buildHeaderForm(){
  nameField=Forms.text(I18N.CONSTANTS.adminProjectModelsName(),true);
  statusField=Forms.combobox(I18N.CONSTANTS.adminProjectModelsStatus(),true,EnumModel.VALUE_FIELD,EnumModel.DISPLAY_FIELD);
  modelTypeField=new ProjectModelTypeField(I18N.CONSTANTS.adminProjectModelType(),true,Orientation.VERTICAL);
  defaultProfiles=new ListComboBox<ProfileDTO>(ProfileDTO.ID,ProfileDTO.NAME);
  defaultProfiles.setNoAvailableValueTooltip(I18N.CONSTANTS.noAvailableProfileToAddInDefaultTeamMemberProfiles());
  defaultProfiles.initComponent();
  defaultProfiles.addStyleName("String_Node_Str");
  final FormPanel headerForm=Forms.panel(250);
  headerForm.setAutoHeight(true);
  headerForm.add(nameField);
  headerForm.add(statusField);
  headerForm.add(getMaintenanceGroupField());
  headerForm.add(modelTypeField);
  headerForm.add(Forms.adapter(I18N.CONSTANTS.adminProjectModelsDefaultProfilesForTeamMembers(),defaultProfiles));
  return headerForm;
}
Program: 35437
Project: 35437
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void buildExportDialog(final ContactRelationshipsPresenter.ExportActionHandler handler){
  final com.extjs.gxt.ui.client.widget.Window w=new com.extjs.gxt.ui.client.widget.Window();
  w.setPlain(true);
  w.setModal(true);
  w.setBlinkModal(true);
  w.setLayout(new FitLayout());
  w.setSize(400,180);
  w.setHeadingHtml(I18N.CONSTANTS.exportData());
  final FormPanel panel=Forms.panel();
  final CheckBox allRelationsBox=Forms.checkbox(I18N.CONSTANTS.allRelations());
  final CheckBox frameworkRelationsBox=Forms.checkbox(I18N.CONSTANTS.frameworkRelations());
  final CheckBox relationsByElementBox=Forms.checkbox(I18N.CONSTANTS.relationsByElement());
  final CheckBoxGroup options=Forms.checkBoxGroup(I18N.CONSTANTS.exportOptions(),com.extjs.gxt.ui.client.Style.Orientation.VERTICAL,allRelationsBox,frameworkRelationsBox,relationsByElementBox);
  panel.add(options);
  final Button export=Forms.button(I18N.CONSTANTS.export());
  panel.getButtonBar().add(export);
  export.addSelectionListener(new SelectionListener<ButtonEvent>(){
    @Override public void componentSelected(    final ButtonEvent ce){
      if (handler != null) {
        handler.onExportContactRelationships(false,allRelationsBox.getValue(),frameworkRelationsBox.getValue(),relationsByElementBox.getValue());
      }
      w.hide();
    }
  }
);
  w.add(panel);
  w.show();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void buildExportDialog(final ContactRelationshipsPresenter.ExportActionHandler handler){
  final com.extjs.gxt.ui.client.widget.Window w=new com.extjs.gxt.ui.client.widget.Window();
  w.setPlain(true);
  w.setModal(true);
  w.setBlinkModal(true);
  w.setLayout(new FitLayout());
  w.setSize(400,180);
  w.setHeadingHtml(I18N.CONSTANTS.exportData());
  final FormPanel panel=Forms.panel();
  final CheckBox allRelationsBox=Forms.checkbox(I18N.CONSTANTS.allRelations(),Boolean.TRUE);
  allRelationsBox.setEnabled(false);
  final CheckBox frameworkRelationsBox=Forms.checkbox(I18N.CONSTANTS.frameworkRelations());
  final CheckBox relationsByElementBox=Forms.checkbox(I18N.CONSTANTS.relationsByElement());
  final CheckBoxGroup options=Forms.checkBoxGroup(I18N.CONSTANTS.exportOptions(),com.extjs.gxt.ui.client.Style.Orientation.VERTICAL,allRelationsBox,frameworkRelationsBox,relationsByElementBox);
  panel.add(options);
  final Button export=Forms.button(I18N.CONSTANTS.export());
  panel.getButtonBar().add(export);
  export.addSelectionListener(new SelectionListener<ButtonEvent>(){
    @Override public void componentSelected(    final ButtonEvent ce){
      if (handler != null) {
        handler.onExportContactRelationships(false,allRelationsBox.getValue(),frameworkRelationsBox.getValue(),relationsByElementBox.getValue());
      }
      w.hide();
    }
  }
);
  w.add(panel);
  w.show();
}
Program: 35438
Project: 35438
Buggy source:
/** 
 * Initializes the widget view.
 */
@Override public void initialize(){
  proxy=new PagingContactsProxy();
  pagingLoader=new BasePagingLoader<PagingLoadResult<DashboardContact>>(proxy){
    @Override protected Object newLoadConfig(){
      return new BaseFilterPagingLoadConfig();
    }
  }
;
  pagingLoader.setRemoteSort(true);
  pagingToolBar=new PagingToolBar(10);
  pagingToolBar.bind(pagingLoader);
  final ListStore<DashboardContact> contactStore=new ListStore<DashboardContact>(pagingLoader);
  contactStore.setMonitorChanges(true);
  pagingLoader.setSortField(ContactDTO.NAME);
  pagingLoader.setSortDir(Style.SortDir.ASC);
  contactTreeGrid=new Grid<DashboardContact>(contactStore,buildContactGridColumnModel());
  contactTreeGrid.setBorders(true);
  contactTreeGrid.setTrackMouseOver(false);
  gridFilters=new GridFilters();
  initGridFilters();
  contactTreeGrid.addPlugin(gridFilters);
  toolbar=new ToolBar();
  addContactButton=new Button(I18N.CONSTANTS.addContact());
  toolbar.add(addContactButton);
  importButton=new Button(I18N.CONSTANTS.importContact());
  toolbar.add(importButton);
  exportButton=new Button(I18N.CONSTANTS.exportAll(),IconImageBundle.ICONS.excel());
  toolbar.add(exportButton);
  contactTreePanel=Panels.content(I18N.CONSTANTS.contacts());
  contactTreePanel.setTopComponent(toolbar);
  contactTreePanel.setBottomComponent(pagingToolBar);
}

Fixed version (ground truth):
/** 
 * Initializes the widget view.
 */
@Override public void initialize(){
  proxy=new PagingContactsProxy();
  pagingLoader=new BasePagingLoader<PagingLoadResult<DashboardContact>>(proxy){
    @Override protected Object newLoadConfig(){
      return new BaseFilterPagingLoadConfig();
    }
  }
;
  pagingLoader.setRemoteSort(true);
  pagingToolBar=new PagingToolBar(10);
  pagingToolBar.bind(pagingLoader);
  final ListStore<DashboardContact> contactStore=new ListStore<DashboardContact>(pagingLoader);
  contactStore.setMonitorChanges(true);
  pagingLoader.setSortField(ContactHistory.UPDATED_AT);
  pagingLoader.setSortDir(Style.SortDir.DESC);
  contactTreeGrid=new Grid<DashboardContact>(contactStore,buildContactGridColumnModel());
  contactTreeGrid.setBorders(true);
  contactTreeGrid.setTrackMouseOver(false);
  gridFilters=new GridFilters();
  initGridFilters();
  contactTreeGrid.addPlugin(gridFilters);
  toolbar=new ToolBar();
  addContactButton=new Button(I18N.CONSTANTS.addContact());
  toolbar.add(addContactButton);
  importButton=new Button(I18N.CONSTANTS.importContact());
  toolbar.add(importButton);
  exportButton=new Button(I18N.CONSTANTS.exportAll(),IconImageBundle.ICONS.excel());
  toolbar.add(exportButton);
  contactTreePanel=Panels.content(I18N.CONSTANTS.contacts());
  contactTreePanel.setTopComponent(toolbar);
  contactTreePanel.setBottomComponent(pagingToolBar);
}
Program: 35440
Project: 35440
Buggy source:
@Override public String getExtention(){
  try {
    Integer organizationId=Integer.parseInt(requireParameter(RequestParameter.ID));
    final GlobalExportSettingsHibernateDAO exportSettingDao=injector.getInstance(GlobalExportSettingsHibernateDAO.class);
    final GlobalExportSettings settings=exportSettingDao.getGlobalExportSettingsByOrganization(organizationId);
    exportFormat=settings.getExportFormat();
    if (exportFormat == null)     exportFormat=settings.getDefaultOrganizationExportFormat();
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
  }
  return super.getExtention();
}

Fixed version (ground truth):
@Override public String getExtention(){
  try {
    Integer organizationId=Integer.parseInt(requireParameter(RequestParameter.ID));
    final GlobalContactExportSettingsHibernateDAO exportSettingDao=injector.getInstance(GlobalContactExportSettingsHibernateDAO.class);
    final GlobalContactExportSettings settings=exportSettingDao.getGlobalExportSettingsByOrganization(organizationId);
    exportFormat=settings.getExportFormat();
    if (exportFormat == null)     exportFormat=settings.getDefaultOrganizationExportFormat();
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
  }
  return super.getExtention();
}
Program: 35444
Project: 35444
Buggy source:
private void addNumberTypeToStore(ListStore<FlexibleElementDTO>... stores){
  for (  ListStore<FlexibleElementDTO> store : stores) {
    store.removeAll();
  }
  for (  final FlexibleElementDTO otherElement : otherElements) {
    if (otherElement.getGroup().getHasIterations()) {
      continue;
    }
    final LogicalElementType otherType=LogicalElementTypes.of(otherElement);
    final ElementTypeEnum otherElementType=otherType.toElementTypeEnum();
    if ((otherElementType == ElementTypeEnum.TEXT_AREA && otherType.toTextAreaType() == TextAreaType.NUMBER) || otherElementType == ElementTypeEnum.COMPUTATION) {
      for (      ListStore<FlexibleElementDTO> store : stores) {
        store.add(otherElement);
      }
    }
 else     if (otherElementType == ElementTypeEnum.CONTACT_LIST) {
      loadContactListOptions((ContactListElementDTO)flexibleElement);
    }
  }
}

Fixed version (ground truth):
private void addNumberTypeToStore(ListStore<FlexibleElementDTO>... stores){
  for (  ListStore<FlexibleElementDTO> store : stores) {
    store.removeAll();
  }
  for (  final FlexibleElementDTO otherElement : otherElements) {
    if (otherElement.getGroup().getHasIterations()) {
      continue;
    }
    final LogicalElementType otherType=LogicalElementTypes.of(otherElement);
    final ElementTypeEnum otherElementType=otherType.toElementTypeEnum();
    if ((otherElementType == ElementTypeEnum.TEXT_AREA && otherType.toTextAreaType() == TextAreaType.NUMBER) || otherElementType == ElementTypeEnum.COMPUTATION) {
      for (      ListStore<FlexibleElementDTO> store : stores) {
        store.add(otherElement);
      }
    }
  }
}
Program: 35445
Project: 35445
Buggy source:
@Override public void handleDedupeContact(final Integer targetedContactId,List<ContactDuplicatedProperty> selectedProperties){
  dispatch.execute(new DedupeContact(selectedProperties,contactDTO.getId(),targetedContactId),new CommandResultHandler<ContactDTO>(){
    @Override protected void onCommandSuccess(    ContactDTO targetedContactDTO){
      dedupeContactDialog.hide();
      eventBus.navigateRequest(Page.CONTACT_DASHBOARD.requestWith(RequestParameter.ID,targetedContactId));
    }
  }
);
}

Fixed version (ground truth):
@Override public void handleDedupeContact(final Integer targetedContactId,List<ContactDuplicatedProperty> selectedProperties){
  dispatch.execute(new DedupeContact(selectedProperties,contactDTO.getId(),targetedContactId),new CommandResultHandler<ContactDTO>(){
    @Override protected void onCommandSuccess(    ContactDTO targetedContactDTO){
      dedupeContactDialog.hide();
      final PageRequest currentRequest=injector.getPageManager().getCurrentPageRequest(false);
      eventBus.navigateRequest(Page.CONTACT_DASHBOARD.requestWith(RequestParameter.ID,targetedContactId));
      eventBus.fireEvent(new UpdateEvent(UpdateEvent.CONTACT_DELETE,currentRequest));
    }
  }
);
}
Program: 35447
Project: 35447
Buggy source:
@Override protected void onCommandSuccess(final VoidResult result){
  N10N.infoNotif(I18N.CONSTANTS.infoConfirmation(),I18N.CONSTANTS.saveConfirm());
  for (  final ValueEvent event : valueChanges) {
    if (event.getSource() instanceof DefaultContactFlexibleElementDTO) {
      updateCurrentContact(contactDTO,(DefaultContactFlexibleElementDTO)event.getSource(),event.getSingleValue());
    }
  }
  valueChanges.clear();
  if (callback != null) {
    callback.onSuccess(contactDTO);
  }
}

Fixed version (ground truth):
@Override public void onCommandSuccess(final VoidResult result){
  final PageRequest currentRequest=injector.getPageManager().getCurrentPageRequest(false);
  eventBus.fireEvent(new UpdateEvent(UpdateEvent.CONTACT_DELETE,currentRequest));
  N10N.infoNotif(I18N.CONSTANTS.deleteContactNotificationTitle(),I18N.CONSTANTS.deleteContactNotificationContent());
}
Program: 35448
Project: 35448
Buggy source:
@Override public void componentSelected(ButtonEvent event){
  if (!formPanel.isValid()) {
    return;
  }
  createContactHandler.handleContactCreation(contactModelComboBox.getValue(),firstNameField.getValue(),familyNameField.getValue(),organizationNameField.getValue(),mainOrgUnitComboBox.getValue(),secondaryOrgUnitsComboBox.getListStore().getModels());
  window.hide();
}

Fixed version (ground truth):
@Override public void componentSelected(ButtonEvent event){
  if (!formPanel.isValid()) {
    return;
  }
  createContactHandler.handleContactCreation(contactModelComboBox.getValue(),emailField.getValue(),firstNameField.getValue(),familyNameField.getValue(),organizationNameField.getValue(),mainOrgUnitComboBox.getValue(),secondaryOrgUnitsComboBox.getListStore().getModels());
  window.hide();
}
Program: 35449
Project: 35449
Buggy source:
private HashMap<String,Object> buildPropertyMap(ContactModelDTO contactModelDTO,String firstName,String familyName,String organizationName,OrgUnitDTO mainOrgUnit,List<OrgUnitDTO> secondaryOrgUnits){
  HashMap<String,Object> properties=new HashMap<String,Object>();
  properties.put(ContactDTO.CONTACT_MODEL,contactModelDTO.getId());
  properties.put(ContactDTO.FIRSTNAME,contactModelDTO.getType() == ContactModelType.INDIVIDUAL ? firstName : null);
  properties.put(ContactDTO.NAME,contactModelDTO.getType() == ContactModelType.INDIVIDUAL ? familyName : organizationName);
  if (mainOrgUnit != null) {
    properties.put(ContactDTO.MAIN_ORG_UNIT,mainOrgUnit.getId());
  }
  if (secondaryOrgUnits != null) {
    HashSet<Integer> secondaryOrgUnitIds=new HashSet<Integer>();
    for (    OrgUnitDTO secondaryOrgUnit : secondaryOrgUnits) {
      secondaryOrgUnitIds.add(secondaryOrgUnit.getId());
    }
    properties.put(ContactDTO.SECONDARY_ORG_UNITS,secondaryOrgUnitIds);
  }
  return properties;
}

Fixed version (ground truth):
private HashMap<String,Object> buildPropertyMap(ContactModelDTO contactModelDTO,String email,String firstName,String familyName,String organizationName,OrgUnitDTO mainOrgUnit,List<OrgUnitDTO> secondaryOrgUnits){
  HashMap<String,Object> properties=new HashMap<String,Object>();
  properties.put(ContactDTO.CONTACT_MODEL,contactModelDTO.getId());
  properties.put(ContactDTO.EMAIL,email);
  properties.put(ContactDTO.FIRSTNAME,contactModelDTO.getType() == ContactModelType.INDIVIDUAL ? firstName : null);
  properties.put(ContactDTO.NAME,contactModelDTO.getType() == ContactModelType.INDIVIDUAL ? familyName : organizationName);
  if (mainOrgUnit != null) {
    properties.put(ContactDTO.MAIN_ORG_UNIT,mainOrgUnit.getId());
  }
  if (secondaryOrgUnits != null) {
    HashSet<Integer> secondaryOrgUnitIds=new HashSet<Integer>();
    for (    OrgUnitDTO secondaryOrgUnit : secondaryOrgUnits) {
      secondaryOrgUnitIds.add(secondaryOrgUnit.getId());
    }
    properties.put(ContactDTO.SECONDARY_ORG_UNITS,secondaryOrgUnitIds);
  }
  return properties;
}
Program: 35453
Project: 35453
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void onBind(){
  requests=new HashMap<TabId,PageRequest>();
  view.getLeftHandler().addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      view.getTabBar().showTab();
    }
  }
);
  view.getRightHandler().addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      view.getTabBar().hideTab();
    }
  }
);
  view.getTabBar().addListener(new TabBarListener(){
    @Override public void tabShownOrHiddden(    TabBar bar){
      updateLeftRightHandler();
    }
    @Override public void tabRemoved(    TabBar bar,    Tab tab){
      updateLeftRightHandler();
      requests.remove(tab.getId());
    }
    @Override public void tabAdded(    TabBar bar,    Tab tab){
      updateLeftRightHandler();
    }
    @Override public void tabActivated(    TabBar bar,    Tab tab){
      eventBus.navigateRequest(requests.get(tab.getId()));
    }
  }
);
  addTab(new PageRequest(Page.DASHBOARD));
  registerHandler(eventBus.addHandler(UpdateEvent.getType(),new UpdateHandler(){
    @Override public void onUpdate(    final UpdateEvent event){
      if (event.concern(UpdateEvent.PROJECT_DELETE)) {
        final PageRequest request=event.getParam(0);
        view.getTabBar().removeTab(new MenuTabId(request));
      }
    }
  }
));
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void onBind(){
  requests=new HashMap<TabId,PageRequest>();
  view.getLeftHandler().addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      view.getTabBar().showTab();
    }
  }
);
  view.getRightHandler().addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      view.getTabBar().hideTab();
    }
  }
);
  view.getTabBar().addListener(new TabBarListener(){
    @Override public void tabShownOrHiddden(    TabBar bar){
      updateLeftRightHandler();
    }
    @Override public void tabRemoved(    TabBar bar,    Tab tab){
      updateLeftRightHandler();
      requests.remove(tab.getId());
    }
    @Override public void tabAdded(    TabBar bar,    Tab tab){
      updateLeftRightHandler();
    }
    @Override public void tabActivated(    TabBar bar,    Tab tab){
      eventBus.navigateRequest(requests.get(tab.getId()));
    }
  }
);
  addTab(new PageRequest(Page.DASHBOARD));
  registerHandler(eventBus.addHandler(UpdateEvent.getType(),new UpdateHandler(){
    @Override public void onUpdate(    final UpdateEvent event){
      if (event.concern(UpdateEvent.PROJECT_DELETE)) {
        final PageRequest request=event.getParam(0);
        view.getTabBar().removeTab(new MenuTabId(request));
      }
    }
  }
));
  registerHandler(eventBus.addHandler(UpdateEvent.getType(),new UpdateHandler(){
    @Override public void onUpdate(    final UpdateEvent event){
      if (event.concern(UpdateEvent.CONTACT_DELETE)) {
        final PageRequest request=event.getParam(0);
        view.getTabBar().removeTab(new MenuTabId(request));
      }
    }
  }
));
}
Program: 35454
Project: 35454
Buggy source:
@Override public void onUpdate(final UpdateEvent event){
  if (event.concern(UpdateEvent.PROJECT_DELETE)) {
    final PageRequest request=event.getParam(0);
    view.getTabBar().removeTab(new MenuTabId(request));
  }
}

Fixed version (ground truth):
@Override public void onUpdate(final UpdateEvent event){
  if (event.concern(UpdateEvent.CONTACT_DELETE)) {
    final PageRequest request=event.getParam(0);
    view.getTabBar().removeTab(new MenuTabId(request));
  }
}
Program: 35455
Project: 35455
Buggy source:
@Override public void initialize(){
  container=Panels.content(null,false,Layouts.vBoxLayout(VBoxLayout.VBoxLayoutAlign.STRETCH,new Layouts.LayoutOptions(new Padding(10))),"String_Node_Str");
  container.setScrollMode(Style.Scroll.AUTOY);
  container.addStyleName("String_Node_Str");
  add(container);
  saveButton=Forms.button(I18N.CONSTANTS.save(),IconImageBundle.ICONS.save());
  exportButton=Forms.button(I18N.CONSTANTS.export(),IconImageBundle.ICONS.excel());
  toolBar=new ToolBar();
  toolBar.setAlignment(Style.HorizontalAlignment.LEFT);
  toolBar.setBorders(false);
  toolBar.add(saveButton);
  toolBar.add(exportButton);
  container.setTopComponent(toolBar);
}

Fixed version (ground truth):
@Override public void initialize(){
  container=Panels.content(null,false,Layouts.vBoxLayout(VBoxLayout.VBoxLayoutAlign.STRETCH,new Layouts.LayoutOptions(new Padding(10))),"String_Node_Str");
  container.setScrollMode(Style.Scroll.AUTOY);
  container.addStyleName("String_Node_Str");
  add(container);
  saveButton=Forms.button(I18N.CONSTANTS.save(),IconImageBundle.ICONS.save());
  deleteButton=Forms.button(I18N.CONSTANTS.delete(),IconImageBundle.ICONS.remove());
  exportButton=Forms.button(I18N.CONSTANTS.export(),IconImageBundle.ICONS.excel());
  toolBar=new ToolBar();
  toolBar.setAlignment(Style.HorizontalAlignment.LEFT);
  toolBar.setBorders(false);
  toolBar.add(saveButton);
  toolBar.add(deleteButton);
  toolBar.add(exportButton);
  container.setTopComponent(toolBar);
}
Program: 35457
Project: 35457
Buggy source:
@Override public void componentSelected(ButtonEvent event){
  if (!formPanel.isValid()) {
    return;
  }
  createContactHandler.handleContactCreation(contactModelComboBox.getValue(),firstNameField.getValue(),familyNameField.getValue(),organizationNameField.getValue(),mainOrgUnitComboBox.getValue(),secondaryOrgUnitsComboBox.getListStore().getModels());
  window.hide();
}

Fixed version (ground truth):
@Override public void componentSelected(ButtonEvent event){
  if (!formPanel.isValid()) {
    return;
  }
  createContactHandler.handleContactCreation(contactModelComboBox.getValue(),emailField.getValue(),firstNameField.getValue(),familyNameField.getValue(),organizationNameField.getValue(),mainOrgUnitComboBox.getValue(),secondaryOrgUnitsComboBox.getListStore().getModels());
  window.hide();
}
Program: 35458
Project: 35458
Buggy source:
void handleContactCreation(ContactModelDTO contactModelDTO,String firstName,String familyName,String organizationName,OrgUnitDTO mainOrgUnit,List<OrgUnitDTO> secondaryOrgUnits);

Fixed version (ground truth):
void handleContactCreation(ContactModelDTO contactModelDTO,String email,String firstName,String familyName,String organizationName,OrgUnitDTO mainOrgUnit,List<OrgUnitDTO> secondaryOrgUnits);
Program: 35460
Project: 35460
Buggy source:
private Predicate similarity(CriteriaBuilder criteriaBuilder,Expression<String> nameExpression,String nameValue,Expression<String> firstNameExpression,String firstNameValue){
  Expression<String> fullNameExpression;
  String fullnameValue;
  if (firstNameExpression != null && firstNameValue != null) {
    fullNameExpression=criteriaBuilder.concat(criteriaBuilder.concat(nameExpression,"String_Node_Str"),firstNameExpression);
    fullnameValue=(nameValue + "String_Node_Str" + firstNameValue).toLowerCase();
  }
 else {
    fullNameExpression=nameExpression;
    fullnameValue=nameValue.toLowerCase();
  }
  return criteriaBuilder.greaterThanOrEqualTo(criteriaBuilder.function("String_Node_Str",Float.class,criteriaBuilder.lower(fullNameExpression),criteriaBuilder.literal(fullnameValue)),MIN_SIMILARITY_SCORE);
}

Fixed version (ground truth):
private Predicate similarity(CriteriaBuilder criteriaBuilder,Expression<String> nameExpression,String nameValue,Expression<String> firstNameExpression,String firstNameValue){
  Expression<String> fullNameExpression;
  String fullnameValue;
  if (firstNameExpression != null && firstNameValue != null) {
    fullNameExpression=criteriaBuilder.concat(criteriaBuilder.concat(nameExpression,"String_Node_Str"),firstNameExpression);
    fullnameValue=(nameValue + "String_Node_Str" + firstNameValue).toLowerCase();
  }
 else {
    fullNameExpression=nameExpression;
    fullnameValue=nameValue != null ? nameValue.toLowerCase() : "String_Node_Str";
  }
  return criteriaBuilder.greaterThanOrEqualTo(criteriaBuilder.function("String_Node_Str",Float.class,criteriaBuilder.lower(fullNameExpression),criteriaBuilder.literal(fullnameValue)),MIN_SIMILARITY_SCORE);
}
Program: 35461
Project: 35461
Buggy source:
@Override protected ListResult<ContactDTO> execute(CheckContactDuplication command,UserDispatch.UserExecutionContext context) throws CommandException {
  List<Contact> contacts=contactDAO.findContactsByEmailOrSimilarName(context.getUser().getOrganization().getId(),command.getContactId(),command.getEmail(),command.getFirstName(),command.getName());
  return new ListResult<>(mapper().mapCollection(contacts,ContactDTO.class));
}

Fixed version (ground truth):
@Override protected ListResult<ContactDTO> execute(CheckContactDuplication command,UserDispatch.UserExecutionContext context) throws CommandException {
  List<Contact> contacts=contactDAO.findContactsByEmailOrSimilarName(context.getUser().getOrganization().getId(),command.getContactId(),command.getEmail(),command.getFirstName(),command.getName());
  List<ContactDTO> contactDTOs=new ArrayList<>();
  for (  Contact contact : contacts) {
    if (!contact.isDeleted()) {
      contactDTOs.add(mapper().map(contact,ContactDTO.class));
    }
  }
  return new ListResult<>(contactDTOs);
}
Program: 35462
Project: 35462
Buggy source:
@Override protected ContactDTO execute(GetContact command,UserDispatch.UserExecutionContext context) throws CommandException {
  Contact contact=contactDAO.findById(command.getContactId());
  return mapper().map(contact,new ContactDTO());
}

Fixed version (ground truth):
@Override protected ContactDTO execute(GetContact command,UserDispatch.UserExecutionContext context) throws CommandException {
  Contact contact=contactDAO.findById(command.getContactId());
  if (contact.isDeleted()) {
    return null;
  }
  return mapper().map(contact,new ContactDTO());
}
Program: 35463
Project: 35463
Buggy source:
@Override protected ListResult<ContactDTO> execute(GetContacts command,UserDispatch.UserExecutionContext context) throws CommandException {
  Integer organizationId=context.getUser().getOrganization().getId();
  List<Contact> contacts;
  if (command.getContactIds() == null || command.getContactIds().isEmpty()) {
    contacts=contactDAO.findContactsByTypeAndContactModels(organizationId,command.getType(),command.getContactModelIds(),command.isOnlyContactWithoutUser(),command.isWithEmailNotNull(),command.getOrgUnitsIds());
  }
 else {
    contacts=contactDAO.findByIds(command.getContactIds());
  }
  return new ListResult<>(mapper().mapCollection(contacts,ContactDTO.class));
}

Fixed version (ground truth):
@Override protected ListResult<ContactDTO> execute(GetContacts command,UserDispatch.UserExecutionContext context) throws CommandException {
  Integer organizationId=context.getUser().getOrganization().getId();
  List<Contact> contacts;
  if (command.getContactIds() == null || command.getContactIds().isEmpty()) {
    contacts=contactDAO.findContactsByTypeAndContactModels(organizationId,command.getType(),command.getContactModelIds(),command.isOnlyContactWithoutUser(),command.isWithEmailNotNull(),command.getOrgUnitsIds());
  }
 else {
    contacts=contactDAO.findByIds(command.getContactIds());
  }
  List<ContactDTO> contactDTOs=new ArrayList<>();
  for (  Contact contact : contacts) {
    if (!contact.isDeleted()) {
      contactDTOs.add(mapper().map(contact,ContactDTO.class));
    }
  }
  return new ListResult<>(contactDTOs);
}
Program: 35466
Project: 35466
Buggy source:
void addLabel(String label);

Fixed version (ground truth):
void addLabel(String label,String style);
Program: 35468
Project: 35468
Buggy source:
@Override public void addLabel(String label){
  if (ClientUtils.isBlank(label)) {
    return;
  }
  HTML html=new HTML(label);
  html.setHeight(LABEL_HEIGHT + "String_Node_Str");
  html.setStyleName(LABEL_STYLE_NAME);
  html.setWordWrap(false);
  if ((topDetailsContainer.getItemCount() + 1) * LABEL_HEIGHT > AVATAR_HEIGHT) {
    bottomDetailsContainer.add(html);
    bottomDetailsContainer.setHeight(bottomDetailsContainer.getItemCount() * LABEL_HEIGHT);
    bottomDetailsContainer.layout();
    return;
  }
  topDetailsContainer.add(html);
  topDetailsContainer.layout();
}

Fixed version (ground truth):
@Override public void addLabel(String label,String style){
  if (ClientUtils.isBlank(label)) {
    return;
  }
  HTML html=new HTML(label);
  html.setHeight(LABEL_HEIGHT + "String_Node_Str");
  html.setStyleName(style);
  html.setWordWrap(false);
  if ((topDetailsContainer.getItemCount() + 1) * LABEL_HEIGHT > AVATAR_HEIGHT) {
    bottomDetailsContainer.add(html);
    bottomDetailsContainer.setHeight(bottomDetailsContainer.getItemCount() * LABEL_HEIGHT);
    bottomDetailsContainer.layout();
    return;
  }
  topDetailsContainer.add(html);
  topDetailsContainer.layout();
}
Program: 35469
Project: 35469
Buggy source:
@Override public int compare(ContactHistory first,ContactHistory second){
  return first.getUpdatedAt().compareTo(second.getUpdatedAt());
}

Fixed version (ground truth):
@Override public int compare(ContactHistory first,ContactHistory second){
  return -first.getUpdatedAt().compareTo(second.getUpdatedAt());
}
Program: 35470
Project: 35470
Buggy source:
public List<ContactHistory> findHistory(Integer contactId,Language language){
  Contact contact=contactDAO.findById(contactId);
  List<ContactHistory> contactHistories=new ArrayList<ContactHistory>();
  contactHistories.addAll(generateHistoryFromContactValues(contact,language));
  contactHistories.addAll(generateHistoryFromInboundRelationships(contact,language));
  Collections.sort(contactHistories,new Comparator<ContactHistory>(){
    @Override public int compare(    ContactHistory first,    ContactHistory second){
      return first.getUpdatedAt().compareTo(second.getUpdatedAt());
    }
  }
);
  return contactHistories;
}

Fixed version (ground truth):
public List<ContactHistory> findHistory(Integer contactId,Language language){
  Contact contact=contactDAO.findById(contactId);
  List<ContactHistory> contactHistories=new ArrayList<ContactHistory>();
  contactHistories.addAll(generateHistoryFromContactValues(contact,language));
  contactHistories.addAll(generateHistoryFromInboundRelationships(contact,language));
  Collections.sort(contactHistories,new Comparator<ContactHistory>(){
    @Override public int compare(    ContactHistory first,    ContactHistory second){
      return -first.getUpdatedAt().compareTo(second.getUpdatedAt());
    }
  }
);
  return contactHistories;
}
Program: 35471
Project: 35471
Buggy source:
private PrivacyGroupPermissionEnum getPermission(){
  PrivacyGroupPermissionEnum permission=PrivacyGroupPermissionEnum.NONE;
  for (  Integer orgUnitId : getOrgUnitIds()) {
    PrivacyGroupPermissionEnum privacyGroupPermission=ProfileUtils.getPermissionForOrgUnit(auth(),orgUnitId,getPrivacyGroup());
switch (privacyGroupPermission) {
case NONE:
      break;
case READ:
    permission=PrivacyGroupPermissionEnum.READ;
  break;
case WRITE:
return PrivacyGroupPermissionEnum.WRITE;
default :
throw new IllegalStateException("String_Node_Str" + privacyGroupPermission);
}
}
return permission;
}

Fixed version (ground truth):
private PrivacyGroupPermissionEnum getPermission(){
  if (getOrgUnitIds().contains(null)) {
    return PrivacyGroupPermissionEnum.WRITE;
  }
  PrivacyGroupPermissionEnum permission=PrivacyGroupPermissionEnum.NONE;
  for (  Integer orgUnitId : getOrgUnitIds()) {
    PrivacyGroupPermissionEnum privacyGroupPermission=ProfileUtils.getPermissionForOrgUnit(auth(),orgUnitId,getPrivacyGroup());
switch (privacyGroupPermission) {
case NONE:
      break;
case READ:
    permission=PrivacyGroupPermissionEnum.READ;
  break;
case WRITE:
return PrivacyGroupPermissionEnum.WRITE;
default :
throw new IllegalStateException("String_Node_Str" + privacyGroupPermission);
}
}
return permission;
}
Program: 35472
Project: 35472
Buggy source:
public static boolean isProjectEditable(ProjectDTO project,Authentication authentication){
  if (!isProjectVisible(project,authentication)) {
    return false;
  }
  Map<Integer,ProfileDTO> aggregatedProfiles=authentication.getAggregatedProfiles();
  if (aggregatedProfiles == null) {
    return false;
  }
  ProfileDTO profileDTO=aggregatedProfiles.get(project.getOrgUnitId());
  if (profileDTO == null) {
    return false;
  }
  if (profileDTO.getGlobalPermissions().contains(GlobalPermissionEnum.EDIT_ALL_PROJECTS)) {
    return true;
  }
  return authentication.getMemberOfProjectIds().contains(project.getId()) && profileDTO.getGlobalPermissions().contains(GlobalPermissionEnum.EDIT_PROJECT);
}

Fixed version (ground truth):
public static boolean isProjectEditable(ProjectDTO project,Authentication authentication){
  if (!isProjectVisible(project,authentication)) {
    return false;
  }
  if (project.getOrgUnitId() == null) {
    return true;
  }
  Map<Integer,ProfileDTO> aggregatedProfiles=authentication.getAggregatedProfiles();
  if (aggregatedProfiles == null) {
    return false;
  }
  ProfileDTO profileDTO=aggregatedProfiles.get(project.getOrgUnitId());
  if (profileDTO == null) {
    return false;
  }
  if (profileDTO.getGlobalPermissions().contains(GlobalPermissionEnum.EDIT_ALL_PROJECTS)) {
    return true;
  }
  return authentication.getMemberOfProjectIds().contains(project.getId()) && profileDTO.getGlobalPermissions().contains(GlobalPermissionEnum.EDIT_PROJECT);
}
Program: 35474
Project: 35474
Buggy source:
@Override protected ListResult<ContactDuplicatedProperty> execute(GetContactDuplicatedProperties command,UserDispatch.UserExecutionContext context) throws CommandException {
  Contact newContact;
  Contact oldContact;
  if (command.getNewContactId() != null) {
    newContact=contactDAO.findById(command.getNewContactId());
  }
 else {
    newContact=contactService.create(new PropertyMap(command.getNewContactProperties()),context);
  }
  oldContact=contactDAO.findById(command.getOldContactId());
  List<ContactDuplicatedProperty> duplicatedProperties=contactDuplicationService.extractProperties(newContact,oldContact,context.getLanguage());
  return new ListResult<>(duplicatedProperties);
}

Fixed version (ground truth):
@Override protected ListResult<ContactDuplicatedProperty> execute(GetContactDuplicatedProperties command,UserDispatch.UserExecutionContext context) throws CommandException {
  Contact newContact;
  Contact oldContact;
  if (command.getNewContactId() != null) {
    newContact=contactDAO.findById(command.getNewContactId());
  }
 else {
    newContact=contactService.createVirtual(new PropertyMap(command.getNewContactProperties()),context);
  }
  oldContact=contactDAO.findById(command.getOldContactId());
  List<ContactDuplicatedProperty> duplicatedProperties=contactDuplicationService.extractProperties(newContact,oldContact,context.getLanguage());
  return new ListResult<>(duplicatedProperties);
}
Program: 35476
Project: 35476
Buggy source:
private Button generateFirstStepMainButton(){
  Button button;
  if (createContact) {
    button=new Button(I18N.CONSTANTS.dedupeContactCreateNewButton());
  }
 else {
    button=new Button(I18N.CONSTANTS.dedupeContactUpdateIndependently());
  }
  button.addSelectionListener(new SelectionListener<ButtonEvent>(){
    @Override public void componentSelected(    ButtonEvent ce){
      secondStepHandler.handleDedupeContact(selectedContact.getId(),selectedProperties);
    }
  }
);
  return button;
}

Fixed version (ground truth):
private Button generateFirstStepMainButton(){
  Button button;
  if (createContact) {
    button=new Button(I18N.CONSTANTS.dedupeContactCreateNewButton());
  }
 else {
    button=new Button(I18N.CONSTANTS.dedupeContactUpdateIndependently());
  }
  return button;
}
Program: 35478
Project: 35478
Buggy source:
@Override public void componentSelected(ButtonEvent event){
  if (!formPanel.isValid()) {
    return;
  }
  createContactHandler.handleContactCreation(contactModelComboBox.getValue(),loginField.getValue(),firstNameField.getValue(),familyNameField.getValue(),organizationNameField.getValue(),mainOrgUnitComboBox.getValue(),secondaryOrgUnitsComboBox.getListStore().getModels());
  window.hide();
}

Fixed version (ground truth):
@Override public void componentSelected(ButtonEvent event){
  if (!formPanel.isValid()) {
    return;
  }
  createContactHandler.handleContactCreation(contactModelComboBox.getValue(),firstNameField.getValue(),familyNameField.getValue(),organizationNameField.getValue(),mainOrgUnitComboBox.getValue(),secondaryOrgUnitsComboBox.getListStore().getModels());
  window.hide();
}
Program: 35479
Project: 35479
Buggy source:
private HashMap<String,Object> buildPropertyMap(ContactModelDTO contactModelDTO,String login,String firstName,String familyName,String organizationName,OrgUnitDTO mainOrgUnit,List<OrgUnitDTO> secondaryOrgUnits){
  HashMap<String,Object> properties=new HashMap<String,Object>();
  properties.put(ContactDTO.CONTACT_MODEL,contactModelDTO.getId());
  properties.put(ContactDTO.LOGIN,login);
  properties.put(ContactDTO.FIRSTNAME,contactModelDTO.getType() == ContactModelType.INDIVIDUAL ? firstName : null);
  properties.put(ContactDTO.NAME,contactModelDTO.getType() == ContactModelType.INDIVIDUAL ? familyName : organizationName);
  if (mainOrgUnit != null) {
    properties.put(ContactDTO.MAIN_ORG_UNIT,mainOrgUnit.getId());
  }
  if (secondaryOrgUnits != null) {
    HashSet<Integer> secondaryOrgUnitIds=new HashSet<Integer>();
    for (    OrgUnitDTO secondaryOrgUnit : secondaryOrgUnits) {
      secondaryOrgUnitIds.add(secondaryOrgUnit.getId());
    }
    properties.put(ContactDTO.SECONDARY_ORG_UNITS,secondaryOrgUnitIds);
  }
  return properties;
}

Fixed version (ground truth):
private HashMap<String,Object> buildPropertyMap(ContactModelDTO contactModelDTO,String firstName,String familyName,String organizationName,OrgUnitDTO mainOrgUnit,List<OrgUnitDTO> secondaryOrgUnits){
  HashMap<String,Object> properties=new HashMap<String,Object>();
  properties.put(ContactDTO.CONTACT_MODEL,contactModelDTO.getId());
  properties.put(ContactDTO.FIRSTNAME,contactModelDTO.getType() == ContactModelType.INDIVIDUAL ? firstName : null);
  properties.put(ContactDTO.NAME,contactModelDTO.getType() == ContactModelType.INDIVIDUAL ? familyName : organizationName);
  if (mainOrgUnit != null) {
    properties.put(ContactDTO.MAIN_ORG_UNIT,mainOrgUnit.getId());
  }
  if (secondaryOrgUnits != null) {
    HashSet<Integer> secondaryOrgUnitIds=new HashSet<Integer>();
    for (    OrgUnitDTO secondaryOrgUnit : secondaryOrgUnits) {
      secondaryOrgUnitIds.add(secondaryOrgUnit.getId());
    }
    properties.put(ContactDTO.SECONDARY_ORG_UNITS,secondaryOrgUnitIds);
  }
  return properties;
}
Program: 35483
Project: 35483
Buggy source:
@Override public void onSuccess(ListResult<OrgUnitDTO> result){
  mainOrgUnitComboBox.getStore().add(result.getList());
  secondaryOrgUnitsComboBox.getAvailableValuesStore().add(result.getList());
}

Fixed version (ground truth):
@Override public void onSuccess(ListResult<OrgUnitDTO> result){
  for (  OrgUnitDTO orgUnitDTO : result.getData()) {
    fillOrgUnitsComboboxes(orgUnitDTO,mainOrgUnitComboBox,secondaryOrgUnitsComboBox);
  }
}
Program: 35488
Project: 35488
Buggy source:
private Button generateFirstStepMainButton(){
  Button button;
  if (createContact) {
    button=new Button(I18N.CONSTANTS.dedupeContactCreateNewButton());
  }
 else {
    button=new Button(I18N.CONSTANTS.dedupeContactUpdateIndependently());
  }
  button.addSelectionListener(new SelectionListener<ButtonEvent>(){
    @Override public void componentSelected(    ButtonEvent ce){
      secondStepHandler.handleDedupeContact(selectedContact.getId(),selectedProperties);
    }
  }
);
  return button;
}

Fixed version (ground truth):
private Button generateFirstStepMainButton(){
  Button button;
  if (createContact) {
    button=new Button(I18N.CONSTANTS.dedupeContactCreateNewButton());
  }
 else {
    button=new Button(I18N.CONSTANTS.dedupeContactUpdateIndependently());
  }
  return button;
}
Program: 35489
Project: 35489
Buggy source:
@Override public void componentSelected(ButtonEvent event){
  if (!formPanel.isValid()) {
    return;
  }
  createContactHandler.handleContactCreation(contactModelComboBox.getValue(),loginField.getValue(),firstNameField.getValue(),familyNameField.getValue(),organizationNameField.getValue(),mainOrgUnitComboBox.getValue(),secondaryOrgUnitsComboBox.getListStore().getModels());
  window.hide();
}

Fixed version (ground truth):
@Override public void componentSelected(ButtonEvent event){
  if (!formPanel.isValid()) {
    return;
  }
  createContactHandler.handleContactCreation(contactModelComboBox.getValue(),firstNameField.getValue(),familyNameField.getValue(),organizationNameField.getValue(),mainOrgUnitComboBox.getValue(),secondaryOrgUnitsComboBox.getListStore().getModels());
  window.hide();
}
Program: 35490
Project: 35490
Buggy source:
void handleContactCreation(ContactModelDTO contactModelDTO,String login,String firstName,String familyName,String organizationName,OrgUnitDTO mainOrgUnit,List<OrgUnitDTO> secondaryOrgUnits);

Fixed version (ground truth):
void handleContactCreation(ContactModelDTO contactModelDTO,String firstName,String familyName,String organizationName,OrgUnitDTO mainOrgUnit,List<OrgUnitDTO> secondaryOrgUnits);
Program: 35492
Project: 35492
Buggy source:
@Override public void onSuccess(ListResult<OrgUnitDTO> result){
  mainOrgUnitComboBox.getStore().add(result.getList());
  secondaryOrgUnitsComboBox.getAvailableValuesStore().add(result.getList());
}

Fixed version (ground truth):
@Override public void onSuccess(ListResult<OrgUnitDTO> result){
  for (  OrgUnitDTO orgUnitDTO : result.getData()) {
    fillOrgUnitsComboboxes(orgUnitDTO,mainOrgUnitComboBox,secondaryOrgUnitsComboBox);
  }
}
Program: 35493
Project: 35493
Buggy source:
@Override protected ListResult<ContactDuplicatedProperty> execute(GetContactDuplicatedProperties command,UserDispatch.UserExecutionContext context) throws CommandException {
  Contact newContact;
  Contact oldContact;
  if (command.getNewContactId() != null) {
    newContact=contactDAO.findById(command.getNewContactId());
  }
 else {
    newContact=contactService.create(new PropertyMap(command.getNewContactProperties()),context);
  }
  oldContact=contactDAO.findById(command.getOldContactId());
  List<ContactDuplicatedProperty> duplicatedProperties=contactDuplicationService.extractProperties(newContact,oldContact,context.getLanguage());
  return new ListResult<>(duplicatedProperties);
}

Fixed version (ground truth):
@Override protected ListResult<ContactDuplicatedProperty> execute(GetContactDuplicatedProperties command,UserDispatch.UserExecutionContext context) throws CommandException {
  Contact newContact;
  Contact oldContact;
  if (command.getNewContactId() != null) {
    newContact=contactDAO.findById(command.getNewContactId());
  }
 else {
    newContact=contactService.createVirtual(new PropertyMap(command.getNewContactProperties()),context);
  }
  oldContact=contactDAO.findById(command.getOldContactId());
  List<ContactDuplicatedProperty> duplicatedProperties=contactDuplicationService.extractProperties(newContact,oldContact,context.getLanguage());
  return new ListResult<>(duplicatedProperties);
}
Program: 35495
Project: 35495
Buggy source:
@Override public void handleEvent(BaseEvent be){
  final Date date=dateField.getValue();
  if (date == null) {
    if (getValidates()) {
      handlerManager.fireEvent(new RequiredValueEvent(false));
    }
    if (allowBlank) {
      fireEvents("String_Node_Str",false);
    }
    return;
  }
  final String rawValue=String.valueOf(date.getTime());
  final boolean isValueOn=true;
  if (!(!allowBlank && !isValueOn)) {
    fireEvents(rawValue,isValueOn);
  }
}

Fixed version (ground truth):
@Override public void handleEvent(BaseEvent be){
  String rawValue=textArea.getValue();
  if (rawValue == null) {
    rawValue="String_Node_Str";
  }
  final boolean isValueOn=!rawValue.trim().equals("String_Node_Str") && !(rawValue.length() > size);
  fireEvents(rawValue,isValueOn);
}
Program: 35496
Project: 35496
Buggy source:
private HashMap<String,Object> buildPropertyMap(ContactModelDTO contactModelDTO,String login,String firstName,String familyName,String organizationName,OrgUnitDTO mainOrgUnit,List<OrgUnitDTO> secondaryOrgUnits){
  HashMap<String,Object> properties=new HashMap<String,Object>();
  properties.put(ContactDTO.CONTACT_MODEL,contactModelDTO.getId());
  properties.put(ContactDTO.LOGIN,login);
  properties.put(ContactDTO.FIRSTNAME,contactModelDTO.getType() == ContactModelType.INDIVIDUAL ? firstName : null);
  properties.put(ContactDTO.NAME,contactModelDTO.getType() == ContactModelType.INDIVIDUAL ? familyName : organizationName);
  if (mainOrgUnit != null) {
    properties.put(ContactDTO.MAIN_ORG_UNIT,mainOrgUnit.getId());
  }
  if (secondaryOrgUnits != null) {
    HashSet<Integer> secondaryOrgUnitIds=new HashSet<Integer>();
    for (    OrgUnitDTO secondaryOrgUnit : secondaryOrgUnits) {
      secondaryOrgUnitIds.add(secondaryOrgUnit.getId());
    }
    properties.put(ContactDTO.SECONDARY_ORG_UNITS,secondaryOrgUnitIds);
  }
  return properties;
}

Fixed version (ground truth):
private HashMap<String,Object> buildPropertyMap(ContactModelDTO contactModelDTO,String firstName,String familyName,String organizationName,OrgUnitDTO mainOrgUnit,List<OrgUnitDTO> secondaryOrgUnits){
  HashMap<String,Object> properties=new HashMap<String,Object>();
  properties.put(ContactDTO.CONTACT_MODEL,contactModelDTO.getId());
  properties.put(ContactDTO.FIRSTNAME,contactModelDTO.getType() == ContactModelType.INDIVIDUAL ? firstName : null);
  properties.put(ContactDTO.NAME,contactModelDTO.getType() == ContactModelType.INDIVIDUAL ? familyName : organizationName);
  if (mainOrgUnit != null) {
    properties.put(ContactDTO.MAIN_ORG_UNIT,mainOrgUnit.getId());
  }
  if (secondaryOrgUnits != null) {
    HashSet<Integer> secondaryOrgUnitIds=new HashSet<Integer>();
    for (    OrgUnitDTO secondaryOrgUnit : secondaryOrgUnits) {
      secondaryOrgUnitIds.add(secondaryOrgUnit.getId());
    }
    properties.put(ContactDTO.SECONDARY_ORG_UNITS,secondaryOrgUnitIds);
  }
  return properties;
}
Program: 35499
Project: 35499
Buggy source:
private Field<?> buildPostalAddressField(String postalAddress,boolean enabled){
  return buildTextField(I18N.CONSTANTS.contactPostalAddress(),postalAddress,50,enabled,true);
}

Fixed version (ground truth):
private Field<?> buildPostalAddressField(String postalAddress,boolean enabled){
  return buildParagraphField(I18N.CONSTANTS.contactPostalAddress(),postalAddress,50,enabled,true);
}