nus-yam/ex-repair huggingface dataset:
Program: 51915
Project: 51915
Buggy source:
public void onClick(Widget sender){
  try {
    if (method != null) {
      GwtCheckbox.this.getXulDomContainer().invoke(method,new Object[]{});
    }
    setChecked(checkBox.isChecked());
  }
 catch (  XulException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void onClick(ClickEvent event){
  try {
    setChecked(checkBox.getValue());
    if (command != null && command.length() > 0) {
      GwtCheckbox.this.getXulDomContainer().invoke(command,new Object[]{});
    }
  }
 catch (  XulException e) {
    e.printStackTrace();
  }
}
Program: 51916
Project: 51916
Buggy source:
public void setSelected(boolean selected){
  checkBox.setChecked(selected);
}

Fixed version (ground truth):
public void setSelected(boolean selected){
  checkBox.setValue(selected);
}
Program: 51917
Project: 51917
Buggy source:
public boolean isChecked(){
  return checkBox.isChecked();
}

Fixed version (ground truth):
public boolean isChecked(){
  return checkBox.getValue();
}
Program: 51918
Project: 51918
Buggy source:
public void setCommand(final String method){
  checkBox.addClickListener(new ClickListener(){
    public void onClick(    Widget sender){
      try {
        if (method != null) {
          GwtCheckbox.this.getXulDomContainer().invoke(method,new Object[]{});
        }
        setChecked(checkBox.isChecked());
      }
 catch (      XulException e) {
        e.printStackTrace();
      }
    }
  }
);
}

Fixed version (ground truth):
public void setCommand(final String command){
  this.command=command;
}
Program: 51919
Project: 51919
Buggy source:
public boolean getSelected(){
  return checkBox.isChecked();
}

Fixed version (ground truth):
public boolean getSelected(){
  return checkBox.getValue();
}
Program: 51920
Project: 51920
Buggy source:
public void setChecked(boolean checked){
  boolean previousVal=this.checked;
  if (checked != checkBox.isChecked()) {
    checkBox.setChecked(checked);
  }
  this.checked=checked;
  this.firePropertyChange("String_Node_Str",previousVal,checked);
}

Fixed version (ground truth):
public void setChecked(boolean checked){
  boolean previousVal=this.checked;
  if (checked != checkBox.getValue()) {
    checkBox.setValue(checked);
  }
  this.checked=checked;
  this.firePropertyChange("String_Node_Str",previousVal,checked);
}
Program: 51921
Project: 51921
Buggy source:
public Document getDocument(){
  try {
    XulElementDom4J o=(XulElementDom4J)element.getDocument().getRootElement();
    return ((XulRoot)o.getXulElement()).getXulDomContainer().getDocumentRoot();
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str" + e.getMessage(),e);
    return null;
  }
}

Fixed version (ground truth):
public Document getDocument(){
  try {
    org.dom4j.Document doc=element.getDocument();
    if (doc == null) {
      return null;
    }
    XulElementDom4J o=(XulElementDom4J)doc.getRootElement();
    return ((XulRoot)o.getXulElement()).getXulDomContainer().getDocumentRoot();
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str" + e.getMessage(),e);
    return null;
  }
}
Program: 51922
Project: 51922
Buggy source:
public SwingVbox(Element self,XulComponent parent,XulDomContainer domContainer,String tagName){
  super("String_Node_Str");
  this.domContainer=domContainer;
  this.orientation=Orient.VERTICAL;
  container=new ScrollablePanel(new GridBagLayout());
  container.setOpaque(false);
  managedObject=container;
  resetContainer();
}

Fixed version (ground truth):
public SwingVbox(Element self,XulComponent parent,XulDomContainer domContainer,String tagName){
  super("String_Node_Str");
  this.domContainer=domContainer;
  this.orientation=Orient.VERTICAL;
  container=new ScrollablePanel(new GridBagLayout()){
    @Override public void paintComponent(    Graphics g){
      if (backgroundImage != null) {
        g.drawImage(backgroundImage,0,0,container);
      }
    }
  }
;
  container.setOpaque(false);
  managedObject=container;
  resetContainer();
}
Program: 51923
Project: 51923
Buggy source:
public void setBackground(String src){
  this.background=src;
  URL url=SwingImage.class.getClassLoader().getResource(this.domContainer.getXulLoader().getRootDir() + src);
  if (url == null) {
    try {
      url=new File(src).toURL();
    }
 catch (    MalformedURLException e) {
    }
  }
  if (url == null) {
    logger.error("String_Node_Str" + src);
    return;
  }
  final ImageIcon ico=new ImageIcon(url);
  container.addComponentListener(new ComponentListener(){
    public void componentHidden(    ComponentEvent arg0){
    }
    public void componentMoved(    ComponentEvent arg0){
    }
    public void componentResized(    ComponentEvent arg0){
      container.getGraphics().drawImage(ico.getImage(),0,0,container);
      container.repaint();
    }
    public void componentShown(    ComponentEvent arg0){
    }
  }
);
}

Fixed version (ground truth):
public void setBackground(String src){
  this.background=src;
  URL url=SwingImage.class.getClassLoader().getResource(this.domContainer.getXulLoader().getRootDir() + src);
  if (url == null) {
    try {
      url=new File(src).toURL();
    }
 catch (    MalformedURLException e) {
    }
  }
  if (url == null) {
    logger.error("String_Node_Str" + src);
    return;
  }
  final ImageIcon ico=new ImageIcon(url);
  backgroundImage=ico.getImage();
}
Program: 51925
Project: 51925
Buggy source:
@Override public Panel getDialogContents(){
  VerticalPanel contentPanel=new VerticalPanel();
  contentPanel.setHeight("String_Node_Str");
  contentPanel.setWidth("String_Node_Str");
  contentPanel.setStyleName("String_Node_Str");
  contentPanel.setWidth("String_Node_Str");
  container=contentPanel;
  return contentPanel;
}

Fixed version (ground truth):
@Override public Panel getDialogContents(){
  VerticalPanel contentPanel=new VerticalPanel();
  container=contentPanel;
  return contentPanel;
}
Program: 51926
Project: 51926
Buggy source:
public GenericDialog(String tagName){
  super(tagName);
  glasspane.setStyleName("String_Node_Str");
  Style glassPaneStyle=glasspane.getElement().getStyle();
  glassPaneStyle.setProperty("String_Node_Str","String_Node_Str");
  glassPaneStyle.setProperty("String_Node_Str","String_Node_Str");
  glassPaneStyle.setProperty("String_Node_Str","String_Node_Str");
  dialog=new DialogBox(){
    @Override public void hide(){
      super.hide();
      RootPanel.get().remove(glasspane);
      GlassPane.getInstance().hide();
    }
  }
;
}

Fixed version (ground truth):
public GenericDialog(String tagName){
  super(tagName);
  glasspane.setStyleName("String_Node_Str");
  Style glassPaneStyle=glasspane.getElement().getStyle();
  glassPaneStyle.setProperty("String_Node_Str","String_Node_Str");
  glassPaneStyle.setProperty("String_Node_Str","String_Node_Str");
  glassPaneStyle.setProperty("String_Node_Str","String_Node_Str");
  dialog=new DialogBox(){
    @Override public void hide(){
      super.hide();
      RootPanel.get().remove(glasspane);
      GlassPane.getInstance().hide();
    }
  }
;
  dialog.add(contents);
}
Program: 51927
Project: 51927
Buggy source:
public void show(){
  dialog.setText(title);
  contents.clear();
  Panel p=getDialogContents();
  p.setSize("String_Node_Str","String_Node_Str");
  contents.add(p);
  contents.setCellHeight(p,"String_Node_Str");
  p=getButtonPanel();
  p.setWidth("String_Node_Str");
  HorizontalPanel buttonPanelWrapper=new HorizontalPanel();
  buttonPanelWrapper.setStyleName("String_Node_Str");
  buttonPanelWrapper.add(p);
  buttonPanelWrapper.setWidth("String_Node_Str");
  buttonPanelWrapper.setCellWidth(p,"String_Node_Str");
  contents.add(buttonPanelWrapper);
  contents.setSpacing(3);
  contents.setSize("String_Node_Str","String_Node_Str");
  dialog.setWidget(contents);
  dialog.setWidth(getWidth() + "String_Node_Str");
  dialog.setHeight(getHeight() + "String_Node_Str");
  dialog.center();
  dialog.show();
  RootPanel.get().add(glasspane);
  GlassPane.getInstance().show();
  glasspane.getElement().getStyle().setProperty("String_Node_Str","String_Node_Str" + (GwtDialog.dialogPos));
  dialog.getElement().getStyle().setProperty("String_Node_Str","String_Node_Str" + (++GwtDialog.dialogPos));
}

Fixed version (ground truth):
public void show(){
  dialog.setText(title);
  contents.clear();
  VerticalPanel panel=new VerticalPanel();
  Panel p=getDialogContents();
  p.setSize("String_Node_Str","String_Node_Str");
  p.setStyleName("String_Node_Str");
  SimplePanel sp=new SimplePanel();
  sp.getElement().setClassName("String_Node_Str");
  sp.add(p);
  panel.add(sp);
  panel.setCellWidth(sp,"String_Node_Str");
  panel.setCellHeight(sp,"String_Node_Str");
  panel.setStyleName("String_Node_Str");
  contents.add(panel);
  if (getBgcolor() != null) {
    p.getElement().getStyle().setProperty("String_Node_Str",getBgcolor());
  }
  p=this.getButtonPanel();
  HorizontalPanel buttonPanelWrapper=new HorizontalPanel();
  buttonPanelWrapper.setStyleName("String_Node_Str");
  buttonPanelWrapper.add(p);
  buttonPanelWrapper.setWidth("String_Node_Str");
  buttonPanelWrapper.setCellWidth(p,"String_Node_Str");
  contents.add(buttonPanelWrapper);
  contents.setSpacing(1);
  contents.setWidth("String_Node_Str");
  contents.setHeight("String_Node_Str");
  dialog.setWidth(getWidth() + "String_Node_Str");
  dialog.setHeight(getHeight() + "String_Node_Str");
  dialog.center();
  dialog.show();
  RootPanel.get().add(glasspane);
  GlassPane.getInstance().show();
  glasspane.getElement().getStyle().setProperty("String_Node_Str","String_Node_Str" + (GenericDialog.dialogPos));
  dialog.getElement().getStyle().setProperty("String_Node_Str","String_Node_Str" + (++GenericDialog.dialogPos));
}
Program: 51928
Project: 51928
Buggy source:
@Override public void layout(){
  super.layout();
  for (  XulComponent comp : getChildNodes()) {
    if (comp instanceof XulDialogheader) {
      header=(XulDialogheader)comp;
    }
  }
}

Fixed version (ground truth):
@Override public void layout(){
  setButtons();
  super.layout();
  for (  XulComponent comp : getChildNodes()) {
    if (comp instanceof XulDialogheader) {
      header=(XulDialogheader)comp;
    }
  }
}
Program: 51929
Project: 51929
Buggy source:
public GwtGroupBox(){
  super(ELEMENT_NAME);
  this.orientation=Orient.VERTICAL;
  managedObject=captionPanel=new CaptionPanel();
  captionPanel.getElement().getStyle().setProperty("String_Node_Str","String_Node_Str");
  captionPanel.getElement().getStyle().setProperty("String_Node_Str","String_Node_Str");
  container=new VerticalPanel();
  SimplePanel sp=new SimplePanel();
  sp.getElement().getStyle().setProperty("String_Node_Str","String_Node_Str");
  sp.setWidth("String_Node_Str");
  sp.add(container);
  ((VerticalPanel)container).setStyleName("String_Node_Str");
  ((CaptionPanel)managedObject).add(sp);
}

Fixed version (ground truth):
public GwtGroupBox(){
  super(ELEMENT_NAME);
  this.orientation=Orient.VERTICAL;
  managedObject=captionPanel=new CaptionPanel();
  captionPanel.getElement().getStyle().setProperty("String_Node_Str","String_Node_Str");
  captionPanel.getElement().getStyle().setProperty("String_Node_Str","String_Node_Str");
  container=new VerticalPanel();
  SimplePanel sp=new SimplePanel();
  sp.getElement().getStyle().setProperty("String_Node_Str","String_Node_Str");
  sp.getElement().getStyle().setProperty("String_Node_Str","String_Node_Str");
  sp.setWidth("String_Node_Str");
  sp.add(container);
  ((VerticalPanel)container).setStyleName("String_Node_Str");
  ((CaptionPanel)managedObject).add(sp);
}
Program: 51930
Project: 51930
Buggy source:
public void init(com.google.gwt.xml.client.Element srcEle,XulDomContainer container){
  super.init(srcEle,container);
  setBinding(srcEle.getAttribute("String_Node_Str"));
  setOnCommand(srcEle.getAttribute("String_Node_Str"));
  if (StringUtils.isEmpty(srcEle.getAttribute("String_Node_Str"))) {
    setWidth(Integer.parseInt(srcEle.getAttribute("String_Node_Str")));
  }
}

Fixed version (ground truth):
public void init(com.google.gwt.xml.client.Element srcEle,XulDomContainer container){
  super.init(srcEle,container);
  setBinding(srcEle.getAttribute("String_Node_Str"));
  setOnCommand(srcEle.getAttribute("String_Node_Str"));
  if (!StringUtils.isEmpty(srcEle.getAttribute("String_Node_Str"))) {
    setWidth(Integer.parseInt(srcEle.getAttribute("String_Node_Str")));
  }
  if (!StringUtils.isEmpty(srcEle.getAttribute("String_Node_Str"))) {
    setHeight(Integer.parseInt(srcEle.getAttribute("String_Node_Str")));
  }
}
Program: 51931
Project: 51931
Buggy source:
@Override public void setHeight(String height){
}

Fixed version (ground truth):
@Override public void setHeight(int height){
  listbox.setHeight(height + "String_Node_Str");
}
Program: 51932
Project: 51932
Buggy source:
public void init(com.google.gwt.xml.client.Element srcEle,XulDomContainer container){
  super.init(srcEle,container);
  setLabel(srcEle.getAttribute("String_Node_Str"));
  setChecked("String_Node_Str".equals(srcEle.getAttribute("String_Node_Str")));
  setDisabled("String_Node_Str".equals(srcEle.getAttribute("String_Node_Str")));
  String command=srcEle.getAttribute("String_Node_Str");
  if (command != null && command.trim().length() > 0) {
    setCommand(command);
  }
}

Fixed version (ground truth):
public void init(com.google.gwt.xml.client.Element srcEle,XulDomContainer container){
  super.init(srcEle,container);
  setLabel(srcEle.getAttribute("String_Node_Str"));
  setChecked("String_Node_Str".equals(srcEle.getAttribute("String_Node_Str")));
  setDisabled("String_Node_Str".equals(srcEle.getAttribute("String_Node_Str")));
  String command=srcEle.getAttribute("String_Node_Str");
  if (command != null && command.trim().length() > 0) {
    setCommand(command);
  }
  if (srcEle.getAttribute("String_Node_Str") != null && srcEle.getAttribute("String_Node_Str").length() > 0) {
    setClass(srcEle.getAttribute("String_Node_Str"));
  }
}
Program: 51933
Project: 51933
Buggy source:
public void updateUI(){
  if (this.isHierarchical()) {
    populateTree();
  }
 else {
    populateTable();
  }
  ;
}

Fixed version (ground truth):
public void updateUI(){
  if (this.suppressLayout) {
    return;
  }
  if (this.isHierarchical()) {
    populateTree();
  }
 else {
    populateTable();
  }
  ;
}
Program: 51935
Project: 51935
Buggy source:
public void setPageincrement(int increment){
  this.increment=increment;
}

Fixed version (ground truth):
public void setPageincrement(int increment){
  this.pageIncrement=increment;
}
Program: 51936
Project: 51936
Buggy source:
public int getPageincrement(){
  return increment;
}

Fixed version (ground truth):
public int getPageincrement(){
  return pageIncrement;
}
Program: 51937
Project: 51937
Buggy source:
public void layout(){
  int orient=(orientation == Orient.VERTICAL) ? JSlider.VERTICAL : JSlider.HORIZONTAL;
  slider=new JSlider(orient,this.min,this.max,Math.max(min,this.value));
  this.managedObject=slider;
  slider.setMajorTickSpacing(this.increment);
  slider.setSnapToTicks(true);
  slider.setPaintTicks(true);
  slider.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent arg0){
      setValue(SwingScale.this.slider.getValue());
    }
  }
);
}

