Program: 32276
Project: 32276
Buggy source:
public ReportsDialog(ListStore<Report> reportStore,ListStore<Device> deviceStore,ListStore<GeoFence> geoFenceStore,ReportHandler reportHandler){
  ReportProperties reportProperties=GWT.create(ReportProperties.class);
  this.reportStore=reportStore;
  this.reportHandler=reportHandler;
  List<ColumnConfig<Report,?>> columnConfigList=new LinkedList<ColumnConfig<Report,?>>();
  columnConfigList.add(new ColumnConfig<Report,String>(reportProperties.name(),25,i18n.name()));
  columnConfigList.add(new ColumnConfig<Report,String>(new ReportProperties.ReportTypeLabelProvider(),25,i18n.type()));
  columnModel=new ColumnModel<Report>(columnConfigList);
  DeviceProperties deviceProperties=GWT.create(DeviceProperties.class);
  this.deviceStore=deviceStore;
  this.devicesList=new ListView<Device,String>(deviceStore,deviceProperties.name());
  GeoFenceProperties geoFenceProperties=GWT.create(GeoFenceProperties.class);
  this.geoFenceStore=geoFenceStore;
  this.geoFencesList=new ListView<GeoFence,String>(geoFenceStore,geoFenceProperties.name());
  ListStore<ReportType> geoFenceTypeStore=new ListStore<ReportType>(new EnumKeyProvider<ReportType>());
  geoFenceTypeStore.addAll(Arrays.asList(ReportType.values()));
  type=new ComboBox<ReportType>(geoFenceTypeStore,new ReportProperties.ReportTypeLabelProvider());
  type.setForceSelection(true);
  type.setTriggerAction(ComboBoxCell.TriggerAction.ALL);
  period=new PeriodComboBox();
  uiBinder.createAndBindUi(this);
  grid.getSelectionModel().setSelectionMode(Style.SelectionMode.SINGLE);
  grid.getSelectionModel().addSelectionChangedHandler(new SelectionChangedEvent.SelectionChangedHandler<Report>(){
    @Override public void onSelectionChanged(    SelectionChangedEvent<Report> event){
      if (event.getSelection().isEmpty()) {
        driver.edit(new Report());
      }
 else {
        driver.edit(event.getSelection().get(0));
      }
      removeButton.setEnabled(!event.getSelection().isEmpty());
    }
  }
);
  period.init(fromDateField,fromTimeField,toDateField,toTimeField);
  geoFences=new ListViewEditor<GeoFence>(geoFencesList);
  devices=new ListViewEditor<Device>(devicesList);
  fromDate=new DateTimeEditor(fromDateField,fromTimeField);
  toDate=new DateTimeEditor(toDateField,toTimeField);
  driver.initialize(this);
  driver.edit(new Report());
  period.selectFirst();
}

Fixed version (ground truth):
public ReportsDialog(ListStore<Report> reportStore,ListStore<Device> deviceStore,ListStore<GeoFence> geoFenceStore,ReportHandler reportHandler){
  ReportProperties reportProperties=GWT.create(ReportProperties.class);
  this.reportStore=reportStore;
  this.reportHandler=reportHandler;
  List<ColumnConfig<Report,?>> columnConfigList=new LinkedList<ColumnConfig<Report,?>>();
  columnConfigList.add(new ColumnConfig<Report,String>(reportProperties.name(),25,i18n.name()));
  columnConfigList.add(new ColumnConfig<Report,String>(new ReportProperties.ReportTypeLabelProvider(),25,i18n.type()));
  columnModel=new ColumnModel<Report>(columnConfigList);
  DeviceProperties deviceProperties=GWT.create(DeviceProperties.class);
  this.deviceStore=deviceStore;
  this.devicesList=new ListView<Device,String>(deviceStore,deviceProperties.name());
  GeoFenceProperties geoFenceProperties=GWT.create(GeoFenceProperties.class);
  this.geoFenceStore=geoFenceStore;
  this.geoFencesList=new ListView<GeoFence,String>(geoFenceStore,geoFenceProperties.name());
  ListStore<ReportType> geoFenceTypeStore=new ListStore<ReportType>(new EnumKeyProvider<ReportType>());
  geoFenceTypeStore.addAll(Arrays.asList(ReportType.values()));
  type=new ComboBox<ReportType>(geoFenceTypeStore,new ReportProperties.ReportTypeLabelProvider());
  type.setForceSelection(true);
  type.setTriggerAction(ComboBoxCell.TriggerAction.ALL);
  period=new PeriodComboBox();
  uiBinder.createAndBindUi(this);
  grid.getSelectionModel().setSelectionMode(Style.SelectionMode.SINGLE);
  grid.getSelectionModel().addSelectionChangedHandler(new SelectionChangedEvent.SelectionChangedHandler<Report>(){
    @Override public void onSelectionChanged(    SelectionChangedEvent<Report> event){
      Report report=event.getSelection().isEmpty() ? new Report() : event.getSelection().get(0);
      driver.edit(report);
      if (event.getSelection().isEmpty()) {
        period.selectFirst();
      }
 else {
        period.update();
      }
      updateGeoFencesListState();
      removeButton.setEnabled(!event.getSelection().isEmpty());
    }
  }
);
  type.addSelectionHandler(new SelectionHandler<ReportType>(){
    @Override public void onSelection(    SelectionEvent<ReportType> event){
      updateGeoFencesListState();
    }
  }
);
  period.init(fromDateField,fromTimeField,toDateField,toTimeField);
  geoFencesPanel.setHeadingText(i18n.overlayType(UserSettings.OverlayType.GEO_FENCES));
  geoFences=new ListViewEditor<GeoFence>(geoFencesList);
  devices=new ListViewEditor<Device>(devicesList);
  fromDate=new DateTimeEditor(fromDateField,fromTimeField);
  toDate=new DateTimeEditor(toDateField,toTimeField);
  driver.initialize(this);
  driver.edit(new Report());
  period.selectFirst();
}