Program: 67908
Project: 67908
Buggy source:
public void widgetSelected(SelectionEvent e){
  if (detachPopup(e.widget)) {
    return;
  }
  if (isRegistered(e.widget)) {
    attachPopup(((Button)e.widget).getData().toString());
  }
  if (e.widget == btnFixLabelSpan) {
    boolean bLabelThickFixed=btnFixLabelSpan.getSelection();
    lneLabelSpan.setEnabled(bLabelThickFixed);
    if (!bLabelThickFixed) {
      getAxisForProcessing().unsetLabelSpan();
    }
 else {
      getAxisForProcessing().setLabelSpan(lneLabelSpan.getValue());
    }
  }
  if (e.widget.equals(cmbTypes)) {
    final AxisType axisType=AxisType.getByName(LiteralHelper.axisTypeSet.getNameByDisplayName(cmbTypes.getText()));
    if (getAxisForProcessing().getType() == axisType) {
      return;
    }
    ChartAdapter.beginIgnoreNotifications();
{
      convertSampleData(axisType);
      getAxisForProcessing().setFormatSpecifier(null);
      EList<MarkerLine> markerLines=getAxisForProcessing().getMarkerLines();
      for (int i=0; i < markerLines.size(); i++) {
        markerLines.get(i).setFormatSpecifier(null);
      }
      EList<MarkerRange> markerRanges=getAxisForProcessing().getMarkerRanges();
      for (int i=0; i < markerRanges.size(); i++) {
        markerRanges.get(i).setFormatSpecifier(null);
      }
    }
    ChartAdapter.endIgnoreNotifications();
    getAxisForProcessing().setType(axisType);
    if (btnCategoryAxis != null) {
      btnCategoryAxis.setEnabled(!AxisType.TEXT_LITERAL.equals(axisType));
    }
    refreshPopupSheet();
  }
 else   if (e.widget.equals(cmbOrigin)) {
    if (LiteralHelper.intersectionTypeSet.getNameByDisplayName(cmbOrigin.getText()).equals(IntersectionType.VALUE_LITERAL.getName())) {
      lblValue.setEnabled(true);
      txtValue.setEnabled(true);
    }
 else {
      lblValue.setEnabled(false);
      txtValue.setEnabled(false);
    }
    getAxisForProcessing().getOrigin().setType(IntersectionType.getByName(LiteralHelper.intersectionTypeSet.getNameByDisplayName(cmbOrigin.getText())));
    if (getAxisForProcessing().getOrigin().getType().getValue() == IntersectionType.VALUE) {
      getAxisForProcessing().getOrigin().setValue(txtValue.getDataElement());
    }
  }
 else   if (e.widget.equals(btnCategoryAxis)) {
    getAxisForProcessing().setCategoryAxis(btnCategoryAxis.getSelection());
    ChartCacheManager.getInstance().cacheCategory(((ChartWithAxes)getChart()).getType(),btnCategoryAxis.getSelection());
    refreshPopupSheet();
    btnReverse.setEnabled(btnCategoryAxis.getSelection());
    ((ChartWithAxes)getChart()).setReverseCategory(false);
    btnReverse.setSelection(false);
  }
 else   if (e.widget.equals(btnReverse)) {
    ((ChartWithAxes)getChart()).setReverseCategory(btnReverse.getSelection());
  }
 else   if (e.widget.equals(btnTitleVisible)) {
    getAxisForProcessing().getTitle().setVisible(btnTitleVisible.getSelection());
    setStateOfTitle();
    Button btnAxisTitle=getToggleButton(BUTTON_TITLE);
    if (!btnTitleVisible.getSelection() && btnAxisTitle.getSelection()) {
      btnAxisTitle.setSelection(false);
      detachPopup(btnAxisTitle);
    }
 else {
      refreshPopupSheet();
    }
  }
 else   if (e.widget.equals(btnLabelVisible)) {
    getAxisForProcessing().getLabel().setVisible(btnLabelVisible.getSelection());
    setStateOfLabel();
    Button btnAxisLabel=getToggleButton(BUTTON_LABEL);
    if (!btnLabelVisible.getSelection() && btnAxisLabel.getSelection()) {
      btnAxisLabel.setSelection(false);
      detachPopup(btnAxisLabel);
    }
 else {
      refreshPopupSheet();
    }
  }
 else   if (e.widget.equals(btnFormatSpecifier)) {
    String sAxisTitle=Messages.getString("String_Node_Str");
    try {
      String sTitleString=getAxisForProcessing().getTitle().getCaption().getValue();
      int iSeparatorIndex=sTitleString.indexOf(ExternalizedTextEditorComposite.SEPARATOR);
      if (iSeparatorIndex > 0) {
        sTitleString=sTitleString.substring(iSeparatorIndex);
      }
 else       if (iSeparatorIndex == 0) {
        sTitleString=sTitleString.substring(ExternalizedTextEditorComposite.SEPARATOR.length());
      }
      sAxisTitle+="String_Node_Str" + sTitleString + "String_Node_Str";
    }
 catch (    NullPointerException e1) {
    }
    FormatSpecifier formatspecifier=null;
    if (getAxisForProcessing().getFormatSpecifier() != null) {
      formatspecifier=getAxisForProcessing().getFormatSpecifier();
    }
    FormatSpecifierDialog editor=new FormatSpecifierDialog(cmpContent.getShell(),formatspecifier,getAxisForProcessing().getType(),sAxisTitle);
    if (editor.open() == Window.OK) {
      if (editor.getFormatSpecifier() == null) {
        getAxisForProcessing().eUnset(ComponentPackage.eINSTANCE.getAxis_FormatSpecifier());
        return;
      }
      getAxisForProcessing().setFormatSpecifier(editor.getFormatSpecifier());
    }
  }
 else   if (e.getSource().equals(cbStaggered)) {
    getAxisForProcessing().setStaggered(cbStaggered.getSelection());
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  if (detachPopup(e.widget)) {
    return;
  }
  if (isRegistered(e.widget)) {
    attachPopup(((Button)e.widget).getData().toString());
  }
  if (e.widget == btnFixLabelSpan) {
    boolean bLabelThickFixed=btnFixLabelSpan.getSelection();
    lneLabelSpan.setEnabled(bLabelThickFixed);
    if (!bLabelThickFixed) {
      getAxisForProcessing().unsetLabelSpan();
    }
 else {
      if (lneLabelSpan.getValue() == 0) {
        double value=suggestLabelSpan(getAxisForProcessing());
        lneLabelSpan.setValue(value);
      }
      getAxisForProcessing().setLabelSpan(lneLabelSpan.getValue());
    }
  }
  if (e.widget.equals(cmbTypes)) {
    final AxisType axisType=AxisType.getByName(LiteralHelper.axisTypeSet.getNameByDisplayName(cmbTypes.getText()));
    if (getAxisForProcessing().getType() == axisType) {
      return;
    }
    ChartAdapter.beginIgnoreNotifications();
{
      convertSampleData(axisType);
      getAxisForProcessing().setFormatSpecifier(null);
      EList<MarkerLine> markerLines=getAxisForProcessing().getMarkerLines();
      for (int i=0; i < markerLines.size(); i++) {
        markerLines.get(i).setFormatSpecifier(null);
      }
      EList<MarkerRange> markerRanges=getAxisForProcessing().getMarkerRanges();
      for (int i=0; i < markerRanges.size(); i++) {
        markerRanges.get(i).setFormatSpecifier(null);
      }
    }
    ChartAdapter.endIgnoreNotifications();
    getAxisForProcessing().setType(axisType);
    if (btnCategoryAxis != null) {
      btnCategoryAxis.setEnabled(!AxisType.TEXT_LITERAL.equals(axisType));
    }
    refreshPopupSheet();
  }
 else   if (e.widget.equals(cmbOrigin)) {
    if (LiteralHelper.intersectionTypeSet.getNameByDisplayName(cmbOrigin.getText()).equals(IntersectionType.VALUE_LITERAL.getName())) {
      lblValue.setEnabled(true);
      txtValue.setEnabled(true);
    }
 else {
      lblValue.setEnabled(false);
      txtValue.setEnabled(false);
    }
    getAxisForProcessing().getOrigin().setType(IntersectionType.getByName(LiteralHelper.intersectionTypeSet.getNameByDisplayName(cmbOrigin.getText())));
    if (getAxisForProcessing().getOrigin().getType().getValue() == IntersectionType.VALUE) {
      getAxisForProcessing().getOrigin().setValue(txtValue.getDataElement());
    }
  }
 else   if (e.widget.equals(btnCategoryAxis)) {
    getAxisForProcessing().setCategoryAxis(btnCategoryAxis.getSelection());
    ChartCacheManager.getInstance().cacheCategory(((ChartWithAxes)getChart()).getType(),btnCategoryAxis.getSelection());
    refreshPopupSheet();
    btnReverse.setEnabled(btnCategoryAxis.getSelection());
    ((ChartWithAxes)getChart()).setReverseCategory(false);
    btnReverse.setSelection(false);
  }
 else   if (e.widget.equals(btnReverse)) {
    ((ChartWithAxes)getChart()).setReverseCategory(btnReverse.getSelection());
  }
 else   if (e.widget.equals(btnTitleVisible)) {
    getAxisForProcessing().getTitle().setVisible(btnTitleVisible.getSelection());
    setStateOfTitle();
    Button btnAxisTitle=getToggleButton(BUTTON_TITLE);
    if (!btnTitleVisible.getSelection() && btnAxisTitle.getSelection()) {
      btnAxisTitle.setSelection(false);
      detachPopup(btnAxisTitle);
    }
 else {
      refreshPopupSheet();
    }
  }
 else   if (e.widget.equals(btnLabelVisible)) {
    getAxisForProcessing().getLabel().setVisible(btnLabelVisible.getSelection());
    setStateOfLabel();
    Button btnAxisLabel=getToggleButton(BUTTON_LABEL);
    if (!btnLabelVisible.getSelection() && btnAxisLabel.getSelection()) {
      btnAxisLabel.setSelection(false);
      detachPopup(btnAxisLabel);
    }
 else {
      refreshPopupSheet();
    }
  }
 else   if (e.widget.equals(btnFormatSpecifier)) {
    String sAxisTitle=Messages.getString("String_Node_Str");
    try {
      String sTitleString=getAxisForProcessing().getTitle().getCaption().getValue();
      int iSeparatorIndex=sTitleString.indexOf(ExternalizedTextEditorComposite.SEPARATOR);
      if (iSeparatorIndex > 0) {
        sTitleString=sTitleString.substring(iSeparatorIndex);
      }
 else       if (iSeparatorIndex == 0) {
        sTitleString=sTitleString.substring(ExternalizedTextEditorComposite.SEPARATOR.length());
      }
      sAxisTitle+="String_Node_Str" + sTitleString + "String_Node_Str";
    }
 catch (    NullPointerException e1) {
    }
    FormatSpecifier formatspecifier=null;
    if (getAxisForProcessing().getFormatSpecifier() != null) {
      formatspecifier=getAxisForProcessing().getFormatSpecifier();
    }
    FormatSpecifierDialog editor=new FormatSpecifierDialog(cmpContent.getShell(),formatspecifier,getAxisForProcessing().getType(),sAxisTitle);
    if (editor.open() == Window.OK) {
      if (editor.getFormatSpecifier() == null) {
        getAxisForProcessing().eUnset(ComponentPackage.eINSTANCE.getAxis_FormatSpecifier());
        return;
      }
      getAxisForProcessing().setFormatSpecifier(editor.getFormatSpecifier());
    }
  }
 else   if (e.getSource().equals(cbStaggered)) {
    getAxisForProcessing().setStaggered(cbStaggered.getSelection());
  }
}