Fixed version (ground truth):
public void layout(){
  int orient=(orientation == Orient.VERTICAL) ? JSlider.VERTICAL : JSlider.HORIZONTAL;
  slider=new JSlider(orient,this.min,this.max,Math.max(min,this.value));
  this.managedObject=slider;
  slider.setMajorTickSpacing(this.pageIncrement);
  slider.setSnapToTicks(false);
  slider.setPaintTicks(true);
  slider.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent arg0){
      setValue(SwingScale.this.slider.getValue());
    }
  }
);
}
Program: 51938
Project: 51938
Buggy source:
public <T>void setElements(Collection<T> elements){
  boundElements=elements;
  logger.info("String_Node_Str" + elements.size() + "String_Node_Str");
  this.model.removeAllElements();
  this.removeItems();
  for (  T t : elements) {
    SwingListitem item=new SwingListitem(null,this,this.xulDomContainer,null);
    String attribute=getBinding();
    if (!StringUtils.isEmpty(attribute)) {
      item.setLabel(extractLabel(t));
    }
    this.addChild(item);
  }
  layout();
}

Fixed version (ground truth):
public <T>void setElements(Collection<T> elements){
  boundElements=elements;
  logger.info("String_Node_Str" + elements.size() + "String_Node_Str");
  this.model.removeAllElements();
  this.removeItems();
  for (  T t : elements) {
    SwingListitem item=new SwingListitem(null,this,this.xulDomContainer,null);
    String attribute=getBinding();
    item.setLabel(extractLabel(t));
    this.addChild(item);
  }
  layout();
}
Program: 51939
Project: 51939
Buggy source:
public void show(){
  isDialogHidden=false;
  dialog.getShell().setText(title);
  if ((height > 0) && (width > 0)) {
    dialog.setHeight(height);
    dialog.setWidth(width);
  }
  dialog.resizeBounds();
  notifyListeners(XulRoot.EVENT_ON_LOAD);
  returnCode=dialog.open();
}

