Program: 18577
Project: 18577
Buggy source:
/** 
 * Bind.
 */
public void bind(){
  this.eventBus.addHandler(GetServicesEvent.TYPE,new GetServicesEventHandler(){
    public void onData(    GetServicesEvent event){
      if (servicesList == null) {
        servicesList=event.getData();
        view.setServicesMap(event.getData());
      }
    }
  }
);
  this.eventBus.addHandler(ObjectSelectionEvent.TYPE,new ObjectSelectionEventHandler(){
    public void onSelection(    ObjectSelectionEvent event){
      selectionContext=new SelectionContext();
      Map<ObjectType,String> selections=event.getSelections();
      if (selections != null) {
        for (        Map.Entry<ObjectType,String> entry : selections.entrySet()) {
          if (entry.getValue() != null)           selectionContext.select(entry.getKey(),entry.getValue());
        }
      }
    }
  }
);
  this.eventBus.addHandler(DateFilterSelectionEvent.TYPE,new DateFilterSelectionHandler(){
    public void onSelection(    DateFilterSelectionEvent event){
      selectedDate1=event.getDate1();
      selectedDate2=event.getDate2();
      selectedDurationHrs=event.getDuration();
      view.getFilter().setHours1(Util.getAvailableHours(selectedDate1));
      view.getFilter().setHour1(new Date(selectedDate1).getHours());
      view.getFilter().setDate1(new Date(selectedDate1));
      view.getFilter().setHours2(Util.getAvailableHours(selectedDate2));
      view.getFilter().setHour2(new Date(selectedDate2).getHours());
      view.getFilter().setDate2(new Date(selectedDate2));
      view.getFilter().setDuration(selectedDurationHrs);
    }
  }
);
  this.view.getFilter().getDate1().addValueChangeHandler(new ValueChangeHandler<Date>(){
    public void onValueChange(    ValueChangeEvent<Date> event){
      Date date=event.getValue();
      int[] hrs=Util.getAvailableHours(date);
      view.getFilter().setHours1(hrs);
    }
  }
);
  this.view.getFilter().getDate2().addValueChangeHandler(new ValueChangeHandler<Date>(){
    public void onValueChange(    ValueChangeEvent<Date> event){
      Date date=event.getValue();
      int[] hrs=Util.getAvailableHours(date);
      view.getFilter().setHours2(hrs);
    }
  }
);
  this.view.getFilter().getApplyButton().addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      long oldDate1=selectedDate1;
      long oldDate2=selectedDate2;
      selectedDate1=view.getFilter().getDate1().getValue().getTime();
      selectedDate2=view.getFilter().getDate2().getValue().getTime();
      int hour1=view.getFilter().getHour1();
      int hour2=view.getFilter().getHour2();
      selectedDate1+=(Util.HRS_1_MS * hour1);
      selectedDate2+=(Util.HRS_1_MS * hour2);
      int oldDuration=selectedDurationHrs;
      selectedDurationHrs=view.getFilter().getDuration();
      view.setFilterLabel(makeFilterLabel(selectedDate1,selectedDate2,selectedDurationHrs));
      if ((oldDate1 != selectedDate1) || (oldDate2 != selectedDate2) || (oldDuration != selectedDurationHrs)) {
        eventBus.fireEvent(new DateFilterSelectionEvent(selectedDate1,selectedDate2,selectedDurationHrs));
      }
      view.setFilterLabel(makeFilterLabel(selectedDate1,selectedDate2,selectedDurationHrs));
      List<String> metrics=((Filterable.ErrorFilterable)view.getFilter()).getSelectedCategoryViewNames();
      if (metrics.isEmpty())       metrics=((Filterable.ErrorFilterable)view.getFilter()).getSelectedSeverityViewNames();
      selectedMetrics=Util.convertToEnumFromCamelCase(metrics,ErrorMetric.class);
      view.reset();
      fetchMetrics(selectedMetrics,selectionContext,selectedDate1,selectedDate2,selectedDurationHrs);
      insertHistory(selectionContext,selectedDate1,selectedDate2,selectedDurationHrs,selectedMetrics,false);
    }
  }
);
  this.view.getSelector().addSelectionHandler(new SelectionHandler<TreeItem>(){
    public void onSelection(    SelectionEvent<TreeItem> event){
      TreeItem selection=event.getSelectedItem();
      selectionContext.unselect(ObjectType.ServiceName);
      selectionContext.unselect(ObjectType.OperationName);
      selectionContext.unselect(ObjectType.ErrorId);
      selectionContext.unselect(ObjectType.ErrorName);
      if (selection.getParentItem() != null) {
        selectionContext=new SelectionContext();
        if (selection.getChildCount() == 0) {
          selectionContext.select(ObjectType.OperationName,selection.getText());
          selectionContext.select(ObjectType.ServiceName,selection.getParentItem().getText());
        }
 else {
          selectionContext.select(ObjectType.ServiceName,selection.getText());
        }
      }
      view.setSelection(selectionContext.getSelections());
      eventBus.fireEvent(new ObjectSelectionEvent(selectionContext.getSelections()));
      selectedDate1=view.getFilter().getDate1().getValue().getTime();
      selectedDate2=view.getFilter().getDate2().getValue().getTime();
      int hour1=view.getFilter().getHour1();
      int hour2=view.getFilter().getHour2();
      selectedDate1+=(Util.HRS_1_MS * hour1);
      selectedDate2+=(Util.HRS_1_MS * hour2);
      selectedDurationHrs=view.getFilter().getDuration();
      List<String> metrics=((Filterable.ErrorFilterable)view.getFilter()).getSelectedCategoryViewNames();
      if (metrics.isEmpty())       metrics=((Filterable.ErrorFilterable)view.getFilter()).getSelectedSeverityViewNames();
      selectedMetrics=Util.convertToEnumFromCamelCase(metrics,ErrorMetric.class);
      view.reset();
      fetchMetrics(selectedMetrics,selectionContext,selectedDate1,selectedDate2,selectedDurationHrs);
      insertHistory(selectionContext,selectedDate1,selectedDate2,selectedDurationHrs,selectedMetrics,false);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Bind.
 */
public void bind(){
  this.eventBus.addHandler(GetServicesEvent.TYPE,new GetServicesEventHandler(){
    public void onData(    GetServicesEvent event){
      if (servicesList == null) {
        servicesList=event.getData();
        view.setServicesMap(event.getData());
      }
    }
  }
);
  this.eventBus.addHandler(ObjectSelectionEvent.TYPE,new ObjectSelectionEventHandler(){
    public void onSelection(    ObjectSelectionEvent event){
      selectionContext=new SelectionContext();
      Map<ObjectType,String> selections=event.getSelections();
      if (selections != null) {
        for (        Map.Entry<ObjectType,String> entry : selections.entrySet()) {
          if (entry.getValue() != null)           selectionContext.select(entry.getKey(),entry.getValue());
        }
      }
    }
  }
);
  this.eventBus.addHandler(DateFilterSelectionEvent.TYPE,new DateFilterSelectionHandler(){
    public void onSelection(    DateFilterSelectionEvent event){
      selectedDate1=event.getDate1();
      selectedDate2=event.getDate2();
      selectedDurationHrs=event.getDuration();
      view.getFilter().setHours1(Util.getAvailableHours(selectedDate1));
      view.getFilter().setHour1(new Date(selectedDate1).getHours());
      view.getFilter().setDate1(new Date(selectedDate1));
      view.getFilter().setDate2(new Date(selectedDate2));
      view.getFilter().setDuration(selectedDurationHrs);
    }
  }
);
  this.view.getFilter().getDate1().addValueChangeHandler(new ValueChangeHandler<Date>(){
    public void onValueChange(    ValueChangeEvent<Date> event){
      Date date=event.getValue();
      int[] hrs=Util.getAvailableHours(date);
      view.getFilter().setHours1(hrs);
    }
  }
);
  this.view.getFilter().getDate2().addValueChangeHandler(new ValueChangeHandler<Date>(){
    public void onValueChange(    ValueChangeEvent<Date> event){
      Date date=event.getValue();
      int[] hrs=Util.getAvailableHours(date);
    }
  }
);
  this.view.getFilter().getApplyButton().addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      long oldDate1=selectedDate1;
      long oldDate2=selectedDate2;
      selectedDate1=view.getFilter().getDate1().getValue().getTime();
      selectedDate2=view.getFilter().getDate2().getValue().getTime();
      int hour1=view.getFilter().getHour1();
      int hour2=view.getFilter().getHour1();
      selectedDate1+=(Util.HRS_1_MS * hour1);
      selectedDate2+=(Util.HRS_1_MS * hour2);
      int oldDuration=selectedDurationHrs;
      selectedDurationHrs=view.getFilter().getDuration();
      view.setFilterLabel(makeFilterLabel(selectedDate1,selectedDate2,selectedDurationHrs));
      if ((oldDate1 != selectedDate1) || (oldDate2 != selectedDate2) || (oldDuration != selectedDurationHrs)) {
        eventBus.fireEvent(new DateFilterSelectionEvent(selectedDate1,selectedDate2,selectedDurationHrs));
      }
      view.setFilterLabel(makeFilterLabel(selectedDate1,selectedDate2,selectedDurationHrs));
      List<String> metrics=((Filterable.ErrorFilterable)view.getFilter()).getSelectedCategoryViewNames();
      if (metrics.isEmpty())       metrics=((Filterable.ErrorFilterable)view.getFilter()).getSelectedSeverityViewNames();
      selectedMetrics=Util.convertToEnumFromCamelCase(metrics,ErrorMetric.class);
      view.reset();
      fetchMetrics(selectedMetrics,selectionContext,selectedDate1,selectedDate2,selectedDurationHrs);
      insertHistory(selectionContext,selectedDate1,selectedDate2,selectedDurationHrs,selectedMetrics,false);
    }
  }
);
  this.view.getSelector().addSelectionHandler(new SelectionHandler<TreeItem>(){
    public void onSelection(    SelectionEvent<TreeItem> event){
      TreeItem selection=event.getSelectedItem();
      selectionContext.unselect(ObjectType.ServiceName);
      selectionContext.unselect(ObjectType.OperationName);
      selectionContext.unselect(ObjectType.ErrorId);
      selectionContext.unselect(ObjectType.ErrorName);
      if (selection.getParentItem() != null) {
        selectionContext=new SelectionContext();
        if (selection.getChildCount() == 0) {
          selectionContext.select(ObjectType.OperationName,selection.getText());
          selectionContext.select(ObjectType.ServiceName,selection.getParentItem().getText());
        }
 else {
          selectionContext.select(ObjectType.ServiceName,selection.getText());
        }
      }
      view.setSelection(selectionContext.getSelections());
      eventBus.fireEvent(new ObjectSelectionEvent(selectionContext.getSelections()));
      selectedDate1=view.getFilter().getDate1().getValue().getTime();
      selectedDate2=view.getFilter().getDate2().getValue().getTime();
      int hour1=view.getFilter().getHour1();
      int hour2=view.getFilter().getHour1();
      selectedDate1+=(Util.HRS_1_MS * hour1);
      selectedDate2+=(Util.HRS_1_MS * hour2);
      selectedDurationHrs=view.getFilter().getDuration();
      List<String> metrics=((Filterable.ErrorFilterable)view.getFilter()).getSelectedCategoryViewNames();
      if (metrics.isEmpty())       metrics=((Filterable.ErrorFilterable)view.getFilter()).getSelectedSeverityViewNames();
      selectedMetrics=Util.convertToEnumFromCamelCase(metrics,ErrorMetric.class);
      view.reset();
      fetchMetrics(selectedMetrics,selectionContext,selectedDate1,selectedDate2,selectedDurationHrs);
      insertHistory(selectionContext,selectedDate1,selectedDate2,selectedDurationHrs,selectedMetrics,false);
    }
  }
);
}