Program: 73728
Project: 73728
Buggy source:
public void handleEvent(Event event){
  fbException=false;
  if (event.type == CustomPreviewTable.MOUSE_RIGHT_CLICK_TYPE) {
    if (getDataServiceProvider().getBoundDataSet() != null || getDataServiceProvider().getReportDataSet() != null) {
      if (event.widget instanceof Button) {
        Button header=(Button)event.widget;
        if (header.getMenu() == null) {
          header.setMenu(createMenuManager(event.data).createContextMenu(tablePreview));
        }
        header.getMenu().setVisible(true);
      }
    }
  }
 else   if (event.type == SWT.Selection) {
    if (event.widget instanceof MenuItem) {
      MenuItem item=(MenuItem)event.widget;
      IAction action=(IAction)item.getData();
      action.setChecked(!action.isChecked());
      action.run();
    }
 else     if (event.widget == btnFilters) {
      if (invokeEditFilter() == Window.OK) {
        refreshTablePreview();
        fireEvent(btnFilters,EVENT_PREVIEW);
      }
    }
 else     if (event.widget == btnParameters) {
      if (invokeEditParameter() == Window.OK) {
        refreshTablePreview();
        fireEvent(btnParameters,EVENT_PREVIEW);
      }
    }
 else     if (event.widget == btnBinding) {
      if (invokeDataBinding() == Window.OK) {
        refreshTablePreview();
        fireEvent(btnBinding,EVENT_PREVIEW);
      }
    }
    try {
      if (event.widget == btnInherit) {
        ColorPalette.getInstance().restore();
        if (!btnInherit.getSelection()) {
          return;
        }
        getDataServiceProvider().setReportItemReference(null);
        getDataServiceProvider().setDataSet(null);
        switchDataSet(null);
        cmbDataItems.select(0);
        cmbDataItems.setEnabled(false);
        setEnabledForButtons();
        updateDragDataSource();
      }
 else       if (event.widget == btnUseData) {
        if (!btnUseData.getSelection()) {
          return;
        }
        getDataServiceProvider().setReportItemReference(null);
        selectDataSet();
        cmbDataItems.setEnabled(true);
        setEnabledForButtons();
        updateDragDataSource();
      }
 else       if (event.widget == cmbDataItems) {
        ColorPalette.getInstance().restore();
        int selectedIndex=cmbDataItems.getSelectionIndex();
        Integer selectState=(Integer)selectDataTypes.get(selectedIndex);
switch (selectState.intValue()) {
case SELECT_NONE:
          btnInherit.setSelection(true);
        btnUseData.setSelection(false);
      btnInherit.notifyListeners(SWT.Selection,new Event());
    break;
case SELECT_NEXT:
  selectedIndex++;
selectState=(Integer)selectDataTypes.get(selectedIndex);
cmbDataItems.select(selectedIndex);
break;
}
switch (selectState.intValue()) {
case SELECT_DATA_SET:
if (getDataServiceProvider().getBoundDataSet() != null && getDataServiceProvider().getBoundDataSet().equals(cmbDataItems.getText())) {
return;
}
getDataServiceProvider().setDataSet(cmbDataItems.getText());
switchDataSet(cmbDataItems.getText());
setEnabledForButtons();
updateDragDataSource();
break;
case SELECT_DATA_CUBE:
getDataServiceProvider().setDataCube(cmbDataItems.getText());
updateDragDataSource();
setEnabledForButtons();
break;
case SELECT_REPORT_ITEM:
if (cmbDataItems.getText().equals(getDataServiceProvider().getReportItemReference())) {
return;
}
getDataServiceProvider().setReportItemReference(cmbDataItems.getText());
setEnabledForButtons();
updateDragDataSource();
break;
}
updatePredefinedQueries();
}
 else if (event.widget == btnNewData) {
int result=invokeNewDataSet();
if (result == Window.CANCEL) {
return;
}
String currentDataSet=cmbDataItems.getText();
cmbDataItems.removeAll();
cmbDataItems.setItems(createDataComboItems());
cmbDataItems.setText(currentDataSet);
}
}
 catch (ChartException e1) {
fbException=true;
ChartWizard.showException(e1.getLocalizedMessage());
}
}
if (!fbException) {
WizardBase.removeException();
}
}

