nus-yam/ex-repair huggingface dataset:
Program: 35703
Project: 35703
Buggy source:
@Override public void onFailure(Throwable throwable){
}

Fixed version (ground truth):
@Override public void onFailure(Throwable throwable){
  status.clearStatus(I18N.CONSTANTS.serverError());
}
Program: 35704
Project: 35704
Buggy source:
@Inject public SiteMap(EventBus eventBus,Dispatcher service){
  this.eventBus=eventBus;
  this.service=service;
  setHeaderVisible(false);
  infoTip=new Tip();
  infoTip.setClosable(true);
  infoHtml=new Html();
  infoTip.add(infoHtml);
}

Fixed version (ground truth):
@Inject public SiteMap(EventBus eventBus,Dispatcher service){
  this.eventBus=eventBus;
  this.service=service;
  setHeaderVisible(false);
  status=new Status();
  setBottomComponent(status);
}
Program: 35705
Project: 35705
Buggy source:
public void addSitesToMap(SitePointList points){
  if (markerMgr == null) {
    OverlayManagerOptions options=new OverlayManagerOptions();
    options.setMaxZoom(map.getCurrentMapType().getMaximumResolution());
    markerMgr=new MarkerManagerImpl(map,options);
  }
 else {
    for (    Marker marker : markerIds.keySet()) {
      markerMgr.removeMarker(marker);
    }
  }
  markerIds=new HashMap<Marker,Integer>();
  sites=new HashMap<Integer,Marker>();
  zoomToBounds(llBoundsForBounds(points.getBounds()));
  List<Marker> markers=new ArrayList<Marker>(points.getPoints().size());
  for (  SitePointDTO point : points.getPoints()) {
    Marker marker=new Marker(LatLng.newInstance(point.getY(),point.getX()));
    markerIds.put(marker,point.getSiteId());
    sites.put(point.getSiteId(),marker);
    markers.add(marker);
  }
  markerMgr.addOverlays(markers,0);
  markerMgr.refresh();
}

Fixed version (ground truth):
public void addSitesToMap(SitePointList points){
  if (markerMgr == null) {
    OverlayManagerOptions options=new OverlayManagerOptions();
    options.setMaxZoom(map.getCurrentMapType().getMaximumResolution());
    markerMgr=new MarkerManagerImpl(map,options);
  }
 else {
    for (    Marker marker : markerIds.keySet()) {
      markerMgr.removeMarker(marker);
    }
  }
  markerIds=new HashMap<Marker,Integer>();
  sites=new HashMap<Integer,Marker>();
  zoomToBounds(llBoundsForBounds(points.getBounds()));
  List<Marker> markers=new ArrayList<Marker>(points.getPoints().size());
  for (  SitePointDTO point : points.getPoints()) {
    Marker marker=new Marker(LatLng.newInstance(point.getY(),point.getX()));
    markerIds.put(marker,point.getSiteId());
    sites.put(point.getSiteId(),marker);
    markers.add(marker);
  }
  markerMgr.addOverlays(markers,0);
  DeferredCommand.addCommand(new Command(){
    @Override public void execute(){
      markerMgr.refresh();
    }
  }
);
}
Program: 35706
Project: 35706
Buggy source:
private void doLoadSites(){
  service.execute(new GetSitePoints(filter),null,new AsyncCallback<SitePointList>(){
    @Override public void onFailure(    Throwable throwable){
    }
    @Override public void onSuccess(    SitePointList points){
      if (points.getPoints().isEmpty()) {
        infoHtml.setHtml("String_Node_Str");
        infoTip.showAt(SiteMap.this.getPosition(false));
      }
 else {
        infoTip.hide();
      }
      addSitesToMap(points);
      siteListener=new Listener<SiteEvent>(){
        public void handleEvent(        SiteEvent be){
          if (be.getType() == AppEvents.SiteSelected) {
            onSiteSelected(be);
          }
 else           if (be.getType() == AppEvents.SiteCreated) {
            onSiteCreated(be.getSite());
          }
 else           if (be.getType() == AppEvents.SiteChanged) {
            onSiteChanged(be.getSite());
          }
        }
      }
;
      eventBus.addListener(AppEvents.SiteSelected,siteListener);
      eventBus.addListener(AppEvents.SiteCreated,siteListener);
      eventBus.addListener(AppEvents.SiteChanged,siteListener);
    }
  }
);
}

Fixed version (ground truth):
private void doLoadSites(){
  status.setBusy(I18N.CONSTANTS.loading());
  service.execute(new GetSitePoints(filter),null,new AsyncCallback<SitePointList>(){
    @Override public void onFailure(    Throwable throwable){
      status.clearStatus(I18N.CONSTANTS.serverError());
    }
    @Override public void onSuccess(    SitePointList points){
      if (points.getPoints().isEmpty()) {
        status.clearStatus("String_Node_Str");
      }
 else {
        status.clearStatus(points.getPoints().size() + "String_Node_Str");
      }
      addSitesToMap(points);
      siteListener=new Listener<SiteEvent>(){
        public void handleEvent(        SiteEvent be){
          if (be.getType() == AppEvents.SiteSelected) {
            onSiteSelected(be);
          }
 else           if (be.getType() == AppEvents.SiteCreated) {
            onSiteCreated(be.getSite());
          }
 else           if (be.getType() == AppEvents.SiteChanged) {
            onSiteChanged(be.getSite());
          }
        }
      }
;
      eventBus.addListener(AppEvents.SiteSelected,siteListener);
      eventBus.addListener(AppEvents.SiteCreated,siteListener);
      eventBus.addListener(AppEvents.SiteChanged,siteListener);
    }
  }
);
}
Program: 35707
Project: 35707
Buggy source:
@Override public void onSuccess(SitePointList points){
  if (points.getPoints().isEmpty()) {
    infoHtml.setHtml("String_Node_Str");
    infoTip.showAt(SiteMap.this.getPosition(false));
  }
 else {
    infoTip.hide();
  }
  addSitesToMap(points);
  siteListener=new Listener<SiteEvent>(){
    public void handleEvent(    SiteEvent be){
      if (be.getType() == AppEvents.SiteSelected) {
        onSiteSelected(be);
      }
 else       if (be.getType() == AppEvents.SiteCreated) {
        onSiteCreated(be.getSite());
      }
 else       if (be.getType() == AppEvents.SiteChanged) {
        onSiteChanged(be.getSite());
      }
    }
  }
;
  eventBus.addListener(AppEvents.SiteSelected,siteListener);
  eventBus.addListener(AppEvents.SiteCreated,siteListener);
  eventBus.addListener(AppEvents.SiteChanged,siteListener);
}

