Program: 67545
Project: 67545
Buggy source:
private void createCombo(Composite container,final ListingParameter listParam){
  boolean isRequired=listParam.getHandle().isRequired();
  boolean isStringType=listParam.getHandle().getDataType().equals(DesignChoiceConstants.PARAM_TYPE_STRING);
  Object value=null;
  try {
    if (listParam.getDefaultValues() != null)     value=listParam.converToDataType(listParam.getDefaultValue());
  }
 catch (  BirtException e) {
  }
  if (paramValues.containsKey(listParam.getHandle().getName())) {
    value=paramValues.get(listParam.getHandle().getName());
    if (value != null) {
      listParam.setSelectionValue(value.toString());
    }
  }
  int style=SWT.BORDER;
  if (!(listParam instanceof ComboBoxParameter)) {
    style|=SWT.READ_ONLY;
  }
  Combo combo=new Combo(container,style);
  combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  combo.setVisibleItemCount(30);
  List list=new ArrayList();
  if (isStringType && !isRequired) {
    list.add(blankValueChoice);
  }
  list.addAll(listParam.getValueList());
  checkParam(listParam.getDefaultValue(),value,list);
  if (!isRequired) {
    boolean hasNull=false;
    for (int i=0; i < list.size(); i++) {
      IParameterSelectionChoice choice=(IParameterSelectionChoice)list.get(i);
      if (choice.getValue() == null) {
        hasNull=true;
      }
    }
    if (!hasNull) {
      list.add(InputParameterDialog.nullValueChoice);
    }
  }
  boolean nullAdded=false;
  for (Iterator iterator=list.iterator(); iterator.hasNext(); ) {
    IParameterSelectionChoice choice=(IParameterSelectionChoice)iterator.next();
    String label=(choice.getLabel() == null ? String.valueOf(choice.getValue()) : choice.getLabel());
    if (choice.getValue() == null && choice.getLabel() == null) {
      if (!isRequired && !nullAdded) {
        combo.add(NULL_VALUE_STR);
        combo.setData(NULL_VALUE_STR,null);
        nullAdded=true;
      }
    }
 else {
      combo.add(label);
      combo.setData(label,choice.getValue());
    }
  }
  if (value == null) {
    if (!isRequired) {
      combo.select(combo.getItemCount() - 1);
    }
    listParam.setSelectionValue(null);
    paramValues.put(listParam.getHandle().getName(),null);
  }
 else {
    boolean found=false;
    for (int i=0; i < combo.getItemCount(); i++) {
      String str=null;
      if (value instanceof String) {
        str=(String)value;
      }
      if (value.equals(combo.getData(combo.getItem(i))) || (str != null && DEUtil.removeQuote(str).equals(combo.getData(combo.getItem(i))))) {
        combo.select(i);
        paramValues.put(listParam.getHandle().getName(),combo.getData(combo.getItem(i)));
        listParam.setSelectionValue(value.toString());
        found=true;
        break;
      }
    }
    if (!found) {
      if (listParam instanceof ComboBoxParameter) {
        combo.setText(value.toString());
        listParam.setSelectionValue(combo.getText());
        paramValues.put(listParam.getHandle().getName(),combo.getText());
      }
 else {
        listParam.setSelectionValue(null);
        paramValues.put(listParam.getHandle().getName(),null);
      }
    }
  }
  combo.addFocusListener(new FocusListener(){
    public void focusGained(    FocusEvent e){
    }
    public void focusLost(    FocusEvent e){
      if (!(listParam instanceof ComboBoxParameter)) {
        return;
      }
      Combo combo=(Combo)e.getSource();
      if (combo.indexOf(combo.getText()) < 0) {
        paramValues.put(listParam.getHandle().getName(),combo.getText());
      }
 else {
        paramValues.put(listParam.getHandle().getName(),combo.getData(combo.getItem(combo.indexOf(combo.getText()))));
      }
      if (listParam.getParentGroup() instanceof CascadingParameterGroup) {
        CascadingParameterGroup group=(CascadingParameterGroup)listParam.getParentGroup();
        if (group.getPostParameter(listParam) != null) {
          cascadingParamValueChanged(group,listParam);
        }
      }
    }
  }
);
  combo.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      Combo combo=(Combo)e.getSource();
      paramValues.put(listParam.getHandle().getName(),combo.getData(combo.getItem(combo.getSelectionIndex())));
      if (listParam.getParentGroup() instanceof CascadingParameterGroup) {
        CascadingParameterGroup group=(CascadingParameterGroup)listParam.getParentGroup();
        if (group.getPostParameter(listParam) != null) {
          cascadingParamValueChanged(group,listParam);
        }
      }
    }
  }
);
  if (listParam.getParentGroup() instanceof CascadingParameterGroup) {
    CascadingParameterGroup group=(CascadingParameterGroup)listParam.getParentGroup();
    if (group.getPreParameter(listParam) != null) {
      postParamLists.put(group.getPreParameter(listParam),combo);
    }
  }
}