Fixed version (ground truth):
public void handleEvent(Event event){
  fbException=false;
  if (event.type == CustomPreviewTable.MOUSE_RIGHT_CLICK_TYPE) {
    if (getDataServiceProvider().getBoundDataSet() != null || getDataServiceProvider().getReportDataSet() != null) {
      if (event.widget instanceof Button) {
        Button header=(Button)event.widget;
        if (header.getMenu() == null) {
          header.setMenu(createMenuManager(event.data).createContextMenu(tablePreview));
        }
        header.getMenu().setVisible(true);
      }
    }
  }
 else   if (event.type == SWT.Selection) {
    if (event.widget instanceof MenuItem) {
      MenuItem item=(MenuItem)event.widget;
      IAction action=(IAction)item.getData();
      action.setChecked(!action.isChecked());
      action.run();
    }
 else     if (event.widget == btnFilters) {
      if (invokeEditFilter() == Window.OK) {
        refreshTablePreview();
        fireEvent(btnFilters,EVENT_PREVIEW);
      }
    }
 else     if (event.widget == btnParameters) {
      if (invokeEditParameter() == Window.OK) {
        refreshTablePreview();
        fireEvent(btnParameters,EVENT_PREVIEW);
      }
    }
 else     if (event.widget == btnBinding) {
      if (invokeDataBinding() == Window.OK) {
        refreshTablePreview();
        fireEvent(btnBinding,EVENT_PREVIEW);
      }
    }
    try {
      if (event.widget == btnInherit) {
        ColorPalette.getInstance().restore();
        if (!btnInherit.getSelection()) {
          return;
        }
        getDataServiceProvider().setReportItemReference(null);
        getDataServiceProvider().setDataSet(null);
        switchDataSet(null);
        cmbDataItems.select(0);
        cmbDataItems.setEnabled(false);
        setEnabledForButtons();
        updateDragDataSource();
        updatePredefinedQueries();
      }
 else       if (event.widget == btnUseData) {
        if (!btnUseData.getSelection()) {
          return;
        }
        getDataServiceProvider().setReportItemReference(null);
        selectDataSet();
        cmbDataItems.setEnabled(true);
        setEnabledForButtons();
        updateDragDataSource();
        updatePredefinedQueries();
      }
 else       if (event.widget == cmbDataItems) {
        ColorPalette.getInstance().restore();
        int selectedIndex=cmbDataItems.getSelectionIndex();
        Integer selectState=(Integer)selectDataTypes.get(selectedIndex);
switch (selectState.intValue()) {
case SELECT_NONE:
          btnInherit.setSelection(true);
        btnUseData.setSelection(false);
      btnInherit.notifyListeners(SWT.Selection,new Event());
    break;
case SELECT_NEXT:
  selectedIndex++;
selectState=(Integer)selectDataTypes.get(selectedIndex);
cmbDataItems.select(selectedIndex);
break;
}
switch (selectState.intValue()) {
case SELECT_DATA_SET:
if (getDataServiceProvider().getBoundDataSet() != null && getDataServiceProvider().getBoundDataSet().equals(cmbDataItems.getText())) {
return;
}
getDataServiceProvider().setDataSet(cmbDataItems.getText());
switchDataSet(cmbDataItems.getText());
setEnabledForButtons();
updateDragDataSource();
break;
case SELECT_DATA_CUBE:
getDataServiceProvider().setDataCube(cmbDataItems.getText());
updateDragDataSource();
setEnabledForButtons();
break;
case SELECT_REPORT_ITEM:
if (cmbDataItems.getText().equals(getDataServiceProvider().getReportItemReference())) {
return;
}
getDataServiceProvider().setReportItemReference(cmbDataItems.getText());
setEnabledForButtons();
updateDragDataSource();
break;
}
updatePredefinedQueries();
}
 else if (event.widget == btnNewData) {
int result=invokeNewDataSet();
if (result == Window.CANCEL) {
return;
}
String currentDataSet=cmbDataItems.getText();
cmbDataItems.removeAll();
cmbDataItems.setItems(createDataComboItems());
cmbDataItems.setText(currentDataSet);
}
}
 catch (ChartException e1) {
fbException=true;
ChartWizard.showException(e1.getLocalizedMessage());
}
}
if (!fbException) {
WizardBase.removeException();
}
}