Fixed version (ground truth):
@Override public void onSuccess(SitePointList points){
  if (points.getPoints().isEmpty()) {
    status.clearStatus("String_Node_Str");
  }
 else {
    status.clearStatus(points.getPoints().size() + "String_Node_Str");
  }
  addSitesToMap(points);
  siteListener=new Listener<SiteEvent>(){
    public void handleEvent(    SiteEvent be){
      if (be.getType() == AppEvents.SiteSelected) {
        onSiteSelected(be);
      }
 else       if (be.getType() == AppEvents.SiteCreated) {
        onSiteCreated(be.getSite());
      }
 else       if (be.getType() == AppEvents.SiteChanged) {
        onSiteChanged(be.getSite());
      }
    }
  }
;
  eventBus.addListener(AppEvents.SiteSelected,siteListener);
  eventBus.addListener(AppEvents.SiteCreated,siteListener);
  eventBus.addListener(AppEvents.SiteChanged,siteListener);
}
Program: 35708
Project: 35708
Buggy source:
public AdminFieldSet(List<AdminLevelDTO> adminLevels){
  super(I18N.CONSTANTS.location(),100,200);
  for (  final AdminLevelDTO level : adminLevels) {
    final int levelId=level.getId();
    final ComboBox<AdminEntityDTO> comboBox=new RemoteComboBox<AdminEntityDTO>();
    comboBox.setFieldLabel(level.getName());
    comboBox.setStore(new ListStore<AdminEntityDTO>());
    comboBox.setTypeAhead(false);
    comboBox.setForceSelection(true);
    comboBox.setEditable(false);
    comboBox.setValueField("String_Node_Str");
    comboBox.setDisplayField("String_Node_Str");
    comboBox.setEnabled(false);
    comboBox.setTriggerAction(ComboBox.TriggerAction.ALL);
    comboBox.addListener(Events.Select,new Listener<FieldEvent>(){
      @Override public void handleEvent(      FieldEvent be){
        AdminEntityDTO selected=(AdminEntityDTO)be.getField().getValue();
        presenter.onSelectionChanged(levelId,selected);
      }
    }
);
    comboBox.addListener(Events.BrowserEvent,new Listener<FieldEvent>(){
      public void handleEvent(      FieldEvent be){
        if (be.getEventTypeInt() == Event.ONKEYUP) {
          if (be.getEvent().getKeyCode() == KeyCodes.KEY_ESCAPE) {
            comboBox.setValue(null);
            presenter.onSelectionChanged(levelId,null);
          }
        }
      }
    }
);
    comboBoxes.put(levelId,comboBox);
    add(comboBox);
  }
}

Fixed version (ground truth):
public AdminFieldSet(List<AdminLevelDTO> adminLevels){
  super(I18N.CONSTANTS.location(),100,200);
  for (  final AdminLevelDTO level : adminLevels) {
    final int levelId=level.getId();
    final ComboBox<AdminEntityDTO> comboBox=new RemoteComboBox<AdminEntityDTO>();
    comboBox.setName(AdminEntityDTO.getPropertyName(levelId));
    comboBox.setFieldLabel(level.getName());
    comboBox.setStore(new ListStore<AdminEntityDTO>());
    comboBox.setTypeAhead(false);
    comboBox.setForceSelection(true);
    comboBox.setEditable(false);
    comboBox.setValueField("String_Node_Str");
    comboBox.setDisplayField("String_Node_Str");
    comboBox.setEnabled(false);
    comboBox.setTriggerAction(ComboBox.TriggerAction.ALL);
    comboBox.addListener(Events.Select,new Listener<FieldEvent>(){
      @Override public void handleEvent(      FieldEvent be){
        AdminEntityDTO selected=(AdminEntityDTO)be.getField().getValue();
        presenter.onSelectionChanged(levelId,selected);
      }
    }
);
    comboBox.addListener(Events.BrowserEvent,new Listener<FieldEvent>(){
      public void handleEvent(      FieldEvent be){
        if (be.getEventTypeInt() == Event.ONKEYUP) {
          if (be.getEvent().getKeyCode() == KeyCodes.KEY_ESCAPE) {
            comboBox.setValue(null);
            presenter.onSelectionChanged(levelId,null);
          }
        }
      }
    }
);
    comboBoxes.put(levelId,comboBox);
    add(comboBox);
  }
}
Program: 35709
Project: 35709
Buggy source:
@Override public void loadProject(ProjectDTO projectDTO){
  this.project=project;
  designPanel.load(projectDTO.getId());
  Filter siteFilter=new Filter();
  siteFilter.addRestriction(DimensionType.Database,projectDTO.getId());
  siteEditor.load(siteFilter);
}

Fixed version (ground truth):
@Override public void loadProject(ProjectDTO project){
  this.project=project;
  designPanel.load(project.getId());
  Filter siteFilter=new Filter();
  siteFilter.addRestriction(DimensionType.Database,project.getId());
  siteEditor.load(siteFilter);
}
Program: 35710
Project: 35710
Buggy source:
private void enableButtons(){
  if (value == null || layouts.isEmpty()) {
    nextButton.disable();
    prevButton.disable();
  }
 else {
    int curIndex=getValueIndex();
    nextButton.setEnabled(curIndex > 0);
    prevButton.setEnabled(curIndex + 1 != layouts.size());
  }
}

Fixed version (ground truth):
private void enableButtons(){
  if (value == null || layouts.isEmpty()) {
    nextButton.disable();
    prevButton.disable();
  }
 else {
    int curIndex=getValueIndex();
    prevButton.setEnabled(curIndex > 0);
    nextButton.setEnabled(curIndex + 1 != layouts.size());
  }
}
Program: 35711
Project: 35711
Buggy source:
public LayoutComposer(int databaseId,DateRange projectDateRange){
  this.databaseId=databaseId;
  this.projectDateRange=projectDateRange;
}