Fixed version (ground truth):
public void show(){
  if (buttonsCreated == false) {
    setButtons();
  }
  isDialogHidden=false;
  dialog.getShell().setText(title);
  if ((height > 0) && (width > 0)) {
    dialog.setHeight(height);
    dialog.setWidth(width);
  }
  dialog.resizeBounds();
  notifyListeners(XulRoot.EVENT_ON_LOAD);
  returnCode=dialog.open();
}
Program: 51940
Project: 51940
Buggy source:
@Override public void layout(){
  this.panel.removeAll();
  if (ico == null || !visible) {
    return;
  }
  if (getHeight() > 0 && getWidth() > 0) {
    ico=new ImageIcon(ico.getImage().getScaledInstance(getWidth(),getHeight(),Image.SCALE_AREA_AVERAGING));
  }
  lbl=new JLabel(ico);
  this.panel.add(lbl,BorderLayout.CENTER);
  if (getHeight() > 0 && getWidth() > 0) {
    this.panel.setMinimumSize(new Dimension(this.getWidth(),this.getHeight()));
  }
}

Fixed version (ground truth):
@Override public void layout(){
  this.panel.removeAll();
  if (ico == null || !visible) {
    return;
  }
  if (getHeight() > 0 && getWidth() > 0) {
    ico=new ImageIcon(ico.getImage().getScaledInstance(getWidth(),getHeight(),Image.SCALE_AREA_AVERAGING));
  }
  lbl=new JLabel(ico);
  this.panel.add(lbl,BorderLayout.CENTER);
  if (getHeight() > 0 && getWidth() > 0) {
    this.panel.setMinimumSize(new Dimension(this.getWidth(),this.getHeight()));
  }
  panel.revalidate();
}
Program: 51941
Project: 51941
Buggy source:
public void setValue(String text){
  if (text != null && !(text.equals(value))) {
    String prevVal=this.value;
    this.value=text;
    textBox.setText(text);
    this.firePropertyChange("String_Node_Str",prevVal,text);
  }
}

