Program: 18572
Project: 18572
Buggy source:
/** 
 * Bind.
 */
public void bind(){
  this.eventBus.addHandler(GetServicesEvent.TYPE,new GetServicesEventHandler(){
    public void onData(    GetServicesEvent event){
      if (ConsumerPresenter.this.servicesList == null) {
        ConsumerPresenter.this.servicesList=event.getData();
        ConsumerPresenter.this.view.setServicesMap(event.getData());
      }
    }
  }
);
  this.eventBus.addHandler(ObjectSelectionEvent.TYPE,new ObjectSelectionEventHandler(){
    public void onSelection(    ObjectSelectionEvent event){
      selectionContext=new SelectionContext();
      if (event.getSelection(ObjectType.ServiceName) != null)       selectionContext.select(ObjectType.ServiceName,event.getSelection(ObjectType.ServiceName));
      if (event.getSelection(ObjectType.OperationName) != null)       selectionContext.select(ObjectType.OperationName,event.getSelection(ObjectType.OperationName));
    }
  }
);
  this.eventBus.addHandler(DateFilterSelectionEvent.TYPE,new DateFilterSelectionHandler(){
    public void onSelection(    DateFilterSelectionEvent event){
      selectedDate1=event.getDate1();
      selectedDate2=event.getDate2();
      selectedDuration=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(selectedDuration);
    }
  }
);
  this.view.getFilter().getDate1().addValueChangeHandler(new ValueChangeHandler<Date>(){
    public void onValueChange(    ValueChangeEvent<Date> event){
      Date date=event.getValue();
      int[] hrs=Util.getAvailableHours(date);
      ConsumerPresenter.this.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);
      ConsumerPresenter.this.view.getFilter().setHours2(hrs);
    }
  }
);
  this.view.getFilter().getApplyButton().addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      long oldDate1=selectedDate1;
      long oldDate2=selectedDate2;
      selectedDate1=ConsumerPresenter.this.view.getFilter().getDate1().getValue().getTime();
      selectedDate2=ConsumerPresenter.this.view.getFilter().getDate2().getValue().getTime();
      int hour1=ConsumerPresenter.this.view.getFilter().getHour1();
      int hour2=ConsumerPresenter.this.view.getFilter().getHour2();
      selectedDate1+=(Util.HRS_1_MS * hour1);
      selectedDate2+=(Util.HRS_1_MS * hour2);
      int oldDuration=selectedDuration;
      selectedDuration=ConsumerPresenter.this.view.getFilter().getDuration();
      view.setFilterLabel(makeFilterLabel(selectedDate1,selectedDate2,selectedDuration));
      if ((oldDate1 != selectedDate1) || (oldDate2 != selectedDate2) || (oldDuration != selectedDuration)) {
        eventBus.fireEvent(new DateFilterSelectionEvent(selectedDate1,selectedDate2,selectedDuration));
      }
      selectedMetrics=Util.convertToEnumFromCamelCase(ConsumerPresenter.this.view.getFilter().getSelectedMetricNames(),ConsumerMetric.class);
      ConsumerPresenter.this.view.reset();
      fetchMetrics(selectedMetrics,selectionContext,selectedDate1,selectedDate2,selectedDuration);
      insertHistory(selectionContext,selectedDate1,selectedDate2,selectedDuration,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);
      if (selection.getParentItem() != null) {
        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=ConsumerPresenter.this.view.getFilter().getDate1().getValue().getTime();
      selectedDate2=ConsumerPresenter.this.view.getFilter().getDate2().getValue().getTime();
      int hour1=ConsumerPresenter.this.view.getFilter().getHour1();
      int hour2=ConsumerPresenter.this.view.getFilter().getHour2();
      selectedDate1+=(Util.HRS_1_MS * hour1);
      selectedDate2+=(Util.HRS_1_MS * hour2);
      selectedDuration=ConsumerPresenter.this.view.getFilter().getDuration();
      selectedMetrics=Util.convertToEnumFromCamelCase(ConsumerPresenter.this.view.getFilter().getSelectedMetricNames(),ConsumerMetric.class);
      view.reset();
      fetchMetrics(selectedMetrics,selectionContext,selectedDate1,selectedDate2,selectedDuration);
      insertHistory(selectionContext,selectedDate1,selectedDate2,selectedDuration,selectedMetrics,false);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Bind.
 */
public void bind(){
  this.eventBus.addHandler(GetServicesEvent.TYPE,new GetServicesEventHandler(){
    public void onData(    GetServicesEvent event){
      if (ConsumerPresenter.this.servicesList == null) {
        ConsumerPresenter.this.servicesList=event.getData();
        ConsumerPresenter.this.view.setServicesMap(event.getData());
      }
    }
  }
);
  this.eventBus.addHandler(ObjectSelectionEvent.TYPE,new ObjectSelectionEventHandler(){
    public void onSelection(    ObjectSelectionEvent event){
      selectionContext=new SelectionContext();
      if (event.getSelection(ObjectType.ServiceName) != null)       selectionContext.select(ObjectType.ServiceName,event.getSelection(ObjectType.ServiceName));
      if (event.getSelection(ObjectType.OperationName) != null)       selectionContext.select(ObjectType.OperationName,event.getSelection(ObjectType.OperationName));
    }
  }
);
  this.eventBus.addHandler(DateFilterSelectionEvent.TYPE,new DateFilterSelectionHandler(){
    public void onSelection(    DateFilterSelectionEvent event){
      selectedDate1=event.getDate1();
      selectedDate2=event.getDate2();
      selectedDuration=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(selectedDuration);
    }
  }
);
  this.view.getFilter().getDate1().addValueChangeHandler(new ValueChangeHandler<Date>(){
    public void onValueChange(    ValueChangeEvent<Date> event){
      Date date=event.getValue();
      int[] hrs=Util.getAvailableHours(date);
      ConsumerPresenter.this.view.getFilter().setHours1(hrs);
    }
  }
);
  this.view.getFilter().getApplyButton().addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      long oldDate1=selectedDate1;
      long oldDate2=selectedDate2;
      selectedDate1=ConsumerPresenter.this.view.getFilter().getDate1().getValue().getTime();
      selectedDate2=ConsumerPresenter.this.view.getFilter().getDate2().getValue().getTime();
      int hour1=ConsumerPresenter.this.view.getFilter().getHour1();
      int hour2=ConsumerPresenter.this.view.getFilter().getHour1();
      selectedDate1+=(Util.HRS_1_MS * hour1);
      selectedDate2+=(Util.HRS_1_MS * hour2);
      int oldDuration=selectedDuration;
      selectedDuration=ConsumerPresenter.this.view.getFilter().getDuration();
      view.setFilterLabel(makeFilterLabel(selectedDate1,selectedDate2,selectedDuration));
      if ((oldDate1 != selectedDate1) || (oldDate2 != selectedDate2) || (oldDuration != selectedDuration)) {
        eventBus.fireEvent(new DateFilterSelectionEvent(selectedDate1,selectedDate2,selectedDuration));
      }
      selectedMetrics=Util.convertToEnumFromCamelCase(ConsumerPresenter.this.view.getFilter().getSelectedMetricNames(),ConsumerMetric.class);
      ConsumerPresenter.this.view.reset();
      fetchMetrics(selectedMetrics,selectionContext,selectedDate1,selectedDate2,selectedDuration);
      insertHistory(selectionContext,selectedDate1,selectedDate2,selectedDuration,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);
      if (selection.getParentItem() != null) {
        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=ConsumerPresenter.this.view.getFilter().getDate1().getValue().getTime();
      selectedDate2=ConsumerPresenter.this.view.getFilter().getDate2().getValue().getTime();
      int hour1=ConsumerPresenter.this.view.getFilter().getHour1();
      int hour2=ConsumerPresenter.this.view.getFilter().getHour1();
      selectedDate1+=(Util.HRS_1_MS * hour1);
      selectedDate2+=(Util.HRS_1_MS * hour2);
      selectedDuration=ConsumerPresenter.this.view.getFilter().getDuration();
      selectedMetrics=Util.convertToEnumFromCamelCase(ConsumerPresenter.this.view.getFilter().getSelectedMetricNames(),ConsumerMetric.class);
      view.reset();
      fetchMetrics(selectedMetrics,selectionContext,selectedDate1,selectedDate2,selectedDuration);
      insertHistory(selectionContext,selectedDate1,selectedDate2,selectedDuration,selectedMetrics,false);
    }
  }
);
}