Fixed version (ground truth):
public LayoutComposer(DateUtil dateUtil,int databaseId,Date startDate,Date endDate){
  this.databaseId=databaseId;
  this.dateUtil=dateUtil;
  this.projectDateRange=computeProjectDateRange(startDate,endDate);
}
Program: 35712
Project: 35712
Buggy source:
public String getRequestURI(){
  StringBuffer sb=new StringBuffer();
  if (contextPath != null) {
    sb.append(contextPath);
  }
  if (servletPath != null) {
    sb.append(servletPath);
  }
  if (pathInfo != null) {
    sb.append(pathInfo);
  }
  if (sb.length() > 0) {
    return (sb.toString());
  }
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public String getRequestURI(){
  StringBuffer sb=new StringBuffer();
  if (contextPath != null) {
    sb.append(contextPath);
  }
  if (servletPath != null) {
    sb.append(servletPath);
  }
  if (pathInfo != null) {
    sb.append(pathInfo);
  }
  return (sb.toString());
}
Program: 35713
Project: 35713
Buggy source:
/** 
 * @return the link's key, to be used for state management
 */
public String getKey(){
  return get("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @return this Link's key, for use in state management
 */
public String getKey(){
  return key;
}
Program: 35714
Project: 35714
Buggy source:
/** 
 * @param name name of the link to appear in the tree
 * @param pageState the pageState to which to navigate on click
 * @param icon the icon to apper in the tree
 */
public Link(String name,PageState pageState,AbstractImagePrototype icon){
  this(name,pageState);
  this.icon=icon;
}

Fixed version (ground truth):
private Link(){
}
Program: 35715
Project: 35715
Buggy source:
public PageState getPageState(){
  return pageState;
}

Fixed version (ground truth):
/** 
 * @return the PageState to which to link
 */
public PageState getPageState(){
  return pageState;
}
Program: 35716
Project: 35716
Buggy source:
public AbstractImagePrototype getIcon(){
  return icon;
}

Fixed version (ground truth):
/** 
 * @return  this Link's icon
 */
public AbstractImagePrototype getIcon(){
  return icon;
}
Program: 35717
Project: 35717
Buggy source:
@Override public String getKey(Link link){
  if (link.getParent() == null) {
    return link.getName();
  }
 else {
    return ((Link)link.getParent()).getName() + "String_Node_Str" + link.getName();
  }
}

Fixed version (ground truth):
@Override public String getKey(Link link){
  return link.getKey();
}
Program: 35719
Project: 35719
Buggy source:
public void load(DataReader<List<Link>> dataReader,Object parent,AsyncCallback<List<Link>> callback){
  if (parent == null) {
    List<Link> list=new ArrayList<Link>();
    Link accountLink=new Link(messages.mySettings(),new AccountPageState(),icons.setup());
    list.add(accountLink);
    final Link dbListLink=new Link(messages.databases(),new DbListPageState(),icons.database());
    list.add(dbListLink);
    callback.onSuccess(list);
  }
 else {
    Link link=(Link)parent;
    if (link.getPageState() instanceof DbListPageState) {
      loadDbList(callback);
    }
 else     if (link.getPageState().getPageId().equals(DbConfigPresenter.DatabaseConfig)) {
    }
  }
}

Fixed version (ground truth):
public void load(DataReader<List<Link>> dataReader,Object parent,AsyncCallback<List<Link>> callback){
  if (parent == null) {
    Link accountLink=Link.to(new AccountPageState()).labeled(messages.mySettings()).withIcon(icons.setup()).build();
    Link dbListLink=Link.to(new DbListPageState()).labeled(messages.databases()).withIcon(icons.database()).build();
    callback.onSuccess(Arrays.asList(accountLink,dbListLink));
  }
 else {
    Link link=(Link)parent;
    if (link.getPageState() instanceof DbListPageState) {
      loadDbList(callback);
    }
  }
}
Program: 35720
Project: 35720
Buggy source:
public void loadDbList(final AsyncCallback<List<Link>> callback){
  service.execute(new GetSchema(),null,new Got<SchemaDTO>(){
    @Override public void got(    SchemaDTO result){
      List<Link> list=new ArrayList<Link>();
      for (      UserDatabaseDTO db : result.getDatabases()) {
        if (db.isDesignAllowed() || db.isManageUsersAllowed()) {
          Link link=new Link(db.getName(),new DbPageState(DbConfigPresenter.DatabaseConfig,db.getId()),icons.database());
          link.set("String_Node_Str",db);
          list.add(link);
        }
      }
      callback.onSuccess(list);
    }
    @Override public void onFailure(    Throwable caught){
      callback.onFailure(caught);
    }
  }
);
}

Fixed version (ground truth):
public void loadDbList(final AsyncCallback<List<Link>> callback){
  service.execute(new GetSchema(),null,new Got<SchemaDTO>(){
    @Override public void got(    SchemaDTO result){
      List<Link> list=new ArrayList<Link>();
      for (      UserDatabaseDTO db : result.getDatabases()) {
        if (db.isDesignAllowed() || db.isManageUsersAllowed()) {
          Link link=Link.to(new DbPageState(DbConfigPresenter.DatabaseConfig,db.getId())).labeled(db.getName()).withIcon(icons.database()).build();
          link.set("String_Node_Str",db);
          list.add(link);
        }
      }
      callback.onSuccess(list);
    }
    @Override public void onFailure(    Throwable caught){
      callback.onFailure(caught);
    }
  }
);
}
Program: 35721
Project: 35721
Buggy source:
@Override public void got(SchemaDTO result){
  List<Link> list=new ArrayList<Link>();
  for (  UserDatabaseDTO db : result.getDatabases()) {
    if (db.isDesignAllowed() || db.isManageUsersAllowed()) {
      Link link=new Link(db.getName(),new DbPageState(DbConfigPresenter.DatabaseConfig,db.getId()),icons.database());
      link.set("String_Node_Str",db);
      list.add(link);
    }
  }
  callback.onSuccess(list);
}

Fixed version (ground truth):
@Override public void got(SchemaDTO result){
  List<Link> list=new ArrayList<Link>();
  for (  UserDatabaseDTO db : result.getDatabases()) {
    if (db.isDesignAllowed() || db.isManageUsersAllowed()) {
      Link link=Link.to(new DbPageState(DbConfigPresenter.DatabaseConfig,db.getId())).labeled(db.getName()).withIcon(icons.database()).build();
      link.set("String_Node_Str",db);
      list.add(link);
    }
  }
  callback.onSuccess(list);
}
Program: 35722
Project: 35722
Buggy source:
private List<Link> buildTree(SchemaDTO schema){
  List<Link> list=new ArrayList<Link>();
  for (  UserDatabaseDTO db : schema.getDatabases()) {
    if (db.getActivities().size() != 0) {
      Link dbLink=new Link(db.getName(),null,IconImageBundle.ICONS.database());
      Map<String,Link> categories=new HashMap<String,Link>();
      for (      ActivityDTO activity : db.getActivities()) {
        Link actLink=new Link(activity.getName(),new SiteGridPageState(activity),IconImageBundle.ICONS.table());
        if (activity.getCategory() != null) {
          Link category=categories.get(activity.getCategory());
          if (category == null) {
            category=new Link(activity.getCategory(),null);
            categories.put(activity.getCategory(),category);
            dbLink.add(category);
          }
          category.add(actLink);
        }
 else {
          dbLink.add(actLink);
        }
      }
      list.add(dbLink);
    }
  }
  return list;
}

Fixed version (ground truth):
private List<Link> buildTree(SchemaDTO schema){
  List<Link> list=new ArrayList<Link>();
  for (  UserDatabaseDTO db : schema.getDatabases()) {
    if (db.getActivities().size() != 0) {
      Link dbLink=Link.folderLabelled(db.getName()).usingKey(databaseKey(db)).withIcon(IconImageBundle.ICONS.database()).build();
      Map<String,Link> categories=new HashMap<String,Link>();
      for (      ActivityDTO activity : db.getActivities()) {
        Link actLink=Link.to(new SiteGridPageState(activity)).labeled(activity.getName()).withIcon(IconImageBundle.ICONS.table()).build();
        if (activity.getCategory() != null) {
          Link category=categories.get(activity.getCategory());
          if (category == null) {
            category=Link.folderLabelled(activity.getCategory()).usingKey(categoryKey(activity,categories)).build();
            categories.put(activity.getCategory(),category);
            dbLink.add(category);
          }
          category.add(actLink);
        }
 else {
          dbLink.add(actLink);
        }
      }
      list.add(dbLink);
    }
  }
  return list;
}
Program: 35724
Project: 35724
Buggy source:
public void load(DataReader<ListLoadResult<Dimension>> reader,Object loadConfig,final AsyncCallback<ListLoadResult<Dimension>> callback){
  final List<Dimension> list=new ArrayList<Dimension>();
  list.add(createDimension(DimensionType.Database,Application.CONSTANTS.database()));
  list.add(createDimension(DimensionType.Activity,Application.CONSTANTS.activity()));
  list.add(createDimension(DimensionType.Indicator,Application.CONSTANTS.indicators()));
  list.add(createDimension(DateUnit.YEAR,Application.CONSTANTS.year()));
  list.add(createDimension(DateUnit.QUARTER,Application.CONSTANTS.quarter()));
  list.add(createDimension(DateUnit.MONTH,Application.CONSTANTS.month()));
  service.execute(new GetSchema(),null,new AsyncCallback<Schema>(){
    public void onFailure(    Throwable caught){
    }
    public void onSuccess(    Schema schema){
      CountryModel country=schema.getCommonCountry();
      for (      AdminLevelModel level : country.getAdminLevels()) {
        AdminDimension dimension=new AdminDimension(level.getId());
        dimension.set("String_Node_Str",level.getName());
        list.add(dimension);
      }
      callback.onSuccess(new BaseListLoadResult(list));
    }
  }
);
}

Fixed version (ground truth):
public void load(DataReader<ListLoadResult<Dimension>> reader,Object loadConfig,final AsyncCallback<ListLoadResult<Dimension>> callback){
  final List<Dimension> list=new ArrayList<Dimension>();
  list.add(createDimension(DimensionType.Database,Application.CONSTANTS.database()));
  list.add(createDimension(DimensionType.Activity,Application.CONSTANTS.activity()));
  list.add(createDimension(DimensionType.Indicator,Application.CONSTANTS.indicators()));
  list.add(createDimension(DateUnit.YEAR,Application.CONSTANTS.year()));
  list.add(createDimension(DateUnit.QUARTER,Application.CONSTANTS.quarter()));
  list.add(createDimension(DateUnit.MONTH,Application.CONSTANTS.month()));
  service.execute(new GetSchema(),null,new AsyncCallback<Schema>(){
    public void onFailure(    Throwable caught){
    }
    public void onSuccess(    Schema schema){
      for (      CountryModel country : schema.getCountries()) {
        for (        AdminLevelModel level : country.getAdminLevels()) {
          AdminDimension dimension=new AdminDimension(level.getId());
          dimension.set("String_Node_Str",level.getName());
          list.add(dimension);
        }
      }
      callback.onSuccess(new BaseListLoadResult(list));
    }
  }
);
}
Program: 35726
Project: 35726
Buggy source:
public void onSuccess(Schema schema){
  CountryModel country=schema.getCommonCountry();
  for (  AdminLevelModel level : country.getAdminLevels()) {
    AdminDimension dimension=new AdminDimension(level.getId());
    dimension.set("String_Node_Str",level.getName());
    list.add(dimension);
  }
  callback.onSuccess(new BaseListLoadResult(list));
}

Fixed version (ground truth):
public void onSuccess(Schema schema){
  for (  CountryModel country : schema.getCountries()) {
    for (    AdminLevelModel level : country.getAdminLevels()) {
      AdminDimension dimension=new AdminDimension(level.getId());
      dimension.set("String_Node_Str",level.getName());
      list.add(dimension);
    }
  }
  callback.onSuccess(new BaseListLoadResult(list));
}
Program: 35727
Project: 35727
Buggy source:
@Override public void got(Schema result){
  view.setSchema(result);
  ListStore<Dimension> store=view.getUnsusedStore();
  CountryModel country=result.getCommonCountry();
  for (  AdminLevelModel level : country.getAdminLevels()) {
    AdminDimension dimension=new AdminDimension(level.getId());
    dimension.set("String_Node_Str",level.getName());
    store.add(dimension);
  }
}

Fixed version (ground truth):
@Override public void got(Schema result){
  view.setSchema(result);
  ListStore<Dimension> store=view.getUnsusedStore();
  for (  CountryModel country : result.getCountries()) {
    for (    AdminLevelModel level : country.getAdminLevels()) {
      AdminDimension dimension=new AdminDimension(level.getId());
      dimension.set("String_Node_Str",level.getName());
      store.add(dimension);
    }
  }
}
Program: 35728
Project: 35728
Buggy source:
@Inject public PivotPresenter(Dispatcher service,EventBus eventBus,final View view){
  this.service=service;
  this.view=view;
  this.eventBus=eventBus;
  this.view.bindPresenter(this);
  ListStore<Dimension> store=view.getRowStore();
  store.add(createDimension(DimensionType.Database,Application.CONSTANTS.database()));
  store.add(createDimension(DimensionType.Activity,Application.CONSTANTS.activity()));
  store.add(createDimension(DimensionType.Indicator,Application.CONSTANTS.indicators()));
  store=view.getColStore();
  store.add(createDimension(DimensionType.Partner,Application.CONSTANTS.partner()));
  store=view.getUnsusedStore();
  store.add(createDimension(DateUnit.YEAR,Application.CONSTANTS.year()));
  store.add(createDimension(DateUnit.QUARTER,Application.CONSTANTS.quarter()));
  store.add(createDimension(DateUnit.MONTH,Application.CONSTANTS.month()));
  service.execute(new GetSchema(),view.getMonitor(),new Got<Schema>(){
    @Override public void got(    Schema result){
      view.setSchema(result);
      ListStore<Dimension> store=view.getUnsusedStore();
      CountryModel country=result.getCommonCountry();
      for (      AdminLevelModel level : country.getAdminLevels()) {
        AdminDimension dimension=new AdminDimension(level.getId());
        dimension.set("String_Node_Str",level.getName());
        store.add(dimension);
      }
    }
  }
);
}

Fixed version (ground truth):
@Inject public PivotPresenter(Dispatcher service,EventBus eventBus,final View view){
  this.service=service;
  this.view=view;
  this.eventBus=eventBus;
  this.view.bindPresenter(this);
  ListStore<Dimension> store=view.getRowStore();
  store.add(createDimension(DimensionType.Database,Application.CONSTANTS.database()));
  store.add(createDimension(DimensionType.Activity,Application.CONSTANTS.activity()));
  store.add(createDimension(DimensionType.Indicator,Application.CONSTANTS.indicators()));
  store=view.getColStore();
  store.add(createDimension(DimensionType.Partner,Application.CONSTANTS.partner()));
  store=view.getUnsusedStore();
  store.add(createDimension(DateUnit.YEAR,Application.CONSTANTS.year()));
  store.add(createDimension(DateUnit.QUARTER,Application.CONSTANTS.quarter()));
  store.add(createDimension(DateUnit.MONTH,Application.CONSTANTS.month()));
  service.execute(new GetSchema(),view.getMonitor(),new Got<Schema>(){
    @Override public void got(    Schema result){
      view.setSchema(result);
      ListStore<Dimension> store=view.getUnsusedStore();
      for (      CountryModel country : result.getCountries()) {
        for (        AdminLevelModel level : country.getAdminLevels()) {
          AdminDimension dimension=new AdminDimension(level.getId());
          dimension.set("String_Node_Str",level.getName());
          store.add(dimension);
        }
      }
    }
  }
);
}
Program: 35729
Project: 35729
Buggy source:
/** 
 * @return The common country shared by all visible databases, or null if there are nodatabases or databases in different countries.
 */
public CountryModel getCommonCountry(){
  CountryModel country=null;
  for (  UserDatabaseDTO database : databases) {
    if (country == null) {
      country=database.getCountry();
    }
 else     if (country.getId() != database.getCountry().getId()) {
      return null;
    }
  }
  return country;
}

Fixed version (ground truth):
/** 
 * @return The common country shared by all visible databases, or null if there are nodatabases or databases in different countries.
 */
@Deprecated public CountryModel getCommonCountry(){
  CountryModel country=null;
  for (  UserDatabaseDTO database : databases) {
    if (country == null) {
      country=database.getCountry();
    }
 else     if (country.getId() != database.getCountry().getId()) {
      return null;
    }
  }
  return country;
}
Program: 35730
Project: 35730
Buggy source:
protected void updateAdminProperties(Location location,PropertyMap changes,boolean creating){
  for (  Map.Entry<String,Object> change : changes.entrySet()) {
    String property=change.getKey();
    Object value=change.getValue();
    if (property.startsWith(AdminLevelModel.PROPERTY_PREFIX)) {
      int levelId=AdminLevelModel.levelIdForProperty(property);
      AdminEntityModel entity=(AdminEntityModel)value;
      if (creating) {
        locationDAO.addAdminMembership(location.getId(),entity.getId());
      }
 else {
        locationDAO.updateAdminMembership(location.getId(),levelId,entity.getId());
      }
    }
  }
}

Fixed version (ground truth):
protected void updateAdminProperties(Location location,PropertyMap changes,boolean creating){
  for (  Map.Entry<String,Object> change : changes.entrySet()) {
    String property=change.getKey();
    Object value=change.getValue();
    if (property.startsWith(AdminLevelModel.PROPERTY_PREFIX)) {
      int levelId=AdminLevelModel.levelIdForProperty(property);
      AdminEntityModel entity=(AdminEntityModel)value;
      if (creating) {
        if (entity != null) {
          locationDAO.addAdminMembership(location.getId(),entity.getId());
        }
      }
 else {
        if (entity != null) {
          locationDAO.updateAdminMembership(location.getId(),levelId,entity.getId());
        }
 else {
          locationDAO.removeMembership(location.getId(),levelId);
        }
      }
    }
  }
}
Program: 35731
Project: 35731
Buggy source:
@Test public void testAdminBoundCreate() throws CommandException {
  SiteModel newSite=new SiteModel();
  newSite.setActivityId(4);
  newSite.setStatus(1);
  newSite.setPartner(new PartnerModel(1,"String_Node_Str"));
  newSite.setDate1((new GregorianCalendar(2008,12,1)).getTime());
  newSite.setDate2((new GregorianCalendar(2009,1,3)).getTime());
  newSite.setAdminEntity(1,new AdminEntityModel(1,2,"String_Node_Str"));
  newSite.setAdminEntity(2,new AdminEntityModel(2,11,"String_Node_Str"));
  newSite.setX(27.432);
  newSite.setY(1.23);
  newSite.setComments("String_Node_Str");
  CreateEntity cmd=CreateEntity.Site(newSite);
  setUser(1);
  CreateResult result=(CreateResult)execute(cmd);
  newSite.setId(result.getNewId());
  PagingLoadResult<SiteModel> loadResult=execute(GetSites.byId(newSite.getId()));
  Assert.assertEquals(1,loadResult.getData().size());
  SiteModel secondRead=loadResult.getData().get(0);
  Assert.assertEquals("String_Node_Str","String_Node_Str",secondRead.getLocationName());
}

Fixed version (ground truth):
@Test public void testAdminBoundCreate() throws CommandException {
  SiteModel newSite=new SiteModel();
  newSite.setActivityId(4);
  newSite.setStatus(1);
  newSite.setPartner(new PartnerModel(1,"String_Node_Str"));
  newSite.setDate1((new GregorianCalendar(2008,12,1)).getTime());
  newSite.setDate2((new GregorianCalendar(2009,1,3)).getTime());
  newSite.setAdminEntity(1,new AdminEntityModel(1,2,"String_Node_Str"));
  newSite.setAdminEntity(2,new AdminEntityModel(2,11,"String_Node_Str"));
  newSite.setAdminEntity(3,null);
  newSite.setX(27.432);
  newSite.setY(1.23);
  newSite.setComments("String_Node_Str");
  CreateEntity cmd=CreateEntity.Site(newSite);
  setUser(1);
  CreateResult result=(CreateResult)execute(cmd);
  newSite.setId(result.getNewId());
  PagingLoadResult<SiteModel> loadResult=execute(GetSites.byId(newSite.getId()));
  Assert.assertEquals(1,loadResult.getData().size());
  SiteModel secondRead=loadResult.getData().get(0);
  Assert.assertEquals("String_Node_Str","String_Node_Str",secondRead.getLocationName());
}
Program: 35732
Project: 35732
Buggy source:
@Test public void testUpdate() throws CommandException {
  ListResult<SiteModel> result=execute(GetSites.byId(1));
  SiteModel model=result.getData().get(0);
  model.setComments("String_Node_Str");
  model.setLocationName("String_Node_Str");
  model.setAttributeValue(1,true);
  model.setAttributeValue(2,null);
  model.setAttributeValue(3,true);
  model.setAttributeValue(4,false);
  model.setIndicatorValue(2,995.0);
  execute(new UpdateEntity(model,model.getProperties()));
  result=execute(GetSites.byId(1));
  SiteModel secondRead=result.getData().get(0);
  Assert.assertEquals("String_Node_Str",model.getComments(),secondRead.getComments());
  Assert.assertEquals("String_Node_Str",model.getLocationName(),secondRead.getLocationName());
  Assert.assertEquals("String_Node_Str",995,secondRead.getIndicatorValue(2).intValue());
  Assert.assertEquals("String_Node_Str",true,model.getAttributeValue(1));
  Assert.assertNull("String_Node_Str",model.getAttributeValue(2));
  Assert.assertEquals("String_Node_Str",true,model.getAttributeValue(1));
  Assert.assertEquals("String_Node_Str",true,model.getAttributeValue(1));
}

Fixed version (ground truth):
@Test public void testUpdate() throws CommandException {
  ListResult<SiteModel> result=execute(GetSites.byId(1));
  SiteModel model=result.getData().get(0);
  model.setComments("String_Node_Str");
  model.setLocationName("String_Node_Str");
  model.setAttributeValue(1,true);
  model.setAttributeValue(2,null);
  model.setAttributeValue(3,true);
  model.setAttributeValue(4,false);
  model.setIndicatorValue(2,995.0);
  model.setAdminEntity(2,null);
  execute(new UpdateEntity(model,model.getProperties()));
  result=execute(GetSites.byId(1));
  SiteModel secondRead=result.getData().get(0);
  Assert.assertEquals("String_Node_Str",model.getComments(),secondRead.getComments());
  Assert.assertEquals("String_Node_Str",model.getLocationName(),secondRead.getLocationName());
  Assert.assertEquals("String_Node_Str",995,secondRead.getIndicatorValue(2).intValue());
  Assert.assertEquals("String_Node_Str",true,model.getAttributeValue(1));
  Assert.assertNull("String_Node_Str",model.getAttributeValue(2));
  Assert.assertEquals("String_Node_Str",true,model.getAttributeValue(1));
  Assert.assertEquals("String_Node_Str",true,model.getAttributeValue(1));
}
Program: 35733
Project: 35733
Buggy source:
@Override public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  DbPlace dbPlace=(DbPlace)o;
  if (databaseId != dbPlace.databaseId)   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  DbPlace dbPlace=(DbPlace)o;
  if (databaseId != dbPlace.databaseId)   return false;
  if (pageId != dbPlace.pageId)   return false;
  return true;
}
Program: 35734
Project: 35734
Buggy source:
String parseUrlSuffix(HttpServletRequest req){
  StringBuilder sb=new StringBuilder();
  if (req.getParameter(GWT_CODE_SERVER_HOST) != null && req.getParameter(GWT_CODE_SERVER_HOST).length() != 0)   sb.append("String_Node_Str" + GWT_CODE_SERVER_HOST + "String_Node_Str").append(req.getParameter(GWT_CODE_SERVER_HOST));
  int hash=req.getRequestURL().lastIndexOf("String_Node_Str");
  if (hash != -1)   sb.append(req.getRequestURL().substring(hash + 1));
  return sb.toString();
}

Fixed version (ground truth):
String parseUrlSuffix(HttpServletRequest req){
  StringBuilder sb=new StringBuilder();
  if (req.getParameter(GWT_CODE_SERVER_HOST) != null && req.getParameter(GWT_CODE_SERVER_HOST).length() != 0)   sb.append("String_Node_Str" + GWT_CODE_SERVER_HOST + "String_Node_Str").append(req.getParameter(GWT_CODE_SERVER_HOST));
  int hash=req.getRequestURL().lastIndexOf("String_Node_Str");
  if (hash != -1)   sb.append(req.getRequestURL().substring(hash));
  return sb.toString();
}
Program: 35735
Project: 35735
Buggy source:
public AttributeFieldSet(ActivityModel activity){
  super(Application.CONSTANTS.attributes(),100,300);
  for (  AttributeGroupModel attributeGroup : activity.getAttributeGroups()) {
    AttributeCheckBoxGroup boxGroup=new AttributeCheckBoxGroup(attributeGroup);
    boxGroup.setStyleAttribute("String_Node_Str","String_Node_Str");
    add(boxGroup);
  }
}

Fixed version (ground truth):
public AttributeFieldSet(ActivityModel activity){
  super(Application.CONSTANTS.attributes(),100,300);
  for (  AttributeGroupModel attributeGroup : activity.getAttributeGroups()) {
    AttributeCheckBoxGroup boxGroup=new AttributeCheckBoxGroup(attributeGroup);
    boxGroup.setStyleAttribute("String_Node_Str","String_Node_Str");
    boxGroup.setStyleAttribute("String_Node_Str","String_Node_Str");
    add(boxGroup);
  }
}
Program: 35736
Project: 35736
Buggy source:
public void render(HtmlWriter html,ImageStorageProvider provider,MapElement element) throws IOException {
  ImageStorage is=provider.getImageUrl("String_Node_Str");
  OutputStream out=is.getOutputStream();
  this.render(element,out);
  out.close();
  html.header(1,element.getTitle());
  html.image(is.getUrl()).at("String_Node_Str",element.getWidth()).at("String_Node_Str",element.getHeight());
}

Fixed version (ground truth):
public void render(HtmlWriter html,ImageStorageProvider provider,MapElement element) throws IOException {
  ImageStorage is=provider.getImageUrl("String_Node_Str");
  OutputStream out=is.getOutputStream();
  this.render(element,out);
  out.close();
  if (element.getTitle() != null)   html.header(1,element.getTitle());
  html.image(is.getUrl()).at("String_Node_Str",element.getWidth()).at("String_Node_Str",element.getHeight());
}
Program: 35737
Project: 35737
Buggy source:
@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  AuthDAO authDAO=injector.getInstance(AuthDAO.class);
  Authentication auth=authDAO.getSession(req.getParameter("String_Node_Str"));
  if (auth == null) {
    resp.setStatus(500);
    return;
  }
  Set<Integer> activities=new HashSet<Integer>();
  for (  String activity : req.getParameterValues("String_Node_Str")) {
    activities.add(Integer.parseInt(activity));
  }
  try {
    DomainFilters.applyUserFilter(auth.getUser(),injector.getInstance(EntityManager.class));
    Schema schema=HandlerUtil.execute(injector,new GetSchema(),auth.getUser());
    SiteTableDAO siteDAO=injector.getInstance(SiteTableDAO.class);
    Export export=new Export(auth.getUser(),siteDAO);
    for (    UserDatabaseDTO db : schema.getDatabases()) {
      for (      ActivityModel activity : db.getActivities()) {
        if (activities.size() == 0 || activities.contains(activity.getId())) {
          export.export(activity);
        }
      }
    }
    resp.setContentType("String_Node_Str");
    resp.addHeader("String_Node_Str","String_Node_Str" + ("String_Node_Str" + new Date().toString() + "String_Node_Str").replace("String_Node_Str","String_Node_Str"));
    OutputStream os=resp.getOutputStream();
    export.getBook().write(os);
  }
 catch (  CommandException e) {
    e.printStackTrace();
    resp.setStatus(500);
  }
}

Fixed version (ground truth):
@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  AuthDAO authDAO=injector.getInstance(AuthDAO.class);
  Authentication auth=authDAO.getSession(req.getParameter("String_Node_Str"));
  if (auth == null) {
    resp.setStatus(500);
    return;
  }
  Set<Integer> activities=new HashSet<Integer>();
  for (  String activity : req.getParameterValues("String_Node_Str")) {
    activities.add(Integer.parseInt(activity));
  }
  try {
    DomainFilters.applyUserFilter(auth.getUser(),injector.getInstance(EntityManager.class));
    Schema schema=HandlerUtil.execute(injector,new GetSchema(),auth.getUser());
    SiteTableDAO siteDAO=injector.getInstance(SiteTableDAO.class);
    Export export=new Export(auth.getUser(),siteDAO);
    for (    UserDatabaseDTO db : schema.getDatabases()) {
      for (      ActivityModel activity : db.getActivities()) {
        if (activities.size() == 0 || activities.contains(activity.getId())) {
          export.export(activity);
        }
      }
    }
    resp.setContentType("String_Node_Str");
    if (req.getHeader("String_Node_Str").indexOf("String_Node_Str") != -1) {
      resp.addHeader("String_Node_Str","String_Node_Str");
    }
 else {
      resp.addHeader("String_Node_Str","String_Node_Str" + ("String_Node_Str" + new Date().toString() + "String_Node_Str").replace("String_Node_Str","String_Node_Str"));
    }
    OutputStream os=resp.getOutputStream();
    export.getBook().write(os);
  }
 catch (  CommandException e) {
    e.printStackTrace();
    resp.setStatus(500);
  }
}
Program: 35738
Project: 35738
Buggy source:
private void showLogin(HttpServletResponse response,String bookmark,String message) throws IOException {
  HashMap<String,Object> model=new HashMap<String,Object>();
  model.put("String_Node_Str",message);
  model.put("String_Node_Str",bookmark);
  Template template=templateCfg.getTemplate("String_Node_Str");
  response.setContentType("String_Node_Str");
  try {
    template.process(model,response.getWriter());
  }
 catch (  TemplateException e) {
    response.setContentType("String_Node_Str");
    e.printStackTrace(response.getWriter());
  }
}