Fixed version (ground truth):
public void setValue(String text){
  String prevVal=this.value;
  this.value=text;
  textBox.setText(text);
  this.firePropertyChange("String_Node_Str",prevVal,text);
}
Program: 51943
Project: 51943
Buggy source:
@Override public void layout(){
  if (type == Type.CHECKBOX || type == Type.RADIO) {
    final AbstractButton oldButton=getButton();
    final AbstractButton button=new JToggleButton();
    button.setText(oldButton.getText());
    button.setIcon(oldButton.getIcon());
    button.setEnabled(oldButton.isEnabled());
    button.setSelected(this.selected);
    if (this.getOnclick() != null) {
      this.setOnclick(this.getOnclick());
    }
    setButton(button);
  }
  final AbstractButton button=getButton();
  if (this.orientation == Orient.VERTICAL) {
    button.setHorizontalTextPosition(JButton.CENTER);
    if (this.dir == Direction.FORWARD) {
      button.setVerticalTextPosition(JButton.BOTTOM);
    }
 else {
      button.setVerticalTextPosition(JButton.TOP);
    }
  }
 else {
    button.setVerticalTextPosition(JButton.CENTER);
    if (this.dir == Direction.FORWARD) {
      button.setHorizontalTextPosition(JButton.RIGHT);
    }
 else {
      button.setHorizontalTextPosition(JButton.LEFT);
    }
  }
  final Icon icon=button.getIcon();
  if ("String_Node_Str".equals(button.getText()) && icon != null && icon.getIconHeight() == icon.getIconWidth()) {
    Dimension dim=button.getPreferredSize();
    button.setMinimumSize(new Dimension(dim.height,dim.height));
    button.setPreferredSize(new Dimension(dim.height,dim.height));
  }
  button.setToolTipText(this.getTooltiptext());
  super.layout();
}

Fixed version (ground truth):
@Override public void layout(){
  if (type == Type.CHECKBOX || type == Type.RADIO) {
    final AbstractButton oldButton=getButton();
    final AbstractButton button=new JToggleButton();
    button.setText(oldButton.getText());
    button.setIcon(oldButton.getIcon());
    button.setEnabled(oldButton.isEnabled());
    button.setSelected(this.selected);
    setButton(button);
    if (this.getOnclick() != null) {
      this.setOnclick(this.getOnclick());
    }
  }
  final AbstractButton button=getButton();
  if (this.orientation == Orient.VERTICAL) {
    button.setHorizontalTextPosition(JButton.CENTER);
    if (this.dir == Direction.FORWARD) {
      button.setVerticalTextPosition(JButton.BOTTOM);
    }
 else {
      button.setVerticalTextPosition(JButton.TOP);
    }
  }
 else {
    button.setVerticalTextPosition(JButton.CENTER);
    if (this.dir == Direction.FORWARD) {
      button.setHorizontalTextPosition(JButton.RIGHT);
    }
 else {
      button.setHorizontalTextPosition(JButton.LEFT);
    }
  }
  final Icon icon=button.getIcon();
  if ("String_Node_Str".equals(button.getText()) && icon != null && icon.getIconHeight() == icon.getIconWidth()) {
    Dimension dim=button.getPreferredSize();
    button.setMinimumSize(new Dimension(dim.height,dim.height));
    button.setPreferredSize(new Dimension(dim.height,dim.height));
  }
  button.setToolTipText(this.getTooltiptext());
  super.layout();
}
Program: 51944
Project: 51944
Buggy source:
@Override public void layout(){
  this.panel.removeAll();
  if (ico == null) {
    return;
  }
  if (getHeight() > 0 && getWidth() > 0) {
    ico=new ImageIcon(ico.getImage().getScaledInstance(getWidth(),getHeight(),Image.SCALE_AREA_AVERAGING));
  }
  lbl=new JLabel(ico);
  this.panel.add(lbl,BorderLayout.CENTER);
  if (getHeight() > 0 && getWidth() > 0) {
    this.panel.setMinimumSize(new Dimension(this.getWidth(),this.getHeight()));
  }
}

Fixed version (ground truth):
@Override public void layout(){
  this.panel.removeAll();
  if (ico == null || !visible) {
    return;
  }
  if (getHeight() > 0 && getWidth() > 0) {
    ico=new ImageIcon(ico.getImage().getScaledInstance(getWidth(),getHeight(),Image.SCALE_AREA_AVERAGING));
  }
  lbl=new JLabel(ico);
  this.panel.add(lbl,BorderLayout.CENTER);
  if (getHeight() > 0 && getWidth() > 0) {
    this.panel.setMinimumSize(new Dimension(this.getWidth(),this.getHeight()));
  }
}
Program: 51946
Project: 51946
Buggy source:
public void setSeltype(String type){
  if (table == null) {
    return;
  }
  this.selType=SELECTION_MODE.valueOf(type.toUpperCase());
switch (this.selType) {
case CELL:
    table.setCellSelectionEnabled(true);
  break;
case MULTIPLE:
table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
break;
case SINGLE:
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
break;
}
}

Fixed version (ground truth):
public void setSeltype(String type){
  this.selType=SELECTION_MODE.valueOf(type.toUpperCase());
  if (table == null) {
    return;
  }
switch (this.selType) {
case CELL:
    table.setCellSelectionEnabled(true);
  break;
case MULTIPLE:
table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
break;
case SINGLE:
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
break;
}
}
Program: 51947
Project: 51947
Buggy source:
public void init(com.google.gwt.xml.client.Element srcEle,XulDomContainer container){
  if (srcEle.hasAttribute("String_Node_Str")) {
    managedObject=imageButton=new ImageButton();
  }
 else {
    managedObject=button=new RoundedButton();
  }
  super.init(srcEle,container);
  setLabel(srcEle.getAttribute("String_Node_Str"));
  setOnclick(srcEle.getAttribute("String_Node_Str"));
  setImage(srcEle.getAttribute("String_Node_Str"));
  setTooltiptext(srcEle.getAttribute("String_Node_Str"));
  setDisabled("String_Node_Str".equals(srcEle.getAttribute("String_Node_Str")));
}

