Program: 66149
Project: 66149
Buggy source:
public void widgetSelected(SelectionEvent e){
  if (e.getSource().equals(btnAddLine)) {
    MarkerLine line=MarkerLineImpl.createDefault(getAxisForProcessing(),createDefaultDataElement(),null);
    line.eAdapters().addAll(getAxisForProcessing().eAdapters());
    iLineCount++;
    buildList();
    lstMarkers.select(lstMarkers.getItemCount() - 1);
    updateUIForSelection();
    if (lstMarkers.getItemCount() == 1) {
      setState(true);
    }
    refreshButtons();
  }
 else   if (e.getSource().equals(btnAddRange)) {
    MarkerRange range=MarkerRangeImpl.createDefault(getAxisForProcessing(),createDefaultDataElement(),createDefaultDataElement(),null,null);
    range.eAdapters().addAll(getAxisForProcessing().eAdapters());
    iRangeCount++;
    buildList();
    lstMarkers.select(lstMarkers.getItemCount() - 1);
    updateUIForSelection();
    if (lstMarkers.getItemCount() == 1) {
      setState(true);
    }
    refreshButtons();
  }
 else   if (e.getSource().equals(btnRemove)) {
    if (lstMarkers.getSelection().length == 0) {
      return;
    }
    String sSelectedMarker=lstMarkers.getSelection()[0];
    boolean bLine=sSelectedMarker.startsWith(MARKER_LINE_LABEL);
    int iMarkerIndex=getMarkerIndex();
    if (bLine) {
      getAxisForProcessing().getMarkerLines().remove(iMarkerIndex);
      iLineCount--;
    }
 else {
      getAxisForProcessing().getMarkerRanges().remove(iMarkerIndex);
      iRangeCount--;
    }
    buildList();
    if (lstMarkers.getItemCount() > 0) {
      lstMarkers.select(0);
      updateUIForSelection();
    }
 else {
      setState(false);
      resetUI();
    }
    refreshButtons();
  }
 else   if (e.getSource().equals(lstMarkers)) {
    updateUIForSelection();
    refreshButtons();
  }
 else   if (e.getSource().equals(cmbLineAnchor)) {
    if (cmbLineAnchor.getSelectionIndex() == 0) {
      getAxisForProcessing().getMarkerLines().get(getMarkerIndex()).unsetLabelAnchor();
    }
 else {
      getAxisForProcessing().getMarkerLines().get(getMarkerIndex()).setLabelAnchor(ChartUIUtil.getFlippedAnchor(Anchor.getByName(LiteralHelper.anchorSet.getNameByDisplayName(cmbLineAnchor.getText())),isFlippedAxes()));
    }
  }
 else   if (e.getSource().equals(cmbRangeAnchor)) {
    if (cmbRangeAnchor.getSelectionIndex() == 0) {
      getAxisForProcessing().getMarkerRanges().get(getMarkerIndex()).unsetLabelAnchor();
    }
 else {
      getAxisForProcessing().getMarkerRanges().get(getMarkerIndex()).setLabelAnchor(ChartUIUtil.getFlippedAnchor(Anchor.getByName(LiteralHelper.anchorSet.getNameByDisplayName(cmbRangeAnchor.getText())),isFlippedAxes()));
    }
  }
 else   if (e.getSource().equals(btnLineFormatSpecifier)) {
    handleMarkerLineFormatBtnSelected();
  }
 else   if (e.getSource().equals(btnStartFormatSpecifier) || e.getSource().equals(btnEndFormatSpecifier)) {
    handleMarkerRangeFormatBtnSelected();
  }
 else   if (e.widget.equals(btnLineTriggers)) {
    new TriggerEditorDialog(cmpContent.getShell(),getAxisForProcessing().getMarkerLines().get(getMarkerIndex()).getTriggers(),getAxisForProcessing().getMarkerLines().get(getMarkerIndex()),getContext(),Messages.getString("String_Node_Str"),TriggerSupportMatrix.TYPE_MARKERLINE,false,true).open();
  }
 else   if (e.widget.equals(btnRangeTriggers)) {
    new TriggerEditorDialog(cmpContent.getShell(),getAxisForProcessing().getMarkerRanges().get(getMarkerIndex()).getTriggers(),getAxisForProcessing().getMarkerRanges().get(getMarkerIndex()),getContext(),Messages.getString("String_Node_Str"),TriggerSupportMatrix.TYPE_MARKERRANGE,false,true).open();
  }
 else   if (e.widget == btnTxtValueAuto) {
    MarkerLine line=getAxisForProcessing().getMarkerLines().get(getMarkerIndex());
    ChartElementUtil.setEObjectAttribute(line,"String_Node_Str",getNotNullDataElement(txtValue.getDataElement()),btnTxtValueAuto.getSelection());
    txtValue.setDataElement(line.getValue());
    txtValue.setEnabled(!btnTxtValueAuto.getSelection());
  }
 else   if (e.widget == btnTxtStartValueAuto) {
    MarkerRange range=getAxisForProcessing().getMarkerRanges().get(getMarkerIndex());
    ChartElementUtil.setEObjectAttribute(range,"String_Node_Str",getNotNullDataElement(txtStartValue.getDataElement()),btnTxtStartValueAuto.getSelection());
    txtStartValue.setDataElement(range.getStartValue());
    txtStartValue.setEnabled(!btnTxtStartValueAuto.getSelection());
  }
 else   if (e.widget == btnTxtEndValueAuto) {
    MarkerRange range=getAxisForProcessing().getMarkerRanges().get(getMarkerIndex());
    ChartElementUtil.setEObjectAttribute(range,"String_Node_Str",getNotNullDataElement(txtEndValue.getDataElement()),btnTxtEndValueAuto.getSelection());
    txtEndValue.setDataElement(range.getStartValue());
    txtEndValue.setEnabled(!btnTxtEndValueAuto.getSelection());
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  if (e.getSource().equals(btnAddLine)) {
    MarkerLine line=MarkerLineImpl.createDefault(getAxisForProcessing(),createDefaultDataElement(),null);
    line.eAdapters().addAll(getAxisForProcessing().eAdapters());
    iLineCount++;
    buildList();
    lstMarkers.select(lstMarkers.getItemCount() - 1);
    updateUIForSelection();
    if (lstMarkers.getItemCount() >= 1) {
      setState(true);
    }
    refreshButtons();
  }
 else   if (e.getSource().equals(btnAddRange)) {
    MarkerRange range=MarkerRangeImpl.createDefault(getAxisForProcessing(),createDefaultDataElement(),createDefaultDataElement(),null,null);
    range.eAdapters().addAll(getAxisForProcessing().eAdapters());
    iRangeCount++;
    buildList();
    lstMarkers.select(lstMarkers.getItemCount() - 1);
    updateUIForSelection();
    if (lstMarkers.getItemCount() >= 1) {
      setState(true);
    }
    refreshButtons();
  }
 else   if (e.getSource().equals(btnRemove)) {
    if (lstMarkers.getSelection().length == 0) {
      return;
    }
    String sSelectedMarker=lstMarkers.getSelection()[0];
    boolean bLine=sSelectedMarker.startsWith(MARKER_LINE_LABEL);
    int iMarkerIndex=getMarkerIndex();
    if (bLine) {
      getAxisForProcessing().getMarkerLines().remove(iMarkerIndex);
      iLineCount--;
    }
 else {
      getAxisForProcessing().getMarkerRanges().remove(iMarkerIndex);
      iRangeCount--;
    }
    buildList();
    if (lstMarkers.getItemCount() > 0) {
      lstMarkers.select(0);
      updateUIForSelection();
      setState(true);
    }
 else {
      setState(false);
      resetUI();
    }
    refreshButtons();
  }
 else   if (e.getSource().equals(lstMarkers)) {
    updateUIForSelection();
    setState(true);
    refreshButtons();
  }
 else   if (e.getSource().equals(cmbLineAnchor)) {
    if (cmbLineAnchor.getSelectionIndex() == 0) {
      getAxisForProcessing().getMarkerLines().get(getMarkerIndex()).unsetLabelAnchor();
    }
 else {
      getAxisForProcessing().getMarkerLines().get(getMarkerIndex()).setLabelAnchor(ChartUIUtil.getFlippedAnchor(Anchor.getByName(LiteralHelper.anchorSet.getNameByDisplayName(cmbLineAnchor.getText())),isFlippedAxes()));
    }
  }
 else   if (e.getSource().equals(cmbRangeAnchor)) {
    if (cmbRangeAnchor.getSelectionIndex() == 0) {
      getAxisForProcessing().getMarkerRanges().get(getMarkerIndex()).unsetLabelAnchor();
    }
 else {
      getAxisForProcessing().getMarkerRanges().get(getMarkerIndex()).setLabelAnchor(ChartUIUtil.getFlippedAnchor(Anchor.getByName(LiteralHelper.anchorSet.getNameByDisplayName(cmbRangeAnchor.getText())),isFlippedAxes()));
    }
  }
 else   if (e.getSource().equals(btnLineFormatSpecifier)) {
    handleMarkerLineFormatBtnSelected();
  }
 else   if (e.getSource().equals(btnStartFormatSpecifier) || e.getSource().equals(btnEndFormatSpecifier)) {
    handleMarkerRangeFormatBtnSelected();
  }
 else   if (e.widget.equals(btnLineTriggers)) {
    new TriggerEditorDialog(cmpContent.getShell(),getAxisForProcessing().getMarkerLines().get(getMarkerIndex()).getTriggers(),getAxisForProcessing().getMarkerLines().get(getMarkerIndex()),getContext(),Messages.getString("String_Node_Str"),TriggerSupportMatrix.TYPE_MARKERLINE,false,true).open();
  }
 else   if (e.widget.equals(btnRangeTriggers)) {
    new TriggerEditorDialog(cmpContent.getShell(),getAxisForProcessing().getMarkerRanges().get(getMarkerIndex()).getTriggers(),getAxisForProcessing().getMarkerRanges().get(getMarkerIndex()),getContext(),Messages.getString("String_Node_Str"),TriggerSupportMatrix.TYPE_MARKERRANGE,false,true).open();
  }
 else   if (e.widget == btnTxtValueAuto) {
    MarkerLine line=getAxisForProcessing().getMarkerLines().get(getMarkerIndex());
    ChartElementUtil.setEObjectAttribute(line,"String_Node_Str",getNotNullDataElement(txtValue.getDataElement()),btnTxtValueAuto.getSelection());
    txtValue.setDataElement(line.getValue());
    txtValue.setEnabled(!btnTxtValueAuto.getSelection());
  }
 else   if (e.widget == btnTxtStartValueAuto) {
    MarkerRange range=getAxisForProcessing().getMarkerRanges().get(getMarkerIndex());
    ChartElementUtil.setEObjectAttribute(range,"String_Node_Str",getNotNullDataElement(txtStartValue.getDataElement()),btnTxtStartValueAuto.getSelection());
    txtStartValue.setDataElement(range.getStartValue());
    txtStartValue.setEnabled(!btnTxtStartValueAuto.getSelection());
  }
 else   if (e.widget == btnTxtEndValueAuto) {
    MarkerRange range=getAxisForProcessing().getMarkerRanges().get(getMarkerIndex());
    ChartElementUtil.setEObjectAttribute(range,"String_Node_Str",getNotNullDataElement(txtEndValue.getDataElement()),btnTxtEndValueAuto.getSelection());
    txtEndValue.setDataElement(range.getStartValue());
    txtEndValue.setEnabled(!btnTxtEndValueAuto.getSelection());
  }
}