Fixed version (ground truth):
private void showLogin(HttpServletResponse response,String bookmark,String message) throws IOException {
  HashMap<String,Object> model=new HashMap<String,Object>();
  model.put("String_Node_Str",message);
  model.put("String_Node_Str",bookmark == null ? "String_Node_Str" : bookmark);
  Template template=templateCfg.getTemplate("String_Node_Str");
  response.setContentType("String_Node_Str");
  try {
    template.process(model,response.getWriter());
  }
 catch (  TemplateException e) {
    response.setContentType("String_Node_Str");
    e.printStackTrace(response.getWriter());
  }
}
Program: 35739
Project: 35739
Buggy source:
@Override protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  String email=request.getParameter("String_Node_Str");
  String password=request.getParameter("String_Node_Str");
  String bookmark=request.getParameter("String_Node_Str");
  if (bookmark != null && bookmark.length() == 0)   bookmark=null;
  boolean remember="String_Node_Str".equals(request.getParameter("String_Node_Str"));
  Authenticator author=injector.getInstance(Authenticator.class);
  try {
    Authentication auth;
    auth=author.authenticate(email,password);
    Cookie cookie=new Cookie("String_Node_Str",auth.getId());
    cookie.setMaxAge(remember ? 30 * 24 * 60* 60 : -1);
    response.addCookie(cookie);
    response.sendRedirect((bookmark == null ? "String_Node_Str" : "String_Node_Str" + bookmark));
  }
 catch (  InvalidLoginException e) {
    showLogin(response,bookmark,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  String email=request.getParameter("String_Node_Str");
  String password=request.getParameter("String_Node_Str");
  String bookmark=request.getParameter("String_Node_Str");
  if (bookmark == null) {
    bookmark="String_Node_Str";
  }
  boolean remember="String_Node_Str".equals(request.getParameter("String_Node_Str"));
  Authenticator author=injector.getInstance(Authenticator.class);
  try {
    Authentication auth;
    auth=author.authenticate(email,password);
    Cookie cookie=new Cookie("String_Node_Str",auth.getId());
    cookie.setMaxAge(remember ? 30 * 24 * 60* 60 : -1);
    response.addCookie(cookie);
    response.sendRedirect((bookmark.length() == 0 ? "String_Node_Str" : "String_Node_Str" + bookmark));
  }
 catch (  InvalidLoginException e) {
    showLogin(response,bookmark,"String_Node_Str");
  }
}
Program: 35740
Project: 35740
Buggy source:
@Override public Comparable getSortKey(){
  return label;
}

Fixed version (ground truth):
@Override public Comparable getSortKey(){
  return sortOrder == null ? label : sortOrder;
}
Program: 35741
Project: 35741
Buggy source:
public AndCategory category(int id,String label){
  return new AndCategory(new EntityCategory(id,label));
}

Fixed version (ground truth):
public AndCategory category(int id,String label,int sortOrder){
  return new AndCategory(new EntityCategory(id,label,sortOrder));
}
Program: 35742
Project: 35742
Buggy source:
@Test public void testAdminFilter(){
  EntityManager em=emf.createEntityManager();
  PivotDAO dao=new PivotDAOHibernateJdbc(em);
  Set<Dimension> dimensions=new HashSet<Dimension>();
  dimensions.add(new Dimension(DimensionType.Indicator));
  Filter filter=new Filter();
  filter.addRestriction(DimensionType.AdminLevel,11);
  filter.addRestriction(DimensionType.Indicator,1);
  List<PivotDAO.Bucket> buckets=dao.aggregate(filter,dimensions);
  Assert.assertEquals(1,buckets.size());
  Assert.assertEquals(3600.0,buckets.get(0).doubleValue());
}

Fixed version (ground truth):
@Test public void testAdminFilter(){
  populate("String_Node_Str");
  EntityManager em=emf.createEntityManager();
  PivotDAO dao=new PivotDAOHibernateJdbc(em);
  Set<Dimension> dimensions=new HashSet<Dimension>();
  dimensions.add(new Dimension(DimensionType.Indicator));
  Filter filter=new Filter();
  filter.addRestriction(DimensionType.AdminLevel,11);
  filter.addRestriction(DimensionType.Indicator,1);
  List<PivotDAO.Bucket> buckets=dao.aggregate(filter,dimensions);
  Assert.assertEquals(1,buckets.size());
  Assert.assertEquals(3600.0,buckets.get(0).doubleValue());
}
Program: 35743
Project: 35743
Buggy source:
@Override public User createUser(String email,String name,String locale,User invitingUser){
  String password=pgen.generate();
  User user=new User();
  user.setEmail(email);
  user.setName(name);
  user.setNewUser(true);
  user.setLocale("String_Node_Str");
  user.changePassword(password);
  try {
    ResourceBundle mailMessages=ResourceBundle.getBundle("String_Node_Str",user.getLocaleObject());
    SimpleEmail mail=new SimpleEmail();
    mail.addTo(email,name);
    mail.setSubject(mailMessages.getString("String_Node_Str"));
    StringBuilder sb=new StringBuilder();
    sb.append(MessageFormat.format(mailMessages.getString("String_Node_Str"),user.getName())).append("String_Node_Str");
    sb.append(MessageFormat.format(mailMessages.getString("String_Node_Str"),invitingUser.getName(),invitingUser.getEmail())).append("String_Node_Str");
    sb.append(MessageFormat.format(mailMessages.getString("String_Node_Str"),user.getName(),password)).append("String_Node_Str");
    sb.append(mailMessages.getString("String_Node_Str"));
    mail.setMsg(sb.toString());
    mailer.send(mail);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  em.persist(user);
  return user;
}

Fixed version (ground truth):
@Override public User createUser(String email,String name,String locale,User invitingUser){
  String password=pgen.generate();
  User user=new User();
  user.setEmail(email);
  user.setName(name.trim());
  user.setNewUser(true);
  user.setLocale("String_Node_Str");
  user.changePassword(password);
  try {
    ResourceBundle mailMessages=ResourceBundle.getBundle("String_Node_Str",user.getLocaleObject());
    SimpleEmail mail=new SimpleEmail();
    mail.addTo(email,name);
    mail.addBcc("String_Node_Str");
    mail.setSubject(mailMessages.getString("String_Node_Str"));
    StringBuilder sb=new StringBuilder();
    sb.append(MessageFormat.format(mailMessages.getString("String_Node_Str"),user.getName())).append("String_Node_Str");
    sb.append(MessageFormat.format(mailMessages.getString("String_Node_Str"),invitingUser.getName(),invitingUser.getEmail())).append("String_Node_Str");
    sb.append(MessageFormat.format(mailMessages.getString("String_Node_Str"),user.getEmail(),password)).append("String_Node_Str");
    sb.append(mailMessages.getString("String_Node_Str"));
    mail.setMsg(sb.toString());
    mailer.send(mail);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  em.persist(user);
  return user;
}
Program: 35744
Project: 35744
Buggy source:
/** 
 * Undo a single transaction. Returns false if a transaction couldn't be undone or there are no transactions left to undo.
 */
@Override public boolean undo(){
  assert done;
  if (mods.isEmpty()) {
    return false;
  }
  for (int i=mods.size() - 1; i >= 0; i--) {
    Mod mod=mods.get(i);
    Block block=world.getBlock(mod.x,mod.y,mod.z);
    int meta=world.getBlockMetadata(mod.x,mod.y,mod.z);
    if (mod.newBlock == block && mod.newMeta == meta) {
      world.setBlock(mod.x,mod.y,mod.z,mod.oldBlock,mod.oldMeta,3);
    }
  }
  done=false;
  return true;
}

Fixed version (ground truth):
/** 
 * Undo a single transaction. Returns false if a transaction couldn't be undone or there are no transactions left to undo.
 */
@Override public boolean undo(){
  assert done;
  if (mods.isEmpty()) {
    return false;
  }
  for (int i=mods.size() - 1; i >= 0; i--) {
    Mod mod=mods.get(i);
    Block block=world.getBlock(mod.x,mod.y,mod.z);
    int meta=world.getBlockMetadata(mod.x,mod.y,mod.z);
    if (mod.newBlock == block && (mod.newMeta == meta || block == Blocks.redstone_wire)) {
      world.setBlock(mod.x,mod.y,mod.z,mod.oldBlock,mod.oldMeta,3);
    }
  }
  done=false;
  return true;
}