Fixed version (ground truth):
public void init(com.google.gwt.xml.client.Element srcEle,XulDomContainer container){
  if (srcEle.hasAttribute("String_Node_Str")) {
    button=null;
    managedObject=imageButton=new ImageButton();
  }
 else {
    managedObject=button=new RoundedButton();
  }
  super.init(srcEle,container);
  setLabel(srcEle.getAttribute("String_Node_Str"));
  setOnclick(srcEle.getAttribute("String_Node_Str"));
  setImage(srcEle.getAttribute("String_Node_Str"));
  setTooltiptext(srcEle.getAttribute("String_Node_Str"));
  setDisabled("String_Node_Str".equals(srcEle.getAttribute("String_Node_Str")));
}
Program: 51948
Project: 51948
Buggy source:
public void init(com.google.gwt.xml.client.Element srcEle,XulDomContainer container){
  if (srcEle.hasAttribute("String_Node_Str")) {
    button=null;
    managedObject=imageButton=new ImageButton();
  }
 else {
    managedObject=button=new RoundedButton();
  }
  super.init(srcEle,container);
  setLabel(srcEle.getAttribute("String_Node_Str"));
  setOnclick(srcEle.getAttribute("String_Node_Str"));
  setImage(srcEle.getAttribute("String_Node_Str"));
  setTooltiptext(srcEle.getAttribute("String_Node_Str"));
  setDisabled("String_Node_Str".equals(srcEle.getAttribute("String_Node_Str")));
}

Fixed version (ground truth):
public void init(com.google.gwt.xml.client.Element srcEle,XulDomContainer container){
  if (!StringUtils.isEmpty(srcEle.getAttribute("String_Node_Str"))) {
    button=null;
    managedObject=imageButton=new ImageButton();
  }
 else {
    managedObject=button=new RoundedButton();
  }
  super.init(srcEle,container);
  if (!StringUtils.isEmpty(srcEle.getAttribute("String_Node_Str"))) {
    setLabel(srcEle.getAttribute("String_Node_Str"));
  }
  if (!StringUtils.isEmpty(srcEle.getAttribute("String_Node_Str"))) {
    setOnclick(srcEle.getAttribute("String_Node_Str"));
  }
  if (!StringUtils.isEmpty(srcEle.getAttribute("String_Node_Str"))) {
    setImage(srcEle.getAttribute("String_Node_Str"));
  }
  if (!StringUtils.isEmpty(srcEle.getAttribute("String_Node_Str"))) {
    setTooltiptext(srcEle.getAttribute("String_Node_Str"));
  }
  setDisabled("String_Node_Str".equals(srcEle.getAttribute("String_Node_Str")));
}
Program: 51949
Project: 51949
Buggy source:
public void layout(){
  XulTreeItem item=(XulTreeItem)this.getRootChildren().getFirstChild();
  if (item.getAttributeValue("String_Node_Str") != null && item.getAttributeValue("String_Node_Str").equals("String_Node_Str")) {
    isHierarchical=true;
  }
  if (isHierarchical()) {
    setupTree();
  }
 else {
    setupTable();
  }
}

Fixed version (ground truth):
public void layout(){
  XulTreeItem item=(XulTreeItem)this.getRootChildren().getFirstChild();
  if (item != null && item.getAttributeValue("String_Node_Str") != null && item.getAttributeValue("String_Node_Str").equals("String_Node_Str")) {
    isHierarchical=true;
  }
  if (isHierarchical()) {
    setupTree();
  }
 else {
    setupTable();
  }
}
Program: 51950
Project: 51950
Buggy source:
public void setOnselect(final String select){
  table.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
    public void valueChanged(    ListSelectionEvent event){
      if (event.getValueIsAdjusting() == true) {
        return;
      }
      invoke(select,new Object[]{new Integer(table.getSelectedRow())});
    }
  }
);
}

Fixed version (ground truth):
public void setOnselect(final String select){
  if (table != null) {
    table.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
      public void valueChanged(      ListSelectionEvent event){
        if (event.getValueIsAdjusting() == true) {
          return;
        }
        invoke(select,new Object[]{new Integer(table.getSelectedRow())});
      }
    }
);
  }
}
Program: 51951
Project: 51951
Buggy source:
public void setDisabled(boolean dis){
  this.disabled=dis;
  table.setEnabled(!this.disabled);
}

Fixed version (ground truth):
public void setDisabled(boolean dis){
  this.disabled=dis;
  if (table != null) {
    table.setEnabled(!this.disabled);
  }
}
Program: 51953
Project: 51953
Buggy source:
private Object[] getArgs(String methodCall){
  if (methodCall.indexOf("String_Node_Str") > -1) {
    return null;
  }
  String argsList=methodCall.substring(methodCall.indexOf("String_Node_Str") + 1,methodCall.indexOf("String_Node_Str"));
  String[] stringArgs=argsList.split("String_Node_Str");
  Object[] args=new Object[stringArgs.length];
  int i=-1;
  for (  String obj : stringArgs) {
    i++;
    obj=obj.trim();
    try {
      Integer num=Integer.valueOf(obj);
      args[i]=num;
      continue;
    }
 catch (    NumberFormatException e) {
      try {
        Double num=Double.valueOf(obj);
        args[i]=num;
        continue;
      }
 catch (      NumberFormatException e2) {
        try {
          if (obj.indexOf('\'') == -1 && obj.indexOf('\"') == -1) {
            throw new IllegalArgumentException("String_Node_Str");
          }
          String str=obj.replaceAll("String_Node_Str","String_Node_Str");
          str=str.replaceAll("String_Node_Str","String_Node_Str");
          args[i]=str;
          continue;
        }
 catch (        IllegalArgumentException e4) {
          try {
            Boolean flag=Boolean.parseBoolean(obj);
            args[i]=flag;
            continue;
          }
 catch (          NumberFormatException e3) {
            continue;
          }
        }
      }
    }
  }
  return args;
}

