nus-yam/ex-repair huggingface dataset:
Program: 54011
Project: 54011
Buggy source:
/** 
 * Sets this panel's widget. Any existing child widget will be removed.
 * @param w the panel's new widget, or <code>null</code> to clear the panel
 */
public void setWidget(Widget w);

Fixed version (ground truth):
/** 
 * Sets this panel's widget. Any existing child widget will be removed.
 * @param w the panel's new widget, or <code>null</code> to clear the panel
 */
void setWidget(Widget w);
Program: 54012
Project: 54012
Buggy source:
/** 
 * Validates all constraints placed on the property named <code>propertyName</code> of the class <code>beanType</code> would the property value be <code>value</code> <p/> <code>ConstraintViolation</code> objects return null for  {@link ConstraintViolation#getRootBean()} and{@link ConstraintViolation#getLeafBean()}
 * @param < T > the type of the RootBean for this validation context
 * @param context The gwt validation context
 * @param beanType the bean type
 * @param propertyName property to validate
 * @param value property value to validate
 * @param groups group or list of groups targeted for validation (default to{@link javax.validation.groups.Default})
 * @return constraint violations or an empty Set if none
 * @throws IllegalArgumentException if <code>beanType</code> is null, if<code>propertyName</code> null, empty or not a valid object property or if null is passed to the varargs groups
 * @throws ValidationException if a non recoverable error happens during thevalidation process
 */
<T>Set<ConstraintViolation<T>> validateValue(GwtValidationContext<T> context,Class<G> beanType,String propertyName,Object value,Class<?>... groups) throws ValidationException ;

Fixed version (ground truth):
/** 
 * Validates all constraints placed on the property named <code>propertyName</code> of the class <code>beanType</code> where the property value is <code>value</code>. <p/> <code>ConstraintViolation</code> objects return null for  {@link ConstraintViolation#getRootBean()} and{@link ConstraintViolation#getLeafBean()}
 * @param < T > the type of the RootBean for this validation context
 * @param context The gwt validation context
 * @param beanType the bean type
 * @param propertyName property to validate
 * @param value property value to validate
 * @param groups group or list of groups targeted for validation (default to{@link javax.validation.groups.Default})
 * @return constraint violations or an empty Set if none
 * @throws IllegalArgumentException if <code>beanType</code> is null, if<code>propertyName</code> null, empty or not a valid object property or if null is passed to the varargs groups
 * @throws ValidationException if a non recoverable error happens during thevalidation process
 */
<T>Set<ConstraintViolation<T>> validateValue(GwtValidationContext<T> context,Class<G> beanType,String propertyName,Object value,Class<?>... groups) throws ValidationException ;
Program: 54013
Project: 54013
Buggy source:
public final String create(){
  SourceWriter sourceWriter=getSourceWriter(logger,context);
  if (sourceWriter != null) {
    writeClassBody(sourceWriter);
    sourceWriter.commit(logger);
  }
  return getQaulifiedName();
}

Fixed version (ground truth):
public final String create(){
  SourceWriter sourceWriter=getSourceWriter(logger,context);
  if (sourceWriter != null) {
    writeClassBody(sourceWriter);
    sourceWriter.commit(logger);
  }
  return getQualifiedName();
}
Program: 54014
Project: 54014
Buggy source:
private final String getSimpleName(){
  return validatorType.getSimpleSourceName() + "String_Node_Str";
}

Fixed version (ground truth):
private String getSimpleName(){
  return validatorType.getSimpleSourceName() + "String_Node_Str";
}
Program: 54015
Project: 54015
Buggy source:
private final SourceWriter getSourceWriter(TreeLogger logger,GeneratorContext ctx){
  String packageName=getPackage();
  String simpleName=getSimpleName();
  PrintWriter printWriter=ctx.tryCreate(logger,packageName,simpleName);
  if (printWriter == null) {
    return null;
  }
  ClassSourceFileComposerFactory composerFactory=new ClassSourceFileComposerFactory(packageName,simpleName);
  compose(composerFactory);
  SourceWriter sourceWriter=composerFactory.createSourceWriter(ctx,printWriter);
  return sourceWriter;
}

Fixed version (ground truth):
private SourceWriter getSourceWriter(TreeLogger logger,GeneratorContext ctx){
  String packageName=getPackage();
  String simpleName=getSimpleName();
  PrintWriter printWriter=ctx.tryCreate(logger,packageName,simpleName);
  if (printWriter == null) {
    return null;
  }
  ClassSourceFileComposerFactory composerFactory=new ClassSourceFileComposerFactory(packageName,simpleName);
  compose(composerFactory);
  SourceWriter sourceWriter=composerFactory.createSourceWriter(ctx,printWriter);
  return sourceWriter;
}
Program: 54016
Project: 54016
Buggy source:
public void onWindowClosing(ClosingEvent event){
  StringBuilder sb=new StringBuilder();
  for (  EntityProxyId id : favoriteIds) {
    sb.append(id.asString()).append("String_Node_Str");
  }
  Cookies.setCookie(COOKIE_NAME,sb.toString());
}

Fixed version (ground truth):
public void onWindowClosing(ClosingEvent event){
  StringBuilder sb=new StringBuilder();
  for (  EntityProxyId id : favoriteIds) {
    sb.append(requestFactory.getHistoryToken(id)).append("String_Node_Str");
  }
  Cookies.setCookie(COOKIE_NAME,sb.toString());
}
Program: 54017
Project: 54017
Buggy source:
public FavoritesManager(RequestFactory requestFactory){
  String cookie=Cookies.getCookie(COOKIE_NAME);
  if (cookie != null) {
    try {
      for (      String fragment : cookie.split("String_Node_Str")) {
        if (fragment.length() == 0) {
          continue;
        }
        EntityProxyId id=requestFactory.getProxyId(fragment);
        favoriteIds.add(id);
      }
    }
 catch (    NumberFormatException e) {
      favoriteIds.clear();
    }
  }
  Window.addWindowClosingHandler(new ClosingHandler(){
    public void onWindowClosing(    ClosingEvent event){
      StringBuilder sb=new StringBuilder();
      for (      EntityProxyId id : favoriteIds) {
        sb.append(id.asString()).append("String_Node_Str");
      }
      Cookies.setCookie(COOKIE_NAME,sb.toString());
    }
  }
);
}

