Program: 60239
Project: 60239
Buggy source:
public InputSelectControl(final HTMLBaseInputElement modelNode){
  super(modelNode);
  this.setLayout(WrapperLayout.getInstance());
  final JComboBox<OptionItem> comboBox=new JComboBox<OptionItem>();
  comboBox.addItemListener(new ItemListener(){
    public void itemStateChanged(    ItemEvent e){
      OptionItem item=(OptionItem)e.getItem();
      if (item != null) {
switch (e.getStateChange()) {
case ItemEvent.SELECTED:
          if (!suspendSelections) {
            inSelectionEvent=true;
            try {
              int selectedIndex=comboBox.getSelectedIndex();
              HTMLSelectElementImpl selectElement=(HTMLSelectElementImpl)modelNode;
              selectElement.setSelectedIndex(selectedIndex);
            }
  finally {
              inSelectionEvent=false;
            }
            HtmlController.getInstance().onChange(modelNode);
          }
        break;
case ItemEvent.DESELECTED:
      break;
  }
}
}
}
);
final DefaultListModel<OptionItem> listModel=new DefaultListModel<OptionItem>();
final JList<OptionItem> list=new JList<OptionItem>(listModel);
this.listModel=listModel;
list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
list.addListSelectionListener(new javax.swing.event.ListSelectionListener(){
public void valueChanged(ListSelectionEvent e){
if (!e.getValueIsAdjusting() && !suspendSelections) {
  boolean changed=false;
  inSelectionEvent=true;
  try {
    int modelSize=listModel.getSize();
    for (int i=0; i < modelSize; i++) {
      OptionItem item=(OptionItem)listModel.get(i);
      if (item != null) {
        boolean oldIsSelected=item.isSelected();
        boolean newIsSelected=list.isSelectedIndex(i);
        if (oldIsSelected != newIsSelected) {
          changed=true;
          item.setSelected(newIsSelected);
        }
      }
    }
  }
  finally {
    inSelectionEvent=false;
  }
  if (changed) {
    HtmlController.getInstance().onChange(modelNode);
  }
}
}
}
);
this.comboBox=comboBox;
if (modelNode.getTitle() != null) comboBox.setToolTipText(modelNode.getTitle());
comboBox.setVisible(modelNode.getHidden());
comboBox.applyComponentOrientation(direction(modelNode.getDir()));
comboBox.setEditable(new Boolean(modelNode.getContentEditable()));
comboBox.setEnabled(!modelNode.getDisabled());
this.list=list;
this.resetItemList();
}

Fixed version (ground truth):
public InputSelectControl(final HTMLBaseInputElement modelNode){
  super(modelNode);
  this.setLayout(WrapperLayout.getInstance());
  final JComboBox<OptionItem> comboBox=new JComboBox<OptionItem>();
  comboBox.addItemListener(new ItemListener(){
    public void itemStateChanged(    ItemEvent e){
      OptionItem item=(OptionItem)e.getItem();
      if (item != null) {
switch (e.getStateChange()) {
case ItemEvent.SELECTED:
          if (!suspendSelections) {
            inSelectionEvent=true;
            try {
              int selectedIndex=comboBox.getSelectedIndex();
              HTMLSelectElementImpl selectElement=(HTMLSelectElementImpl)modelNode;
              selectElement.setSelectedIndex(selectedIndex);
            }
  finally {
              inSelectionEvent=false;
            }
            HtmlController.getInstance().onChange(modelNode);
          }
        break;
case ItemEvent.DESELECTED:
      break;
  }
}
}
}
);
final DefaultListModel<OptionItem> listModel=new DefaultListModel<OptionItem>();
final JList<OptionItem> list=new JList<OptionItem>(listModel);
this.listModel=listModel;
list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
list.addListSelectionListener(new javax.swing.event.ListSelectionListener(){
public void valueChanged(ListSelectionEvent e){
if (!e.getValueIsAdjusting() && !suspendSelections) {
  boolean changed=false;
  inSelectionEvent=true;
  try {
    int modelSize=listModel.getSize();
    for (int i=0; i < modelSize; i++) {
      OptionItem item=(OptionItem)listModel.get(i);
      if (item != null) {
        boolean oldIsSelected=item.isSelected();
        boolean newIsSelected=list.isSelectedIndex(i);
        if (oldIsSelected != newIsSelected) {
          changed=true;
          item.setSelected(newIsSelected);
        }
      }
    }
  }
  finally {
    inSelectionEvent=false;
  }
  if (changed) {
    HtmlController.getInstance().onChange(modelNode);
  }
}
}
}
);
this.comboBox=comboBox;
if (modelNode.getTitle() != null) comboBox.setToolTipText(modelNode.getTitle());
comboBox.setVisible(modelNode.getHidden());
comboBox.applyComponentOrientation(direction(modelNode.getDir()));
comboBox.setEditable(new Boolean(modelNode.getContentEditable() == null ? "String_Node_Str" : modelNode.getContentEditable()));
comboBox.setEnabled(!modelNode.getDisabled());
this.list=list;
this.resetItemList();
}