Fixed version (ground truth):
private void createCombo(Composite container,final ListingParameter listParam){
  boolean isRequired=listParam.getHandle().isRequired();
  boolean isStringType=listParam.getHandle().getDataType().equals(DesignChoiceConstants.PARAM_TYPE_STRING);
  Object value=null;
  try {
    if (listParam.getDefaultValue() != null)     value=listParam.converToDataType(listParam.getDefaultValue());
  }
 catch (  BirtException e) {
  }
  if (paramValues.containsKey(listParam.getHandle().getName())) {
    value=paramValues.get(listParam.getHandle().getName());
    if (value != null) {
      listParam.setSelectionValue(value.toString());
    }
  }
  int style=SWT.BORDER;
  if (!(listParam instanceof ComboBoxParameter)) {
    style|=SWT.READ_ONLY;
  }
  Combo combo=new Combo(container,style);
  combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  combo.setVisibleItemCount(30);
  List list=new ArrayList();
  if (isStringType && !isRequired) {
    list.add(blankValueChoice);
  }
  list.addAll(listParam.getValueList());
  try {
    checkParam(listParam.converToDataType(listParam.getDefaultValue()),list);
  }
 catch (  BirtException e1) {
  }
  if (!isRequired) {
    boolean hasNull=false;
    for (int i=0; i < list.size(); i++) {
      IParameterSelectionChoice choice=(IParameterSelectionChoice)list.get(i);
      if (choice.getValue() == null) {
        hasNull=true;
      }
    }
    if (!hasNull) {
      list.add(InputParameterDialog.nullValueChoice);
    }
  }
  boolean nullAdded=false;
  for (Iterator iterator=list.iterator(); iterator.hasNext(); ) {
    IParameterSelectionChoice choice=(IParameterSelectionChoice)iterator.next();
    String label=(choice.getLabel() == null ? String.valueOf(choice.getValue()) : choice.getLabel());
    if (choice.getValue() == null && choice.getLabel() == null) {
      if (!isRequired && !nullAdded) {
        combo.add(NULL_VALUE_STR);
        combo.setData(NULL_VALUE_STR,null);
        nullAdded=true;
      }
    }
 else {
      combo.add(label);
      combo.setData(label,choice.getValue());
    }
  }
  if (value == null) {
    if (!isRequired) {
      combo.select(combo.getItemCount() - 1);
    }
    listParam.setSelectionValue(null);
    paramValues.put(listParam.getHandle().getName(),null);
  }
 else {
    boolean found=false;
    for (int i=0; i < combo.getItemCount(); i++) {
      if (value.equals(combo.getData(combo.getItem(i)))) {
        combo.select(i);
        paramValues.put(listParam.getHandle().getName(),combo.getData(combo.getItem(i)));
        listParam.setSelectionValue(value.toString());
        found=true;
        break;
      }
    }
    if (!found) {
      if (listParam instanceof ComboBoxParameter) {
        combo.setText(value.toString());
        listParam.setSelectionValue(combo.getText());
        paramValues.put(listParam.getHandle().getName(),combo.getText());
      }
 else {
        listParam.setSelectionValue(null);
        paramValues.put(listParam.getHandle().getName(),null);
      }
    }
  }
  combo.addFocusListener(new FocusListener(){
    public void focusGained(    FocusEvent e){
    }
    public void focusLost(    FocusEvent e){
      if (!(listParam instanceof ComboBoxParameter)) {
        return;
      }
      Combo combo=(Combo)e.getSource();
      if (combo.indexOf(combo.getText()) < 0) {
        paramValues.put(listParam.getHandle().getName(),combo.getText());
      }
 else {
        paramValues.put(listParam.getHandle().getName(),combo.getData(combo.getItem(combo.indexOf(combo.getText()))));
      }
      if (listParam.getParentGroup() instanceof CascadingParameterGroup) {
        CascadingParameterGroup group=(CascadingParameterGroup)listParam.getParentGroup();
        if (group.getPostParameter(listParam) != null) {
          cascadingParamValueChanged(group,listParam);
        }
      }
    }
  }
);
  combo.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      Combo combo=(Combo)e.getSource();
      paramValues.put(listParam.getHandle().getName(),combo.getData(combo.getItem(combo.getSelectionIndex())));
      if (listParam.getParentGroup() instanceof CascadingParameterGroup) {
        CascadingParameterGroup group=(CascadingParameterGroup)listParam.getParentGroup();
        if (group.getPostParameter(listParam) != null) {
          cascadingParamValueChanged(group,listParam);
        }
      }
    }
  }
);
  if (listParam.getParentGroup() instanceof CascadingParameterGroup) {
    CascadingParameterGroup group=(CascadingParameterGroup)listParam.getParentGroup();
    if (group.getPreParameter(listParam) != null) {
      postParamLists.put(group.getPreParameter(listParam),combo);
    }
  }
}