Fixed version (ground truth):
public FavoritesManager(final RequestFactory requestFactory){
  String cookie=Cookies.getCookie(COOKIE_NAME);
  if (cookie != null) {
    try {
      for (      String fragment : cookie.split("String_Node_Str")) {
        if (fragment.length() == 0) {
          continue;
        }
        EntityProxyId id=requestFactory.getProxyId(fragment);
        favoriteIds.add(id);
      }
    }
 catch (    NumberFormatException e) {
      favoriteIds.clear();
    }
  }
  Window.addWindowClosingHandler(new ClosingHandler(){
    public void onWindowClosing(    ClosingEvent event){
      StringBuilder sb=new StringBuilder();
      for (      EntityProxyId id : favoriteIds) {
        sb.append(requestFactory.getHistoryToken(id)).append("String_Node_Str");
      }
      Cookies.setCookie(COOKIE_NAME,sb.toString());
    }
  }
);
}
Program: 54018
Project: 54018
Buggy source:
@UiHandler("String_Node_Str") void onSave(ClickEvent e){
  final RequestObject<Void> request=editorDriver.<Void>flush();
  if (editorDriver.hasErrors()) {
    dialog.setText("String_Node_Str");
    return;
  }
  request.fire(new Receiver<Void>(){
    @Override public void onSuccess(    Void response,    Set<SyncResult> syncResults){
      dialog.hide();
    }
    @Override public void onViolation(    Set<Violation> errors){
      dialog.setText("String_Node_Str");
      editorDriver.setViolations(errors);
    }
  }
);
}

Fixed version (ground truth):
@UiHandler("String_Node_Str") void onSave(ClickEvent e){
  final RequestObject<Void> request=editorDriver.<Void>flush();
  if (editorDriver.hasErrors()) {
    dialog.setText("String_Node_Str");
    return;
  }
  request.fire(new Receiver<Void>(){
    @Override public void onSuccess(    Void response){
      dialog.hide();
    }
    @Override public void onViolation(    Set<Violation> errors){
      dialog.setText("String_Node_Str");
      editorDriver.setViolations(errors);
    }
  }
);
}
Program: 54019
Project: 54019
Buggy source:
private void edit(){
  ProxyRequest<PersonProxy> fetchRequest=requestFactory.personRequest().findPerson(person.getId());
  editorDriver=GWT.create(Driver.class);
  editorDriver.initialize(null,requestFactory,personEditor);
  fetchRequest.with(editorDriver.getPaths());
  fetchRequest.fire(new Receiver<PersonProxy>(){
    public void onSuccess(    PersonProxy person,    Set<SyncResult> syncResults){
      editorDriver.edit(person,requestFactory.personRequest().persist(person));
      personEditor.focus();
    }
  }
);
  favorite.setValue(manager.isFavorite(person),false);
  dialog.center();
}

Fixed version (ground truth):
private void edit(){
  ProxyRequest<PersonProxy> fetchRequest=requestFactory.personRequest().findPerson(person.getId());
  editorDriver=GWT.create(Driver.class);
  editorDriver.initialize(null,requestFactory,personEditor);
  fetchRequest.with(editorDriver.getPaths());
  fetchRequest.fire(new Receiver<PersonProxy>(){
    @Override public void onSuccess(    PersonProxy person){
      editorDriver.edit(person,requestFactory.personRequest().persist(person));
      personEditor.focus();
    }
  }
);
  favorite.setValue(manager.isFavorite(person),false);
  dialog.center();
}
Program: 54020
Project: 54020
Buggy source:
public void onSuccess(PersonProxy person,Set<SyncResult> syncResults){
  editorDriver.edit(person,requestFactory.personRequest().persist(person));
  personEditor.focus();
}

Fixed version (ground truth):
@Override public void onSuccess(PersonProxy person){
  editorDriver.edit(person,requestFactory.personRequest().persist(person));
  personEditor.focus();
}
Program: 54021
Project: 54021
Buggy source:
@Override protected void onLoad(){
  subscription=manager.addMarkFavoriteHandler(new MarkFavoriteEvent.Handler(){
    public void onMarkFavorite(    MarkFavoriteEvent event){
      FavoritesWidget.this.onMarkFavorite(event);
    }
  }
);
  for (  EntityProxyId id : manager.getFavoriteIds()) {
    factory.find(id).fire(new Receiver<EntityProxy>(){
      public void onSuccess(      EntityProxy response,      Set<SyncResult> syncResults){
        PersonProxy person=(PersonProxy)response;
        onMarkFavorite(new MarkFavoriteEvent(person,true));
      }
    }
);
  }
}

Fixed version (ground truth):
@Override protected void onLoad(){
  subscription=manager.addMarkFavoriteHandler(new MarkFavoriteEvent.Handler(){
    public void onMarkFavorite(    MarkFavoriteEvent event){
      FavoritesWidget.this.onMarkFavorite(event);
    }
  }
);
  for (  EntityProxyId id : manager.getFavoriteIds()) {
    factory.find(id).fire(new Receiver<EntityProxy>(){
      @Override public void onSuccess(      EntityProxy response){
        PersonProxy person=(PersonProxy)response;
        onMarkFavorite(new MarkFavoriteEvent(person,true));
      }
    }
);
  }
}
Program: 54022
Project: 54022
Buggy source:
public void onSuccess(EntityProxy response,Set<SyncResult> syncResults){
  PersonProxy person=(PersonProxy)response;
  onMarkFavorite(new MarkFavoriteEvent(person,true));
}

Fixed version (ground truth):
@Override public void onSuccess(EntityProxy response){
  PersonProxy person=(PersonProxy)response;
  onMarkFavorite(new MarkFavoriteEvent(person,true));
}
Program: 54023
Project: 54023
Buggy source:
private void fetch(final int start){
  requestFactory.schoolCalendarRequest().getPeople(start,numRows).fire(new Receiver<List<PersonProxy>>(){
    public void onSuccess(    List<PersonProxy> response,    Set<SyncResult> syncResults){
      int responses=response.size();
      table.setRowData(start,response);
      if (!table.isRowCountExact()) {
        table.setRowCount(start + responses,responses < numRows);
      }
    }
  }
);
}

Fixed version (ground truth):
private void fetch(final int start){
  requestFactory.schoolCalendarRequest().getPeople(start,numRows).fire(new Receiver<List<PersonProxy>>(){
    @Override public void onSuccess(    List<PersonProxy> response){
      int responses=response.size();
      table.setRowData(start,response);
      if (!table.isRowCountExact()) {
        table.setRowCount(start + responses,responses < numRows);
      }
    }
  }
);
}
Program: 54024
Project: 54024
Buggy source:
void onPersonChanged(EntityProxyChange<PersonProxy> event){
  if (WriteOperation.UPDATE.equals(event.getWriteOperation())) {
    PersonProxy record=event.getProxy();
    int displayOffset=offsetOf(record);
    if (displayOffset != -1) {
      requestFactory.personRequest().findPerson(record.getId()).fire(new Receiver<PersonProxy>(){
        public void onSuccess(        PersonProxy response,        Set<SyncResult> syncResults){
          int offset=offsetOf(response);
          if (offset != -1) {
            table.setRowData(table.getPageStart() + offset,Collections.singletonList(response));
          }
        }
      }
);
    }
  }
}

