Program: 18574
Project: 18574
Buggy source:
public void go(HasWidgets container,HistoryToken token){
  selectionContext=SelectionContext.fromHistoryToken(token);
  view.setSelection(selectionContext.getSelections());
  if (servicesList == null)   fetchServices();
  FilterContext filter=FilterContext.fromHistoryToken(token);
  Date now=new Date();
  long fullTimeLastHour=Util.getLastHour(now);
  long sameTimeYesterday=Util.get24HrsPrevious(fullTimeLastHour);
  selectedDate1=(filter.getDate1() == 0 ? new Date(sameTimeYesterday).getTime() : filter.getDate1());
  selectedDate2=(filter.getDate2() == 0 ? new Date(fullTimeLastHour).getTime() : filter.getDate2());
  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));
  String tmp=HistoryToken.getValue(token,HistoryToken.SELECTED_DURATION_TOKEN);
  selectedDuration=(filter.getDurationHrs() == 0 ? MetricsQueryService.DEFAULT_DURATION_HRS : filter.getDurationHrs());
  int[] intervals=new int[24];
  for (int i=0; i < 24; i++)   intervals[i]=i + 1;
  view.getFilter().setDurations(intervals);
  view.getFilter().setDuration(selectedDuration);
  view.setFilterLabel(makeFilterLabel(selectedDate1,selectedDate2,selectedDuration));
  if (selectionContext.getSelection(ObjectType.ConsumerName) == null) {
    view.getFilter().setMetricNames(Util.convertFromEnumToCamelCase(ANY_CONSUMER_METRICS));
    if (filter.getMetricNames() == null) {
      selectedMetrics=ANY_CONSUMER_METRICS;
    }
 else {
      selectedMetrics=Util.convertToEnumFromCamelCase(filter.getMetricNames(),ConsumerMetric.class);
      if (selectedMetrics == null || selectedMetrics.isEmpty())       selectedMetrics=ANY_CONSUMER_METRICS;
    }
  }
 else {
    view.getFilter().setMetricNames(Util.convertFromEnumToCamelCase(ONE_CONSUMER_METRICS));
    if (filter.getMetricNames() == null)     selectedMetrics=ONE_CONSUMER_METRICS;
 else     selectedMetrics=Util.convertToEnumFromCamelCase(filter.getMetricNames(),ConsumerMetric.class);
  }
  view.getFilter().setSelectedMetricNames(Util.convertFromEnumToCamelCase(selectedMetrics));
  view.reset();
  fetchMetrics(selectedMetrics,selectionContext,selectedDate1,selectedDate2,selectedDuration);
  ((Dashboard)container).activate(this.view);
}

Fixed version (ground truth):
public void go(HasWidgets container,HistoryToken token){
  selectionContext=SelectionContext.fromHistoryToken(token);
  view.setSelection(selectionContext.getSelections());
  if (servicesList == null)   fetchServices();
  FilterContext filter=FilterContext.fromHistoryToken(token);
  Date now=new Date();
  long fullTimeLastHour=Util.getLastHour(now);
  long sameTimeYesterday=Util.get24HrsPrevious(fullTimeLastHour);
  selectedDate1=(filter.getDate1() == 0 ? new Date(sameTimeYesterday).getTime() : filter.getDate1());
  selectedDate2=(filter.getDate2() == 0 ? new Date(fullTimeLastHour).getTime() : filter.getDate2());
  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));
  String tmp=HistoryToken.getValue(token,HistoryToken.SELECTED_DURATION_TOKEN);
  selectedDuration=(filter.getDurationHrs() == 0 ? MetricsQueryService.DEFAULT_DURATION_HRS : filter.getDurationHrs());
  int[] intervals=new int[24];
  for (int i=0; i < 24; i++)   intervals[i]=i + 1;
  view.getFilter().setDurations(intervals);
  view.getFilter().setDuration(selectedDuration);
  view.setFilterLabel(makeFilterLabel(selectedDate1,selectedDate2,selectedDuration));
  if (selectionContext.getSelection(ObjectType.ConsumerName) == null) {
    view.getFilter().setMetricNames(Util.convertFromEnumToCamelCase(ANY_CONSUMER_METRICS));
    if (filter.getMetricNames() == null) {
      selectedMetrics=ANY_CONSUMER_METRICS;
    }
 else {
      selectedMetrics=Util.convertToEnumFromCamelCase(filter.getMetricNames(),ConsumerMetric.class);
      if (selectedMetrics == null || selectedMetrics.isEmpty())       selectedMetrics=ANY_CONSUMER_METRICS;
    }
  }
 else {
    view.getFilter().setMetricNames(Util.convertFromEnumToCamelCase(ONE_CONSUMER_METRICS));
    if (filter.getMetricNames() == null)     selectedMetrics=ONE_CONSUMER_METRICS;
 else     selectedMetrics=Util.convertToEnumFromCamelCase(filter.getMetricNames(),ConsumerMetric.class);
  }
  view.getFilter().setSelectedMetricNames(Util.convertFromEnumToCamelCase(selectedMetrics));
  view.reset();
  fetchMetrics(selectedMetrics,selectionContext,selectedDate1,selectedDate2,selectedDuration);
  ((Dashboard)container).activate(this.view);
}