Fixed version (ground truth):
private Object[] getArgs(String methodCall){
  if (methodCall.endsWith("String_Node_Str")) {
    return null;
  }
  String argsList=methodCall.substring(methodCall.indexOf("String_Node_Str") + 1,methodCall.lastIndexOf("String_Node_Str"));
  String[] stringArgs=argsList.split("String_Node_Str");
  Object[] args=new Object[stringArgs.length];
  int i=-1;
  for (  String obj : stringArgs) {
    i++;
    obj=obj.trim();
    try {
      Integer num=Integer.valueOf(obj);
      args[i]=num;
      continue;
    }
 catch (    NumberFormatException e) {
      try {
        Double num=Double.valueOf(obj);
        args[i]=num;
        continue;
      }
 catch (      NumberFormatException e2) {
        try {
          if (obj.indexOf('\'') == -1 && obj.indexOf('\"') == -1) {
            throw new IllegalArgumentException("String_Node_Str");
          }
          String str=obj.replaceAll("String_Node_Str","String_Node_Str");
          str=str.replaceAll("String_Node_Str","String_Node_Str");
          args[i]=str;
          continue;
        }
 catch (        IllegalArgumentException e4) {
          try {
            Boolean flag=Boolean.parseBoolean(obj);
            args[i]=flag;
            continue;
          }
 catch (          NumberFormatException e3) {
            continue;
          }
        }
      }
    }
  }
  return args;
}
Program: 51955
Project: 51955
Buggy source:
public void initialize() throws XulException {
  XulWindow rootEle=(XulWindow)containers.get(0).getDocumentRoot().getRootElement();
  System.out.println("String_Node_Str" + rootEle.getOnload());
  String onLoad=rootEle.getOnload();
  if (onLoad != null) {
    String onloads[]=onLoad.split("String_Node_Str");
    for (    String ol : onloads) {
      containers.get(0).invoke(ol.trim(),new Object[]{});
    }
  }
  if (rootEle instanceof GwtWindow) {
    rootFrame=(Panel)((GwtWindow)rootEle).getManagedObject();
  }
 else {
    throw new XulException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void initialize() throws XulException {
  XulComponent c=containers.get(0).getDocumentRoot().getRootElement();
  if (c instanceof XulWindow == false) {
    return;
  }
  XulWindow rootEle=(XulWindow)containers.get(0).getDocumentRoot().getRootElement();
  System.out.println("String_Node_Str" + rootEle.getOnload());
  String onLoad=rootEle.getOnload();
  if (onLoad != null) {
    String onloads[]=onLoad.split("String_Node_Str");
    for (    String ol : onloads) {
      containers.get(0).invoke(ol.trim(),new Object[]{});
    }
  }
  if (rootEle instanceof GwtWindow) {
    rootFrame=(Panel)((GwtWindow)rootEle).getManagedObject();
  }
 else {
    throw new XulException("String_Node_Str");
  }
}
Program: 51957
Project: 51957
Buggy source:
public void bundleLoaded(String bundleName){
  if (fromSource) {
    if (loadingOverlay) {
      loadOverlay(xulSrc);
    }
    if (removingOverlay) {
      removeOverlay(xulSrc);
    }
 else {
      generateXulContainer(xulSrc);
    }
    return;
  }
  try {
    RequestBuilder builder=new RequestBuilder(RequestBuilder.GET,xulSrc);
    try {
      Request response=builder.sendRequest(null,new RequestCallback(){
        public void onError(        Request request,        Throwable exception){
          Window.alert("String_Node_Str" + exception.getMessage());
        }
        public void onResponseReceived(        Request request,        Response response){
          if (AsyncXulLoader.this.loadingOverlay) {
            loadOverlay(response.getText());
          }
 else           if (AsyncXulLoader.this.removingOverlay) {
            removeOverlay(response.getText());
          }
 else {
            generateXulContainer(response.getText());
          }
        }
      }
);
    }
 catch (    RequestException e) {
      Window.alert("String_Node_Str" + e.getMessage());
    }
  }
 catch (  Exception e) {
    Window.alert("String_Node_Str" + e.getMessage());
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void bundleLoaded(String bundleName){
  if (fromSource) {
    if (loadingOverlay) {
      loadOverlay(xulSrc);
    }
 else     if (removingOverlay) {
      removeOverlay(xulSrc);
    }
 else {
      generateXulContainer(xulSrc);
    }
    return;
  }
  try {
    RequestBuilder builder=new RequestBuilder(RequestBuilder.GET,xulSrc);
    try {
      Request response=builder.sendRequest(null,new RequestCallback(){
        public void onError(        Request request,        Throwable exception){
          Window.alert("String_Node_Str" + exception.getMessage());
        }
        public void onResponseReceived(        Request request,        Response response){
          if (AsyncXulLoader.this.loadingOverlay) {
            loadOverlay(response.getText());
          }
 else           if (AsyncXulLoader.this.removingOverlay) {
            removeOverlay(response.getText());
          }
 else {
            generateXulContainer(response.getText());
          }
        }
      }
);
    }
 catch (    RequestException e) {
      Window.alert("String_Node_Str" + e.getMessage());
    }
  }
 catch (  Exception e) {
    Window.alert("String_Node_Str" + e.getMessage());
    e.printStackTrace();
  }
}
Program: 51959
Project: 51959
Buggy source:
public void keyReleased(KeyEvent arg0){
  if (!oldValue.equals(textBox.getText())) {
    SwtTextbox.this.changeSupport.firePropertyChange("String_Node_Str","String_Node_Str",SwtTextbox.this.getValue());
  }
}

Fixed version (ground truth):
public void keyReleased(KeyEvent arg0){
  if (!oldValue.equals(box.getText())) {
    changeSupport.firePropertyChange("String_Node_Str","String_Node_Str",getValue());
  }
}
Program: 51960
Project: 51960
Buggy source:
public void keyPressed(KeyEvent arg0){
  oldValue=textBox.getText();
}

Fixed version (ground truth):
public void keyPressed(KeyEvent arg0){
  oldValue=box.getText();
}
Program: 51961
Project: 51961
Buggy source:
public SwtTextbox(Element self,XulComponent parent,XulDomContainer container,String tagName){
  super(tagName);
  parentComposite=(Composite)parent.getManagedObject();
  textBox=createNewText();
  textBox.addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent arg0){
      oldValue=textBox.getText();
    }
    public void keyReleased(    KeyEvent arg0){
      if (!oldValue.equals(textBox.getText())) {
        SwtTextbox.this.changeSupport.firePropertyChange("String_Node_Str","String_Node_Str",SwtTextbox.this.getValue());
      }
    }
  }
);
  managedObject=textBox;
}

Fixed version (ground truth):
public SwtTextbox(Element self,XulComponent parent,XulDomContainer container,String tagName){
  super(tagName);
  parentComposite=(Composite)parent.getManagedObject();
  textBox=createNewText();
  managedObject=textBox;
}
Program: 51962
Project: 51962
Buggy source:
public Text createNewText(){
  return new org.eclipse.swt.widgets.Text(parentComposite,SWT.BORDER);
}

Fixed version (ground truth):
public Text createNewText(){
  textBox=new org.eclipse.swt.widgets.Text(parentComposite,SWT.BORDER);
  addKeyListener(textBox);
  return textBox;
}
Program: 51963
Project: 51963
Buggy source:
public void addComponentAt(XulComponent c,int idx){
  children.add(idx,c);
}

Fixed version (ground truth):
public void addComponentAt(XulComponent c,int idx){
  if (idx < children.size()) {
    children.add(idx,c);
  }
 else {
    children.add(c);
  }
}
Program: 51964
Project: 51964
Buggy source:
public void destroyBindings(){
  if (destroyed) {
    return;
  }
  Object sourceObj=getSource().get();
  Object targetObj=getTarget().get();
  if (forwardListener != null && sourceObj != null) {
    ((XulEventSource)sourceObj).removePropertyChangeListener(forwardListener);
    logger.debug("String_Node_Str" + sourceObj);
  }
  if (reverseListener != null && targetObj != null && targetObj instanceof XulEventSource) {
    ((XulEventSource)targetObj).removePropertyChangeListener(reverseListener);
    logger.debug("String_Node_Str" + targetObj);
  }
  if (context != null) {
    context.remove(this);
  }
  setDestroyed(true);
}

Fixed version (ground truth):
public void destroyBindings(){
  if (destroyed) {
    return;
  }
  Object sourceObj=getSource().get();
  Object targetObj=getTarget().get();
  if (forwardListener != null && sourceObj != null) {
    ((XulEventSource)sourceObj).removePropertyChangeListener(forwardListener);
    logger.debug("String_Node_Str" + sourceObj);
  }
  if (reverseListener != null && targetObj != null && targetObj instanceof XulEventSource) {
    ((XulEventSource)targetObj).removePropertyChangeListener(reverseListener);
    logger.debug("String_Node_Str" + targetObj);
  }
  setDestroyed(true);
  if (context != null) {
    context.remove(this);
  }
}
Program: 51965
Project: 51965
Buggy source:
public void show(){
  if (dialog == null) {
    createDialog();
    dialog.pack();
  }
  dialog.setLocationRelativeTo(frame);
  dialog.setVisible(true);
}

Fixed version (ground truth):
public void show(){
  if (dialog == null) {
    createDialog();
    dialog.pack();
  }
  dialog.setLocationRelativeTo(centerComp);
  dialog.setVisible(true);
}
Program: 51967
Project: 51967
Buggy source:
private RETURN_CODE showSave(){
  int retVal=fc.showSaveDialog((Component)this.getDocument().getRootElement().getManagedObject());
switch (retVal) {
case JFileChooser.APPROVE_OPTION:
    selectedFile=fc.getSelectedFile();
  return RETURN_CODE.OK;
case JFileChooser.CANCEL_OPTION:
default :
return RETURN_CODE.CANCEL;
}
}

Fixed version (ground truth):
private RETURN_CODE showSave(){
  int retVal=fc.showSaveDialog(getParentComp());
switch (retVal) {
case JFileChooser.APPROVE_OPTION:
    selectedFile=fc.getSelectedFile();
  return RETURN_CODE.OK;
case JFileChooser.CANCEL_OPTION:
default :
return RETURN_CODE.CANCEL;
}
}
Program: 51968
Project: 51968
Buggy source:
private RETURN_CODE showOpen(){
  int retVal=fc.showOpenDialog((Component)this.getDocument().getRootElement().getManagedObject());
switch (retVal) {
case JFileChooser.APPROVE_OPTION:
    if (this.selectionType == SEL_TYPE.SINGLE) {
      selectedFile=fc.getSelectedFile();
    }
 else {
      selectedFiles=fc.getSelectedFiles();
    }
  return RETURN_CODE.OK;
case JFileChooser.CANCEL_OPTION:
default :
return RETURN_CODE.CANCEL;
}
}

Fixed version (ground truth):
private RETURN_CODE showOpen(){
  int retVal=fc.showOpenDialog(getParentComp());
switch (retVal) {
case JFileChooser.APPROVE_OPTION:
    if (this.selectionType == SEL_TYPE.SINGLE) {
      selectedFile=fc.getSelectedFile();
    }
 else {
      selectedFiles=fc.getSelectedFiles();
    }
  return RETURN_CODE.OK;
case JFileChooser.CANCEL_OPTION:
default :
return RETURN_CODE.CANCEL;
}
}
Program: 51969
Project: 51969
Buggy source:
public <T>void setElements(Collection<T> elements){
  this.getRootChildren().removeAll();
  if (elements == null) {
    table.updateUI();
    changeSupport.firePropertyChange("String_Node_Str",null,getSelectedRows());
    return;
  }
  try {
    for (    T o : elements) {
      logger.debug("String_Node_Str" + o.getClass().getName());
      XulTreeRow row=this.getRootChildren().addNewRow();
      for (      XulComponent col : this.getColumns().getChildNodes()) {
        XulTreeCell cell=(XulTreeCell)getDocument().createElement("String_Node_Str");
        for (        InlineBindingExpression exp : ((XulTreeCol)col).getBindingExpressions()) {
          logger.debug("String_Node_Str" + exp + "String_Node_Str"+ cell+ "String_Node_Str"+ o+ "String_Node_Str");
          Binding binding=new Binding(o,exp.getModelAttr(),cell,exp.getXulCompAttr());
          domContainer.addBinding(binding);
          binding.fireSourceChanged();
        }
        row.addCell(cell);
      }
    }
    table.updateUI();
    changeSupport.firePropertyChange("String_Node_Str",null,getSelectedRows());
  }
 catch (  XulException e) {
    logger.error("String_Node_Str",e);
  }
catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public <T>void setElements(Collection<T> elements){
  this.getRootChildren().removeAll();
  CellEditor ce=table.getCellEditor();
  if (ce != null) {
    ce.stopCellEditing();
  }
  if (elements == null) {
    table.updateUI();
    changeSupport.firePropertyChange("String_Node_Str",null,getSelectedRows());
    return;
  }
  try {
    for (    T o : elements) {
      logger.debug("String_Node_Str" + o.getClass().getName());
      XulTreeRow row=this.getRootChildren().addNewRow();
      for (      XulComponent col : this.getColumns().getChildNodes()) {
        XulTreeCell cell=(XulTreeCell)getDocument().createElement("String_Node_Str");
        for (        InlineBindingExpression exp : ((XulTreeCol)col).getBindingExpressions()) {
          logger.debug("String_Node_Str" + exp + "String_Node_Str"+ cell+ "String_Node_Str"+ o+ "String_Node_Str");
          Binding binding=new Binding(o,exp.getModelAttr(),cell,exp.getXulCompAttr());
          domContainer.addBinding(binding);
          binding.fireSourceChanged();
        }
        row.addCell(cell);
      }
    }
    table.updateUI();
    changeSupport.firePropertyChange("String_Node_Str",null,getSelectedRows());
  }
 catch (  XulException e) {
    logger.error("String_Node_Str",e);
  }
catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
}
Program: 51970
Project: 51970
Buggy source:
public void removeTreeRows(int[] rows){
  for (int i=0; i < rows.length; i++) {
    if (i < rootChildren.getItemCount()) {
      this.rootChildren.removeItem(rows[i]);
    }
  }
  table.updateUI();
  changeSupport.firePropertyChange("String_Node_Str",null,getSelectedRows());
}

Fixed version (ground truth):
public void removeTreeRows(int[] rows){
  ArrayList<Integer> rowArray=new ArrayList<Integer>();
  for (int i=0; i < rows.length; i++) {
    rowArray.add(rows[i]);
  }
  Collections.sort(rowArray,Collections.reverseOrder());
  for (int i=0; i < rowArray.size(); i++) {
    int item=rowArray.get(i);
    if (item >= 0 && item < rootChildren.getItemCount()) {
      this.rootChildren.removeItem(item);
    }
  }
  table.updateUI();
  changeSupport.firePropertyChange("String_Node_Str",null,getSelectedRows());
}
Program: 51973
Project: 51973
Buggy source:
public void setSelectedItem(T t){
  this.combobox.setSelectedItem(t);
}

Fixed version (ground truth):
public void setSelectedItem(T t){
  SwingMenupopup popup=getPopupElement();
  for (  XulComponent item : popup.getChildNodes()) {
    SwingMenuitem tempItem=(SwingMenuitem)item;
    if (tempItem.getLabel().equals(extractLabel(t))) {
      this.combobox.setSelectedItem(tempItem);
    }
  }
}
Program: 51974
Project: 51974
Buggy source:
public void valueChanged(ListSelectionEvent e){
  if (e.getValueIsAdjusting() == true) {
    return;
  }
  if (onselect != null && initialized) {
    invoke(onselect);
  }
  setSelectedIndices(listBox.getSelectedIndices());
}

Fixed version (ground truth):
public void valueChanged(ListSelectionEvent e){
  if (e.getValueIsAdjusting() == true) {
    return;
  }
  if (onselect != null && initialized) {
    invoke(onselect);
  }
}
Program: 51975
Project: 51975
Buggy source:
public void setSelectedIndices(int[] indices){
  if (!Arrays.equals(curSelectedIndices,indices)) {
    this.changeSupport.firePropertyChange("String_Node_Str",curSelectedIndices,indices);
    curSelectedIndices=indices;
  }
}

Fixed version (ground truth):
public void setSelectedIndices(int[] indices){
  listBox.setSelectedIndices(indices);
  if (!Arrays.equals(curSelectedIndices,indices)) {
    this.changeSupport.firePropertyChange("String_Node_Str",curSelectedIndices,indices);
    curSelectedIndices=indices;
  }
}
Program: 51976
Project: 51976
Buggy source:
public void setSelectedItems(Object[] items){
  int[] indices=new int[items.length];
  int index=-1;
  for (  Object object : items) {
    indices[++index]=model.indexOf(object);
  }
}

Fixed version (ground truth):
public void setSelectedItems(Object[] items){
  int[] indices=new int[items.length];
  int index=-1;
  for (  Object object : items) {
    indices[++index]=model.indexOf(object);
  }
  setSelectedIndices(indices);
}
Program: 51977
Project: 51977
Buggy source:
public XulComponent getElementById(String id){
  XulElementDom4J ele=(XulElementDom4J)element.elementByID(id);
  if (ele == null) {
    return null;
  }
  return (XulComponent)ele.getXulElement();
}

Fixed version (ground truth):
public XulComponent getElementById(String id){
  XulElementDom4J ele=(XulElementDom4J)element.getDocument().elementByID(id);
  if (ele == null) {
    return null;
  }
  return (XulComponent)ele.getXulElement();
}
Program: 51979
Project: 51979
Buggy source:
public void valueChanged(ListSelectionEvent e){
  if (e.getValueIsAdjusting() == true) {
    return;
  }
  if (initialized) {
    invoke(onselect);
  }
}

Fixed version (ground truth):
public void valueChanged(ListSelectionEvent e){
  if (e.getValueIsAdjusting() == true) {
    return;
  }
  if (onselect != null && initialized) {
    invoke(onselect);
  }
}
Program: 51980
Project: 51980
Buggy source:
public void layout(){
  super.layout();
  for (  XulComponent comp : children) {
    if (comp instanceof SwingListitem) {
      this.model.addElement(comp);
    }
  }
  this.scrollPane.setMinimumSize(new Dimension(this.width,this.height));
  if (this.selectedIndex > -1) {
    this.listBox.setSelectedIndex(selectedIndex);
  }
  initialized=true;
}

Fixed version (ground truth):
public void layout(){
  for (  XulComponent comp : children) {
    if (comp instanceof SwingListitem) {
      this.model.addElement(comp);
      logger.info("String_Node_Str");
    }
  }
  this.scrollPane.setMinimumSize(new Dimension(this.width,this.height));
  if (this.selectedIndex > -1) {
    this.listBox.setSelectedIndex(selectedIndex);
  }
  initialized=true;
}
Program: 51981
Project: 51981
Buggy source:
public SwingListbox(Element self,XulComponent parent,XulDomContainer container,String tagName){
  super(tagName);
  model=new DefaultListModel();
  listBox=new JList(model);
  scrollPane=new JScrollPane(listBox);
  listBox.setBorder(BorderFactory.createLineBorder(Color.gray));
  listBox.addListSelectionListener(this);
  managedObject=scrollPane;
}

Fixed version (ground truth):
public SwingListbox(Element self,XulComponent parent,XulDomContainer container,String tagName){
  super(tagName);
  model=new DefaultListModel();
  listBox=new JList(model);
  scrollPane=new JScrollPane(listBox);
  listBox.setBorder(BorderFactory.createLineBorder(Color.gray));
  listBox.addListSelectionListener(this);
  managedObject=scrollPane;
  this.xulDomContainer=container;
}
Program: 51982
Project: 51982
Buggy source:
public void removeItems(){
  this.model.removeAllElements();
}

Fixed version (ground truth):
public void removeItems(){
  this.model.removeAllElements();
  this.children.clear();
  for (  XulComponent c : this.getChildNodes()) {
    this.removeChild(c);
  }
}