Fixed version (ground truth):
void onPersonChanged(EntityProxyChange<PersonProxy> event){
  if (WriteOperation.UPDATE.equals(event.getWriteOperation())) {
    PersonProxy record=event.getProxy();
    int displayOffset=offsetOf(record);
    if (displayOffset != -1) {
      requestFactory.personRequest().findPerson(record.getId()).fire(new Receiver<PersonProxy>(){
        @Override public void onSuccess(        PersonProxy response){
          int offset=offsetOf(response);
          if (offset != -1) {
            table.setRowData(table.getPageStart() + offset,Collections.singletonList(response));
          }
        }
      }
);
    }
  }
}
Program: 54025
Project: 54025
Buggy source:
public void onSuccess(List<PersonProxy> response,Set<SyncResult> syncResults){
  int responses=response.size();
  table.setRowData(start,response);
  if (!table.isRowCountExact()) {
    table.setRowCount(start + responses,responses < numRows);
  }
}

Fixed version (ground truth):
@Override public void onSuccess(List<PersonProxy> response){
  int responses=response.size();
  table.setRowData(start,response);
  if (!table.isRowCountExact()) {
    table.setRowCount(start + responses,responses < numRows);
  }
}
Program: 54026
Project: 54026
Buggy source:
/** 
 * Request the expenses.
 */
private void requestExpenses(){
  refreshTimer.cancel();
  lastReceiver=new Receiver<List<ExpenseProxy>>(){
    @Override public void onSuccess(    List<ExpenseProxy> newValues,    Set<SyncResult> syncResults){
      if (this == lastReceiver) {
        List<ExpenseProxy> list=new ArrayList<ExpenseProxy>(newValues);
        if (lastComparator != null) {
          sortExpenses(list,lastComparator);
        }
        items.setList(list);
        refreshCost();
        boolean isInitialData=knownExpenseKeys == null;
        if (knownExpenseKeys == null) {
          knownExpenseKeys=new HashMap<Object,ExpenseProxy>();
        }
        for (        ExpenseProxy value : newValues) {
          Object key=items.getKey(value);
          if (!isInitialData) {
            ExpenseProxy existing=knownExpenseKeys.get(key);
            if (existing == null || !value.getAmount().equals(existing.getAmount()) || !value.getDescription().equals(existing.getDescription()) || !value.getCategory().equals(existing.getCategory())) {
              (new PhaseAnimation.CellTablePhaseAnimation<ExpenseProxy>(table,value,items)).run();
            }
          }
          knownExpenseKeys.put(key,value);
        }
      }
      refreshTimer.schedule(REFRESH_INTERVAL);
    }
  }
;
  expensesRequestFactory.expenseRequest().findExpensesByReport(report.getId()).with(getExpenseColumns()).fire(lastReceiver);
}

Fixed version (ground truth):
/** 
 * Request the expenses.
 */
private void requestExpenses(){
  refreshTimer.cancel();
  lastReceiver=new Receiver<List<ExpenseProxy>>(){
    @Override public void onSuccess(    List<ExpenseProxy> newValues){
      if (this == lastReceiver) {
        List<ExpenseProxy> list=new ArrayList<ExpenseProxy>(newValues);
        if (lastComparator != null) {
          sortExpenses(list,lastComparator);
        }
        items.setList(list);
        refreshCost();
        boolean isInitialData=knownExpenseKeys == null;
        if (knownExpenseKeys == null) {
          knownExpenseKeys=new HashMap<Object,ExpenseProxy>();
        }
        for (        ExpenseProxy value : newValues) {
          Object key=items.getKey(value);
          if (!isInitialData) {
            ExpenseProxy existing=knownExpenseKeys.get(key);
            if (existing == null || !value.getAmount().equals(existing.getAmount()) || !value.getDescription().equals(existing.getDescription()) || !value.getCategory().equals(existing.getCategory())) {
              (new PhaseAnimation.CellTablePhaseAnimation<ExpenseProxy>(table,value,items)).run();
            }
          }
          knownExpenseKeys.put(key,value);
        }
      }
      refreshTimer.schedule(REFRESH_INTERVAL);
    }
  }
;
  expensesRequestFactory.expenseRequest().findExpensesByReport(report.getId()).with(getExpenseColumns()).fire(lastReceiver);
}
Program: 54027
Project: 54027
Buggy source:
/** 
 * Save the notes that the user entered in the notes box.
 */
private void saveNotes(){
  final String pendingNotes=notesBox.getText();
  if (pendingNotes.equals(report.getNotes())) {
    setNotesEditState(false,false,pendingNotes);
    return;
  }
  setNotesEditState(false,true,pendingNotes);
  RequestObject<Void> editRequest=expensesRequestFactory.reportRequest().persist(report);
  ReportProxy editableReport=editRequest.edit(report);
  editableReport.setNotes(pendingNotes);
  editRequest.fire(new Receiver<Void>(){
    @Override public void onSuccess(    Void ignore,    Set<SyncResult> response){
      String errorMessage=getErrorMessageFromSync(response);
      if (errorMessage.length() > 0) {
        showErrorPopup(errorMessage);
        setNotesEditState(false,false,report.getNotes());
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Save the notes that the user entered in the notes box.
 */
private void saveNotes(){
  final String pendingNotes=notesBox.getText();
  if (pendingNotes.equals(report.getNotes())) {
    setNotesEditState(false,false,pendingNotes);
    return;
  }
  setNotesEditState(false,true,pendingNotes);
  RequestObject<Void> editRequest=expensesRequestFactory.reportRequest().persist(report);
  ReportProxy editableReport=editRequest.edit(report);
  editableReport.setNotes(pendingNotes);
  editRequest.fire(new Receiver<Void>(){
    @Override public void onSuccess(    Void ignore){
    }
  }
);
}
Program: 54028
Project: 54028
Buggy source:
public void onReportChanged(EntityProxyChange<ReportProxy> event){
  ReportProxy changed=event.getProxy();
  if (report != null && report.getId().equals(changed.getId())) {
    expensesRequestFactory.reportRequest().findReport(report.getId()).fire(new Receiver<ReportProxy>(){
      @Override public void onSuccess(      ReportProxy response,      Set<SyncResult> syncResults){
        report=response;
        setNotesEditState(false,false,response.getNotes());
      }
    }
);
  }
}

Fixed version (ground truth):
public void onReportChanged(EntityProxyChange<ReportProxy> event){
  ReportProxy changed=event.getProxy();
  if (report != null && report.getId().equals(changed.getId())) {
    expensesRequestFactory.reportRequest().findReport(report.getId()).fire(new Receiver<ReportProxy>(){
      @Override public void onSuccess(      ReportProxy response){
        report=response;
        setNotesEditState(false,false,response.getNotes());
      }
    }
);
  }
}
Program: 54029
Project: 54029
Buggy source:
private void updateExpenseRecord(final ExpenseProxy record,String approval,String reasonDenied){
  if (Expenses.Approval.APPROVED.is(approval) && !Expenses.Approval.APPROVED.is(record.getApproval())) {
    double amount=record.getAmount();
    if (amount + totalApproved > MAX_COST) {
      syncCommit(record,"String_Node_Str" + MAX_COST + "String_Node_Str");
      return;
    }
  }
  RequestObject<Void> editRequest=expensesRequestFactory.expenseRequest().persist(record);
  ExpenseProxy editableRecord=editRequest.edit(record);
  editableRecord.setApproval(approval);
  editableRecord.setReasonDenied(reasonDenied);
  editRequest.fire(new Receiver<Void>(){
    @Override public void onSuccess(    Void ignore,    Set<SyncResult> response){
      String errorMessage=getErrorMessageFromSync(response);
      if (errorMessage.length() > 0) {
        syncCommit(record,errorMessage.length() > 0 ? errorMessage : null);
      }
    }
  }
);
}

Fixed version (ground truth):
private void updateExpenseRecord(final ExpenseProxy record,String approval,String reasonDenied){
  if (Expenses.Approval.APPROVED.is(approval) && !Expenses.Approval.APPROVED.is(record.getApproval())) {
    double amount=record.getAmount();
    if (amount + totalApproved > MAX_COST) {
      syncCommit(record,"String_Node_Str" + MAX_COST + "String_Node_Str");
      return;
    }
  }
  RequestObject<Void> editRequest=expensesRequestFactory.expenseRequest().persist(record);
  ExpenseProxy editableRecord=editRequest.edit(record);
  editableRecord.setApproval(approval);
  editableRecord.setReasonDenied(reasonDenied);
  editRequest.fire(new Receiver<Void>(){
    @Override public void onSuccess(    Void ignore){
    }
  }
);
}
Program: 54030
Project: 54030
Buggy source:
@Override public void onSuccess(Void ignore,Set<SyncResult> response){
  String errorMessage=getErrorMessageFromSync(response);
  if (errorMessage.length() > 0) {
    syncCommit(record,errorMessage.length() > 0 ? errorMessage : null);
  }
}

Fixed version (ground truth):
@Override public void onSuccess(Void ignore){
}
Program: 54032
Project: 54032
Buggy source:
@Override public void onSuccess(List<ReportProxy> newValues,Set<SyncResult> syncResults){
  if (this == lastDataReceiver) {
    int size=newValues.size();
    if (size < table.getPageSize()) {
      reports.updateRowCount(table.getPageStart() + size,true);
    }
    if (size > 0) {
      reports.updateRowData(table.getPageStart(),newValues);
    }
    boolean isInitialData=knownReportKeys == null;
    if (knownReportKeys == null) {
      knownReportKeys=new HashSet<Object>();
    }
    for (    ReportProxy value : newValues) {
      Object key=reports.getKey(value);
      if (!isInitialData && !knownReportKeys.contains(key)) {
        (new PhaseAnimation.CellTablePhaseAnimation<ReportProxy>(table,value,reports)).run();
      }
      knownReportKeys.add(key);
    }
  }
  refreshTimer.schedule(REFRESH_INTERVAL);
}

Fixed version (ground truth):
@Override public void onSuccess(List<ReportProxy> newValues){
  if (this == lastDataReceiver) {
    int size=newValues.size();
    if (size < table.getPageSize()) {
      reports.updateRowCount(table.getPageStart() + size,true);
    }
    if (size > 0) {
      reports.updateRowData(table.getPageStart(),newValues);
    }
    boolean isInitialData=knownReportKeys == null;
    if (knownReportKeys == null) {
      knownReportKeys=new HashSet<Object>();
    }
    for (    ReportProxy value : newValues) {
      Object key=reports.getKey(value);
      if (!isInitialData && !knownReportKeys.contains(key)) {
        (new PhaseAnimation.CellTablePhaseAnimation<ReportProxy>(table,value,reports)).run();
      }
      knownReportKeys.add(key);
    }
  }
  refreshTimer.schedule(REFRESH_INTERVAL);
}
Program: 54033
Project: 54033
Buggy source:
@Override protected void onRangeChanged(HasData<EmployeeProxy> view){
  Range range=view.getVisibleRange();
  requestFactory.employeeRequest().findEmployeeEntriesByDepartment(department,range.getStart(),range.getLength()).with(getEmployeeMenuProperties()).fire(new Receiver<List<EmployeeProxy>>(){
    @Override public void onSuccess(    List<EmployeeProxy> response,    Set<SyncResult> syncResults){
      updateRowData(0,response);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onRangeChanged(HasData<EmployeeProxy> view){
  Range range=view.getVisibleRange();
  requestFactory.employeeRequest().findEmployeeEntriesByDepartment(department,range.getStart(),range.getLength()).with(getEmployeeMenuProperties()).fire(new Receiver<List<EmployeeProxy>>(){
    @Override public void onSuccess(    List<EmployeeProxy> response){
      updateRowData(0,response);
    }
  }
);
}
Program: 54034
Project: 54034
Buggy source:
@Override public void addDataDisplay(HasData<EmployeeProxy> display){
  super.addDataDisplay(display);
  requestFactory.employeeRequest().countEmployeesByDepartment(department).fire(new Receiver<Long>(){
    @Override public void onSuccess(    Long response,    Set<SyncResult> syncResults){
      updateRowCount(response.intValue(),true);
    }
  }
);
}

Fixed version (ground truth):
@Override public void addDataDisplay(HasData<EmployeeProxy> display){
  super.addDataDisplay(display);
  requestFactory.employeeRequest().countEmployeesByDepartment(department).fire(new Receiver<Long>(){
    @Override public void onSuccess(    Long response){
      updateRowCount(response.intValue(),true);
    }
  }
);
}
Program: 54035
Project: 54035
Buggy source:
@Override public void onSuccess(List<EmployeeProxy> response,Set<SyncResult> syncResults){
  updateRowData(0,response);
}

Fixed version (ground truth):
@Override public void onSuccess(List<EmployeeProxy> response){
  updateRowData(0,response);
}
Program: 54037
Project: 54037
Buggy source:
@Override public void onSuccess(UserInformationProxy userInformationRecord,Set<SyncResult> syncResults){
  login.setUserInformation(userInformationRecord);
}

Fixed version (ground truth):
@Override public void onSuccess(UserInformationProxy userInformationRecord){
  login.setUserInformation(userInformationRecord);
}
Program: 54038
Project: 54038
Buggy source:
/** 
 * Gets the container element associated with this layer. <p> This is the element that sits between the parent and child elements. It is normally necessary to operate on this element only when you need to modify certain CSS properties, such as visibility. </p>
 * @return the container element
 */
public Element getContainerElement(){
  return container;
}

Fixed version (ground truth):
/** 
 * Gets the container element associated with this layer. <p> This is the element that sits between the parent and child elements. It is normally necessary to operate on this element only when you need to modify CSS properties that are not directly modeled by the Layer class. </p>
 * @return the container element
 */
public Element getContainerElement(){
  return container;
}
Program: 54039
Project: 54039
Buggy source:
public void layout(Layer layer){
  Style style=layer.container.getStyle();
  style.setProperty("String_Node_Str",layer.setLeft ? (layer.left + layer.leftUnit.getType()) : "String_Node_Str");
  style.setProperty("String_Node_Str",layer.setTop ? (layer.top + layer.topUnit.getType()) : "String_Node_Str");
  style.setProperty("String_Node_Str",layer.setRight ? (layer.right + layer.rightUnit.getType()) : "String_Node_Str");
  style.setProperty("String_Node_Str",layer.setBottom ? (layer.bottom + layer.bottomUnit.getType()) : "String_Node_Str");
  style.setProperty("String_Node_Str",layer.setWidth ? (layer.width + layer.widthUnit.getType()) : "String_Node_Str");
  style.setProperty("String_Node_Str",layer.setHeight ? (layer.height + layer.heightUnit.getType()) : "String_Node_Str");
  style=layer.child.getStyle();
switch (layer.hPos) {
case BEGIN:
    style.setLeft(0,Unit.PX);
  style.clearRight();
break;
case END:
style.clearLeft();
style.setRight(0,Unit.PX);
break;
case STRETCH:
style.setLeft(0,Unit.PX);
style.setRight(0,Unit.PX);
break;
}
switch (layer.vPos) {
case BEGIN:
style.setTop(0,Unit.PX);
style.clearBottom();
break;
case END:
style.clearTop();
style.setBottom(0,Unit.PX);
break;
case STRETCH:
style.setTop(0,Unit.PX);
style.setBottom(0,Unit.PX);
break;
}
}

Fixed version (ground truth):
public void layout(Layer layer){
  Style style=layer.container.getStyle();
  if (layer.visible) {
    style.clearDisplay();
  }
 else {
    style.setDisplay(Display.NONE);
  }
  style.setProperty("String_Node_Str",layer.setLeft ? (layer.left + layer.leftUnit.getType()) : "String_Node_Str");
  style.setProperty("String_Node_Str",layer.setTop ? (layer.top + layer.topUnit.getType()) : "String_Node_Str");
  style.setProperty("String_Node_Str",layer.setRight ? (layer.right + layer.rightUnit.getType()) : "String_Node_Str");
  style.setProperty("String_Node_Str",layer.setBottom ? (layer.bottom + layer.bottomUnit.getType()) : "String_Node_Str");
  style.setProperty("String_Node_Str",layer.setWidth ? (layer.width + layer.widthUnit.getType()) : "String_Node_Str");
  style.setProperty("String_Node_Str",layer.setHeight ? (layer.height + layer.heightUnit.getType()) : "String_Node_Str");
  style=layer.child.getStyle();
switch (layer.hPos) {
case BEGIN:
    style.setLeft(0,Unit.PX);
  style.clearRight();
break;
case END:
style.clearLeft();
style.setRight(0,Unit.PX);
break;
case STRETCH:
style.setLeft(0,Unit.PX);
style.setRight(0,Unit.PX);
break;
}
switch (layer.vPos) {
case BEGIN:
style.setTop(0,Unit.PX);
style.clearBottom();
break;
case END:
style.clearTop();
style.setBottom(0,Unit.PX);
break;
case STRETCH:
style.setTop(0,Unit.PX);
style.setBottom(0,Unit.PX);
break;
}
}
Program: 54040
Project: 54040
Buggy source:
@Override public void layout(Layer layer){
  Element elem=layer.getContainerElement();
  setLayer(elem,layer);
}

Fixed version (ground truth):
@Override public void layout(Layer layer){
  Element elem=layer.container;
  Style style=elem.getStyle();
  if (layer.visible) {
    style.clearDisplay();
  }
 else {
    style.setDisplay(Display.NONE);
  }
  setLayer(elem,layer);
}
Program: 54041
Project: 54041
Buggy source:
@Override public void layout(Layer layer){
  Style style=layer.container.getStyle();
  if (layer.setLeft) {
    setValue(layer,"String_Node_Str",layer.left,layer.leftUnit,false,false);
  }
 else {
    style.clearLeft();
  }
  if (layer.setRight) {
    setValue(layer,"String_Node_Str",layer.right,layer.rightUnit,false,false);
  }
 else {
    style.clearRight();
  }
  if (layer.setTop) {
    setValue(layer,"String_Node_Str",layer.top,layer.topUnit,true,false);
  }
 else {
    style.clearTop();
  }
  if (layer.setBottom) {
    setValue(layer,"String_Node_Str",layer.bottom,layer.bottomUnit,true,false);
  }
 else {
    style.clearBottom();
  }
  if (layer.setWidth) {
    setValue(layer,"String_Node_Str",layer.width,layer.widthUnit,false,true);
  }
 else {
    style.clearWidth();
  }
  if (layer.setHeight) {
    setValue(layer,"String_Node_Str",layer.height,layer.heightUnit,true,true);
  }
 else {
    style.clearHeight();
  }
  style=layer.child.getStyle();
switch (layer.hPos) {
case BEGIN:
    style.setLeft(0,Unit.PX);
  style.clearRight();
break;
case END:
style.clearLeft();
style.setRight(0,Unit.PX);
break;
case STRETCH:
style.setLeft(0,Unit.PX);
style.setRight(0,Unit.PX);
break;
}
switch (layer.vPos) {
case BEGIN:
style.setTop(0,Unit.PX);
style.clearBottom();
break;
case END:
style.clearTop();
style.setBottom(0,Unit.PX);
break;
case STRETCH:
style.setTop(0,Unit.PX);
style.setBottom(0,Unit.PX);
break;
}
}

Fixed version (ground truth):
@Override public void layout(Layer layer){
  Style style=layer.container.getStyle();
  setLayer(layer.container,layer);
  if (layer.visible) {
    String oldDisplay=style.getDisplay();
    style.clearDisplay();
    if (oldDisplay.length() > 0) {
      updateVisibility(layer.container);
    }
  }
 else {
    style.setDisplay(Display.NONE);
  }
  if (layer.setLeft) {
    setValue(layer,"String_Node_Str",layer.left,layer.leftUnit,false,false);
  }
 else {
    style.clearLeft();
  }
  if (layer.setRight) {
    setValue(layer,"String_Node_Str",layer.right,layer.rightUnit,false,false);
  }
 else {
    style.clearRight();
  }
  if (layer.setTop) {
    setValue(layer,"String_Node_Str",layer.top,layer.topUnit,true,false);
  }
 else {
    style.clearTop();
  }
  if (layer.setBottom) {
    setValue(layer,"String_Node_Str",layer.bottom,layer.bottomUnit,true,false);
  }
 else {
    style.clearBottom();
  }
  if (layer.setWidth) {
    setValue(layer,"String_Node_Str",layer.width,layer.widthUnit,false,true);
  }
 else {
    style.clearWidth();
  }
  if (layer.setHeight) {
    setValue(layer,"String_Node_Str",layer.height,layer.heightUnit,true,true);
  }
 else {
    style.clearHeight();
  }
  style=layer.child.getStyle();
switch (layer.hPos) {
case BEGIN:
    style.setLeft(0,Unit.PX);
  style.clearRight();
break;
case END:
style.clearLeft();
style.setRight(0,Unit.PX);
break;
case STRETCH:
style.setLeft(0,Unit.PX);
style.setRight(0,Unit.PX);
break;
}
switch (layer.vPos) {
case BEGIN:
style.setTop(0,Unit.PX);
style.clearBottom();
break;
case END:
style.clearTop();
style.setBottom(0,Unit.PX);
break;
case STRETCH:
style.setTop(0,Unit.PX);
style.setBottom(0,Unit.PX);
break;
}
}
Program: 54042
Project: 54042
Buggy source:
/** 
 * Shows or hides the given widget and its layer. This method explicitly calls   {@link UIObject#setVisible(boolean)} on the child widget and ensuresthat its associated layer is shown/hidden.
 * @param child
 * @param visible
 */
public void setWidgetVisible(Widget child,boolean visible){
  assertIsChild(child);
  Element container=getWidgetContainerElement(child);
  setVisible(container,visible);
  child.setVisible(visible);
  animate(0);
}

Fixed version (ground truth):
/** 
 * Shows or hides the given widget and its layer. This method explicitly calls   {@link UIObject#setVisible(boolean)} on the child widget and ensuresthat its associated layer is shown/hidden.
 * @param child
 * @param visible
 */
public void setWidgetVisible(Widget child,boolean visible){
  assertIsChild(child);
  getLayer(child).setVisible(visible);
  child.setVisible(visible);
  animate(0);
}
Program: 54043
Project: 54043
Buggy source:
private void layoutChild(Widget child){
  panel.setWidgetLeftRight(child,0,Unit.PX,0,Unit.PX);
  panel.setWidgetTopBottom(child,barHeight,barUnit,0,Unit.PX);
  panel.getWidgetContainerElement(child).getStyle().setDisplay(Display.NONE);
  child.addStyleName(CONTENT_STYLE);
  child.setVisible(false);
}

Fixed version (ground truth):
private void layoutChild(Widget child){
  panel.setWidgetLeftRight(child,0,Unit.PX,0,Unit.PX);
  panel.setWidgetTopBottom(child,barHeight,barUnit,0,Unit.PX);
  panel.setWidgetVisible(child,false);
  child.addStyleName(CONTENT_STYLE);
  child.setVisible(false);
}
Program: 54044
Project: 54044
Buggy source:
public void execute(){
  assertEquals(128,bar.getOffsetWidth());
  assertEquals(128 - 32,bar.getOffsetHeight());
  finishTest();
}

Fixed version (ground truth):
public void execute(){
  assertTrue(bar.getOffsetWidth() > 0);
  assertTrue(bar.getOffsetHeight() > 0);
  finishTest();
}
Program: 54045
Project: 54045
Buggy source:
public void testInternalPrecision(){
  long millis=System.currentTimeMillis();
  Date now=new Date(millis);
  Date after=new Date(now.getTime() + 1);
  Date before=new Date(now.getTime() - 1);
  assertTrue(after.after(now));
  assertTrue(before.before(now));
}

Fixed version (ground truth):
public void testInternalPrecision(){
  long millis=1283895273475L;
  Date now=new Date(millis);
  Date after=new Date(now.getTime() + 1);
  Date before=new Date(now.getTime() - 1);
  assertTrue(after.after(now));
  assertTrue(before.before(now));
}
Program: 54046
Project: 54046
Buggy source:
public void testInternalPrecision(){
  long millis=System.currentTimeMillis();
  Time today=new Time(millis);
  Time after=new Time(today.getTime() + 1);
  Time before=new Time(today.getTime() - 1);
  assertTrue(after.after(today));
  assertTrue(before.before(today));
}

Fixed version (ground truth):
public void testInternalPrecision(){
  long millis=1283895273475L;
  Time today=new Time(millis);
  Time after=new Time(today.getTime() + 1);
  Time before=new Time(today.getTime() - 1);
  assertTrue(after.after(today));
  assertTrue(before.before(today));
}
Program: 54047
Project: 54047
Buggy source:
public void testNanosAffectTime(){
  long now=System.currentTimeMillis();
  int millis=(int)(now % 1000);
  Timestamp t=new Timestamp(now);
  assertEquals(now,t.getTime());
  assertEquals(millis * 1000000,t.getNanos());
  t.setNanos(0);
  assertEquals(now - millis,t.getTime());
  t.setNanos(999999999);
  assertEquals(now - millis + 999,t.getTime());
}

Fixed version (ground truth):
public void testNanosAffectTime(){
  long now=1283895273475L;
  int millis=(int)(now % 1000);
  Timestamp t=new Timestamp(now);
  assertEquals(now,t.getTime());
  assertEquals(millis * 1000000,t.getNanos());
  t.setNanos(0);
  assertEquals(now - millis,t.getTime());
  t.setNanos(999999999);
  assertEquals(now - millis + 999,t.getTime());
}
Program: 54048
Project: 54048
Buggy source:
public void testNanosRange(){
  long now=System.currentTimeMillis();
  Timestamp t=new Timestamp(now);
  assertEquals(now,t.getTime());
  assertEquals((now % 1000) * 1000000,t.getNanos());
  try {
    t.setNanos(-1);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
  t.setNanos(0);
  try {
    t.setNanos(1000000000);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
  t.setNanos(999999999);
}

Fixed version (ground truth):
public void testNanosRange(){
  long now=1283895273475L;
  Timestamp t=new Timestamp(now);
  assertEquals(now,t.getTime());
  assertEquals((now % 1000) * 1000000,t.getNanos());
  try {
    t.setNanos(-1);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
  t.setNanos(0);
  try {
    t.setNanos(1000000000);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
  t.setNanos(999999999);
}
Program: 54049
Project: 54049
Buggy source:
public void testTimeAffectsNanos(){
  long now=(System.currentTimeMillis() / 1000) * 1000 + 5;
  Timestamp t=new Timestamp(now);
  assertEquals(5000000,t.getNanos());
  t.setTime(now + 1);
  assertEquals(6000000,t.getNanos());
}

Fixed version (ground truth):
public void testTimeAffectsNanos(){
  long now=1283895273005L;
  Timestamp t=new Timestamp(now);
  assertEquals(5000000,t.getNanos());
  t.setTime(now + 1);
  assertEquals(6000000,t.getNanos());
}
Program: 54050
Project: 54050
Buggy source:
public void testNanosComparison(){
  long now=System.currentTimeMillis();
  Timestamp t=new Timestamp(now);
  t.setNanos(0);
  Timestamp t2=new Timestamp(t.getTime());
  t2.setNanos(0);
  assertEquals(t,t2);
  assertEquals(0,t.compareTo(t2));
  assertFalse(t.before(t2));
  assertFalse(t.after(t2));
  t2.setNanos(1);
  assertFalse(t.equals(t2));
  assertTrue(t.compareTo(t2) < 0);
  assertTrue(t2.compareTo(t) > 0);
  assertTrue(t.before(t2));
  assertTrue(t2.after(t));
}

Fixed version (ground truth):
public void testNanosComparison(){
  long now=1283895273475L;
  Timestamp t=new Timestamp(now);
  t.setNanos(0);
  Timestamp t2=new Timestamp(t.getTime());
  t2.setNanos(0);
  assertEquals(t,t2);
  assertEquals(0,t.compareTo(t2));
  assertFalse(t.before(t2));
  assertFalse(t.after(t2));
  t2.setNanos(1);
  assertFalse(t.equals(t2));
  assertTrue(t.compareTo(t2) < 0);
  assertTrue(t2.compareTo(t) > 0);
  assertTrue(t.before(t2));
  assertTrue(t2.after(t));
}
Program: 54051
Project: 54051
Buggy source:
/** 
 * Timestamps have some non-obvious comparison semantics when compared to dates.
 */
public void testDateComparison(){
  long now=System.currentTimeMillis();
  Date d=new Date(now);
  Timestamp t=new Timestamp(d.getTime());
  if (now % 1000 == 0) {
    t.setNanos(1000001);
  }
 else {
    t.setNanos(1);
  }
  Date d2=new Date(t.getTime());
  assertFalse("String_Node_Str",d.equals(t));
  assertEquals("String_Node_Str",d2,t);
  assertEquals("String_Node_Str",d2.hashCode(),t.hashCode());
  assertFalse("String_Node_Str",t.equals(d2));
  assertEquals(1,t.compareTo(d2));
  Timestamp t2=new Timestamp(d.getTime());
  t2.setNanos(t.getNanos() + 1);
  assertFalse("String_Node_Str",t.equals(t2));
  assertEquals("String_Node_Str",t.hashCode(),t2.hashCode());
}

Fixed version (ground truth):
/** 
 * Timestamps have some non-obvious comparison semantics when compared to dates.
 */
public void testDateComparison(){
  testDateComparisonOneValue(1283895274000L);
  testDateComparisonOneValue(1283895273475L);
}
Program: 54052
Project: 54052
Buggy source:
public void computeTypeCastabilityMaps(){
  computeSourceType(program.getTypeJavaLangString());
  assert(castableTypeMaps.size() == 3);
  for (  JReferenceType type : program.getDeclaredTypes()) {
    if (type instanceof JClassType) {
      computeSourceType(type);
    }
  }
  for (  JArrayType type : program.getAllArrayTypes()) {
    computeSourceType(type);
  }
  program.initTypeInfo(castableTypeMaps);
  JClassType jsoType=program.getJavaScriptObject();
  if (jsoType != null) {
    queryIds.put(jsoType,-1);
  }
  program.recordQueryIds(queryIds);
}

Fixed version (ground truth):
public void computeTypeCastabilityMaps(){
  computeSourceType(program.getTypeJavaLangString());
  assert(castableTypeMaps.size() == 2);
  for (  JReferenceType type : program.getDeclaredTypes()) {
    if (type instanceof JClassType) {
      computeSourceType(type);
    }
  }
  for (  JArrayType type : program.getAllArrayTypes()) {
    computeSourceType(type);
  }
  program.initTypeInfo(castableTypeMaps);
  JClassType jsoType=program.getJavaScriptObject();
  if (jsoType != null) {
    queryIds.put(jsoType,-1);
  }
  program.recordQueryIds(queryIds);
}
Program: 54053
Project: 54053
Buggy source:
Sandbox(AbstractCompiler outer,boolean doGenerateBytes){
  this.outer=outer;
  this.doGenerateBytes=doGenerateBytes;
  rememberPackage("String_Node_Str");
  INameEnvironment env=new INameEnvironmentImpl();
  IErrorHandlingPolicy pol=DefaultErrorHandlingPolicies.proceedWithAllProblems();
  IProblemFactory probFact=new DefaultProblemFactory(Locale.getDefault());
  ICompilerRequestor req=new ICompilerRequestorImpl();
  CompilerOptions options=getCompilerOptions();
  options.docCommentSupport=false;
  compiler=new CompilerImpl(env,pol,options,req,probFact);
  for (  CompilationUnit unit : outer.compilationState.getCompilationUnits()) {
    String packageName=Shared.getPackageName(unit.getTypeName());
    rememberPackage(packageName);
  }
}

Fixed version (ground truth):
Sandbox(AbstractCompiler outer,boolean doGenerateBytes){
  this.outer=outer;
  this.doGenerateBytes=doGenerateBytes;
  rememberPackage("String_Node_Str");
  INameEnvironment env=new INameEnvironmentImpl();
  IErrorHandlingPolicy pol=DefaultErrorHandlingPolicies.proceedWithAllProblems();
  IProblemFactory probFact=new DefaultProblemFactory(Locale.getDefault());
  ICompilerRequestor req=new ICompilerRequestorImpl();
  CompilerOptions options=getCompilerOptions();
  options.docCommentSupport=false;
  compiler=new CompilerImpl(env,pol,options,req,probFact);
  refreshPackagesFromCompState();
}
Program: 54054
Project: 54054
Buggy source:
/** 
 * Causes the compilation service itself to recognize the specified package name (and all its parent packages), avoiding a call back into the host. This is useful as an optimization, but more importantly, it is useful to compile against bytecode that was pre-compiled to which we don't have the source. This ability is crucial bridging the gap between user-level and "dev" code in hosted mode for classes such as JavaScriptHost and ShellJavaScriptHost.
 */
private void rememberPackage(String packageName){
  int i=packageName.lastIndexOf('.');
  if (i != -1) {
    rememberPackage(packageName.substring(0,i));
  }
  knownPackages.add(packageName);
}

Fixed version (ground truth):
/** 
 * Causes the compilation service itself to recognize the specified package name (and all its parent packages), avoiding a call back into the host. This is useful as an optimization, but more importantly, it is useful to compile against bytecode that was pre-compiled to which we don't have the source. This ability is crucial bridging the gap between user-level and "dev" code in hosted mode for classes such as JavaScriptHost and ShellJavaScriptHost.
 */
private void rememberPackage(String packageName){
  if (knownPackages.add(packageName)) {
    int i=packageName.lastIndexOf('.');
    if (i != -1) {
      rememberPackage(packageName.substring(0,i));
    }
  }
}
Program: 54057
Project: 54057
Buggy source:
@Override protected void fireSelectionChangeEvent(){
  if (isEventScheduled()) {
    setEventCancelled(true);
  }
  if (resolveChanges()) {
    SelectionChangeEvent.fire(this);
  }
}

Fixed version (ground truth):
@Override protected void fireSelectionChangeEvent(){
  if (isEventScheduled()) {
    setEventCancelled(true);
  }
  resolveChanges();
}
Program: 54058
Project: 54058
Buggy source:
private boolean resolveChanges(){
  boolean changed=false;
  for (  Map.Entry<T,Boolean> entry : selectionChanges.entrySet()) {
    T object=entry.getKey();
    boolean selected=entry.getValue();
    boolean defaultSelected=isDefaultSelected(object);
    Object key=getKey(object);
    Boolean previousException=exceptions.get(key);
    if (defaultSelected == selected) {
      if (previousException != null) {
        exceptions.remove(key);
        changed=true;
      }
    }
 else {
      if (previousException != Boolean.valueOf(selected)) {
        exceptions.put(key,selected);
        changed=true;
      }
    }
  }
  selectionChanges.clear();
  return changed;
}

Fixed version (ground truth):
private void resolveChanges(){
  boolean changed=false;
  for (  Map.Entry<T,Boolean> entry : selectionChanges.entrySet()) {
    T object=entry.getKey();
    boolean selected=entry.getValue();
    boolean defaultSelected=isDefaultSelected(object);
    Object key=getKey(object);
    Boolean previousException=exceptions.get(key);
    if (defaultSelected == selected) {
      if (previousException != null) {
        exceptions.remove(key);
        changed=true;
      }
    }
 else {
      if (previousException != Boolean.valueOf(selected)) {
        exceptions.put(key,selected);
        changed=true;
      }
    }
  }
  selectionChanges.clear();
  if (changed) {
    SelectionChangeEvent.fire(this);
  }
}
Program: 54059
Project: 54059
Buggy source:
@Override protected void fireSelectionChangeEvent(){
  if (isEventScheduled()) {
    setEventCancelled(true);
  }
  if (resolveChanges()) {
    SelectionChangeEvent.fire(this);
  }
}

Fixed version (ground truth):
@Override protected void fireSelectionChangeEvent(){
  if (isEventScheduled()) {
    setEventCancelled(true);
  }
  resolveChanges();
}
Program: 54060
Project: 54060
Buggy source:
private boolean resolveChanges(){
  if (selectionChanges.isEmpty()) {
    return false;
  }
  boolean changed=false;
  for (  Map.Entry<T,Boolean> entry : selectionChanges.entrySet()) {
    T object=entry.getKey();
    boolean selected=entry.getValue();
    Object key=getKey(object);
    T oldValue=selectedSet.get(key);
    if (selected) {
      if (oldValue == null || !oldValue.equals(object)) {
        selectedSet.put(getKey(object),object);
        changed=true;
      }
    }
 else {
      if (oldValue != null) {
        selectedSet.remove(key);
        changed=true;
      }
    }
  }
  selectionChanges.clear();
  return changed;
}

Fixed version (ground truth):
private void resolveChanges(){
  if (selectionChanges.isEmpty()) {
    return;
  }
  boolean changed=false;
  for (  Map.Entry<T,Boolean> entry : selectionChanges.entrySet()) {
    T object=entry.getKey();
    boolean selected=entry.getValue();
    Object key=getKey(object);
    T oldValue=selectedSet.get(key);
    if (selected) {
      if (oldValue == null || !oldValue.equals(object)) {
        selectedSet.put(getKey(object),object);
        changed=true;
      }
    }
 else {
      if (oldValue != null) {
        selectedSet.remove(key);
        changed=true;
      }
    }
  }
  selectionChanges.clear();
  if (changed) {
    SelectionChangeEvent.fire(this);
  }
}
Program: 54061
Project: 54061
Buggy source:
@Override protected void fireSelectionChangeEvent(){
  if (isEventScheduled()) {
    setEventCancelled(true);
  }
  if (resolveChanges()) {
    SelectionChangeEvent.fire(this);
  }
}

Fixed version (ground truth):
@Override protected void fireSelectionChangeEvent(){
  if (isEventScheduled()) {
    setEventCancelled(true);
  }
  resolveChanges();
}