nus-yam/ex-repair huggingface dataset:
Program: 51855
Project: 51855
Buggy source:
private Constructor<?> getContructor(String className) throws XulException {
  Constructor<?> con=constructorCache.get(className);
  if (con != null) {
    return con;
  }
  Class<?> c=null;
  for (  ClassLoader loader : classloaders) {
    try {
      c=loader.loadClass(className);
    }
 catch (    ClassNotFoundException e) {
      throw new XulException(e);
    }
  }
  try {
    Constructor<?> constructor=c.getConstructor(new Class[]{Element.class,XulComponent.class,XulDomContainer.class,String.class});
    constructorCache.put(className,constructor);
    return constructor;
  }
 catch (  NoSuchMethodException e1) {
    throw new XulException(e1);
  }
}

Fixed version (ground truth):
private Constructor<?> getContructor(String className) throws XulException {
  Constructor<?> con=constructorCache.get(className);
  if (con != null) {
    return con;
  }
  Class<?> c=null;
  Throwable lastException=null;
  for (  ClassLoader loader : classloaders) {
    try {
      c=loader.loadClass(className);
      if (c != null) {
        break;
      }
    }
 catch (    ClassNotFoundException e) {
      lastException=e;
    }
  }
  if (c == null && lastException != null) {
    throw new XulException(lastException);
  }
  try {
    Constructor<?> constructor=c.getConstructor(new Class[]{Element.class,XulComponent.class,XulDomContainer.class,String.class});
    constructorCache.put(className,constructor);
    return constructor;
  }
 catch (  NoSuchMethodException e1) {
    throw new XulException(e1);
  }
}
Program: 51857
Project: 51857
Buggy source:
private void setupGrid(){
  if (grid == null) {
    grid=new Grid();
    sp=new ScrollPanel(grid);
    SimplePanel div=new SimplePanel();
    div.add(sp);
    container=div;
    setManagedObject(container);
  }
  if (getFlex() > 0) {
    grid.setHeight("String_Node_Str");
    grid.setWidth("String_Node_Str");
    sp.setHeight("String_Node_Str");
    sp.setWidth("String_Node_Str");
  }
 else   if (getWidth() > 0) {
    sp.setWidth(getWidth() + "String_Node_Str");
    sp.setHeight(getHeight() + "String_Node_Str");
  }
  grid.setCellSpacing(1);
  updateUI();
}

Fixed version (ground truth):
private void setupGrid(){
  if (grid == null) {
    grid=new Grid();
    sp=new ScrollPanel(grid);
    SimplePanel div=new SimplePanel();
    div.add(sp);
    container=div;
    setManagedObject(container);
  }
  if (getFlex() > 0) {
    grid.setHeight("String_Node_Str");
    grid.setWidth("String_Node_Str");
    sp.setHeight("String_Node_Str");
    sp.setWidth("String_Node_Str");
  }
 else   if (getWidth() > 0) {
    sp.setWidth(getWidth() + "String_Node_Str");
    sp.setHeight(getHeight() + "String_Node_Str");
  }
  grid.setCellSpacing(1);
  if (getPadding() > 0) {
    grid.setCellPadding(getPadding());
  }
  updateUI();
}
Program: 51860
Project: 51860
Buggy source:
public int getSelectedIndex(){
  return container.getVisibleWidget();
}

Fixed version (ground truth):
@Bindable public int getSelectedIndex(){
  return container.getVisibleWidget();
}
Program: 51861
Project: 51861
Buggy source:
public void setSelectedIndex(int index){
  int previousVal=selectedIndex;
  if (index < container.getWidgetCount() && index >= 0) {
    container.showWidget(index);
    Widget card=container.getWidget(index);
    notifyOnShow(this);
  }
  selectedIndex=index;
  this.firePropertyChange("String_Node_Str",previousVal,index);
}

Fixed version (ground truth):
@Bindable public void setSelectedIndex(int index){
  int previousVal=selectedIndex;
  if (index < container.getWidgetCount() && index >= 0) {
    container.showWidget(index);
    Widget card=container.getWidget(index);
    notifyOnShow(this);
  }
  selectedIndex=index;
  this.firePropertyChange("String_Node_Str",previousVal,index);
}
Program: 51862
Project: 51862
Buggy source:
@Override public void setPopup(Menu m){
  final Control control;
  if (isHierarchical()) {
    control=tree.getControl();
  }
 else {
    control=table.getControl();
  }
  control.setMenu(m);
}

Fixed version (ground truth):
@Override public void setPopup(final Menu menu){
  final Control control;
  if (isHierarchical()) {
    control=tree.getControl();
  }
 else {
    control=table.getControl();
  }
  control.addListener(SWT.MenuDetect,new Listener(){
    public void handleEvent(    Event evt){
      Point pt=control.getDisplay().map(control,null,new Point(evt.x,evt.y));
      menu.setLocation(evt.x,evt.y);
      menu.setVisible(true);
    }
  }
);
}
Program: 51863
Project: 51863
Buggy source:
public void show(boolean force){
  if ((force) || (!buttonsCreated)) {
    setButtons();
  }
  isDialogHidden=false;
  dialog.getShell().setText(title);
  if (this.appIcon == null) {
    applyParentShellIcon();
  }
  if ((height > 0) && (width > 0)) {
    dialog.setHeight(height);
    dialog.setWidth(width);
  }
  dialog.resizeBounds();
  if (pack) {
    dialog.getShell().pack();
  }
  notifyListeners(XulRoot.EVENT_ON_LOAD);
  returnCode=dialog.open();
}

Fixed version (ground truth):
public void show(boolean force){
  if ((force) || (!buttonsCreated)) {
    setButtons();
  }
  isDialogHidden=false;
  dialog.getShell().setText(title);
  if (this.appIcon == null) {
    applyParentShellIcon();
  }
  if ((height > 0) && (width > 0)) {
    dialog.setHeight(height);
    dialog.setWidth(width);
  }
  dialog.resizeBounds();
  if (pack) {
    dialog.getShell().pack();
  }
  dialog.getMainArea().layout(true,true);
  notifyListeners(XulRoot.EVENT_ON_LOAD);
  returnCode=dialog.open();
}
Program: 51864
Project: 51864
Buggy source:
private BasicDialog createDialog(){
  final BasicDialog newDialog=new BasicDialog((possibleParent != null) ? possibleParent : new Shell(SWT.SHELL_TRIM),true){
    @Override protected void handleShellCloseEvent(){
      hide();
    }
  }
;
  newDialog.getShell().setBackgroundMode(SWT.INHERIT_DEFAULT);
  if (StringUtils.isNotEmpty(this.appIcon)) {
    setAppicon(this.appIcon);
  }
 else   if (possibleParent != null) {
    newDialog.getShell().setImage(((Shell)possibleParent).getImage());
  }
  return newDialog;
}

Fixed version (ground truth):
private BasicDialog createDialog(){
  final BasicDialog newDialog=new BasicDialog((possibleParent != null) ? possibleParent : new Shell(SWT.SHELL_TRIM),true){
    @Override protected void handleShellCloseEvent(){
      hide();
    }
  }
;
  newDialog.getShell().setBackgroundMode(SWT.INHERIT_DEFAULT);
  if (StringUtils.isNotEmpty(this.appIcon)) {
    setAppicon(this.appIcon);
  }
 else   if (possibleParent != null && possibleParent.isDisposed() == false) {
    newDialog.getShell().setImage(((Shell)possibleParent).getImage());
  }
  return newDialog;
}
Program: 51865
Project: 51865
Buggy source:
protected void removeButton(String button){
  String bName=button.trim().toUpperCase();
  if (activeDialogButtons.containsKey(bName)) {
    SwtButton b=activeDialogButtons.get(bName);
    Button swtB=(Button)b.getManagedObject();
    if (!swtB.isDisposed()) {
      swtB.dispose();
    }
    removeChild(b);
    activeDialogButtons.remove(bName);
  }
}

Fixed version (ground truth):
protected void removeButton(String button){
  String bName=button.trim().toUpperCase();
  if (activeDialogButtons.containsKey(bName)) {
    SwtButton b=activeDialogButtons.get(bName);
    Button swtB=(Button)b.getManagedObject();
    if (!swtB.isDisposed()) {
      swtB.dispose();
    }
    activeDialogButtons.remove(bName);
    removeChild(b);
  }
}
Program: 51867
Project: 51867
Buggy source:
public <T>void setSelectedItems(Collection<T> items){
  int[] selIndexes=new int[items.size()];
  if (this.isHierarchical && this.elements != null) {
    if (currentSelectedItems != null && currentSelectedItems.equals(items)) {
      return;
    }
    List<Object> selection=new ArrayList<Object>();
    String property=toGetter(((XulTreeCol)this.getColumns().getChildNodes().get(0)).getChildrenbinding());
    for (    T t : items) {
      if (this.elements.contains(t)) {
        continue;
      }
      FindBoundItemTuple tuple=new FindBoundItemTuple(t);
      findBoundItem(this.elements,this,property,tuple);
      XulComponent bItem=tuple.treeItem;
      if (tuple.treeItem == this) {
        bItem=this.getRootChildren().getChildNodes().get(0);
      }
      if (bItem != null) {
        selection.add(bItem);
      }
    }
    tree.setSelection(new StructuredSelection(selection));
  }
 else {
    int pos=0;
    for (    T t : items) {
      selIndexes[pos++]=findIndexOfItem(t);
    }
    this.setSelectedRows(selIndexes);
  }
}

Fixed version (ground truth):
public <T>void setSelectedItems(Collection<T> items){
  int[] selIndexes=new int[items.size()];
  if (this.isHierarchical && this.elements != null) {
    List<Object> selection=new ArrayList<Object>();
    String property=toGetter(((XulTreeCol)this.getColumns().getChildNodes().get(0)).getChildrenbinding());
    for (    T t : items) {
      FindBoundItemTuple tuple=new FindBoundItemTuple(t);
      findBoundItem(this.elements,this,property,tuple);
      XulComponent bItem=tuple.treeItem;
      if (tuple.treeItem == this) {
        bItem=this.getRootChildren().getChildNodes().get(0);
      }
      if (bItem != null) {
        selection.add(bItem);
      }
    }
    tree.setSelection(new StructuredSelection(selection));
  }
 else {
    int pos=0;
    for (    T t : items) {
      selIndexes[pos++]=findIndexOfItem(t);
    }
    this.setSelectedRows(selIndexes);
  }
}
Program: 51868
Project: 51868
Buggy source:
public void setSelectedIndices(int[] indices){
  listBox.select(indices);
}

Fixed version (ground truth):
public void setSelectedIndices(int[] indices){
  listBox.deselectAll();
  listBox.select(indices);
}
Program: 51869
Project: 51869
Buggy source:
private static XulTreeChildren getTreeChildren(XulComponent parent){
  for (  XulComponent c : parent.getChildNodes()) {
    if (c instanceof XulTreeChildren) {
      return (XulTreeChildren)c;
    }
  }
  return null;
}

Fixed version (ground truth):
private XulTreeChildren getTreeChildren(XulComponent parent){
  if (parent == this && this.isHiddenrootnode() == false) {
    List<XulComponent> childNodes=this.getRootChildren().getChildNodes();
    if (childNodes.size() > 0) {
      parent=childNodes.get(0);
    }
 else {
      return null;
    }
  }
  for (  XulComponent c : parent.getChildNodes()) {
    if (c instanceof XulTreeChildren) {
      return (XulTreeChildren)c;
    }
  }
  return null;
}
Program: 51871
Project: 51871
Buggy source:
public <T>void setSelectedItems(Collection<T> items){
  int[] selIndexes=new int[items.size()];
  if (this.isHierarchical && this.elements != null) {
    List<Object> selection=new ArrayList<Object>();
    String property=toGetter(((XulTreeCol)this.getColumns().getChildNodes().get(0)).getChildrenbinding());
    for (    T t : items) {
      FindBoundItemTuple tuple=new FindBoundItemTuple(t);
      findBoundItem(this.elements,this,property,tuple);
      selection.add(tuple.treeItem);
    }
    tree.setSelection(new StructuredSelection(selection));
  }
 else {
    int pos=0;
    for (    T t : items) {
      selIndexes[pos++]=findIndexOfItem(t);
    }
    this.setSelectedRows(selIndexes);
  }
}

Fixed version (ground truth):
public <T>void setSelectedItems(Collection<T> items){
  int[] selIndexes=new int[items.size()];
  if (this.isHierarchical && this.elements != null) {
    if (currentSelectedItems != null && currentSelectedItems.equals(items)) {
      return;
    }
    List<Object> selection=new ArrayList<Object>();
    String property=toGetter(((XulTreeCol)this.getColumns().getChildNodes().get(0)).getChildrenbinding());
    for (    T t : items) {
      if (this.elements.contains(t)) {
        continue;
      }
      FindBoundItemTuple tuple=new FindBoundItemTuple(t);
      findBoundItem(this.elements,this,property,tuple);
      XulComponent bItem=tuple.treeItem;
      if (tuple.treeItem == this) {
        bItem=this.getRootChildren().getChildNodes().get(0);
      }
      if (bItem != null) {
        selection.add(bItem);
      }
    }
    tree.setSelection(new StructuredSelection(selection));
  }
 else {
    int pos=0;
    for (    T t : items) {
      selIndexes[pos++]=findIndexOfItem(t);
    }
    this.setSelectedRows(selIndexes);
  }
}
Program: 51872
Project: 51872
Buggy source:
@Override public void layout(){
  XulComponent primaryColumn=this.getElementByXPath("String_Node_Str");
  XulComponent isaContainer=this.getElementByXPath("String_Node_Str");
  isHierarchical=(primaryColumn != null) || (isaContainer != null);
  if (isHierarchical) {
    int style=(this.selType == TableSelection.MULTIPLE) ? SWT.MULTI : SWT.None;
    style|=SWT.BORDER;
    tree=new TreeViewer((Composite)parentComponent.getManagedObject(),style);
    setManagedObject(tree);
  }
 else {
    table=new TableViewer((Composite)parentComponent.getManagedObject(),SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL| SWT.FULL_SELECTION| SWT.BORDER);
    setManagedObject(table);
  }
  if (isHierarchical) {
    setupTree();
  }
 else {
    setupTable();
  }
  if (getOndrag() != null) {
    DropEffectType effect=DropEffectType.COPY;
    if (getDrageffect() != null) {
      effect=DropEffectType.valueOfIgnoreCase(getDrageffect());
    }
    super.enableDrag(effect);
  }
  if (getOndrop() != null) {
    super.enableDrop();
  }
  this.initialized=true;
}

Fixed version (ground truth):
@Override public void layout(){
  XulComponent primaryColumn=this.getElementByXPath("String_Node_Str");
  XulComponent isaContainer=this.getElementByXPath("String_Node_Str");
  isHierarchical=(primaryColumn != null) || (isaContainer != null);
  if (isHierarchical) {
    int style=(this.selType == TableSelection.MULTIPLE) ? SWT.MULTI : SWT.None;
    style|=SWT.BORDER;
    tree=new TreeViewer((Composite)parentComponent.getManagedObject(),style);
    Button b=new Button((Composite)parentComponent.getManagedObject(),SWT.PUSH);
    b.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent arg0){
      }
    }
);
    setManagedObject(tree);
  }
 else {
    table=new TableViewer((Composite)parentComponent.getManagedObject(),SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL| SWT.FULL_SELECTION| SWT.BORDER);
    setManagedObject(table);
  }
  if (isHierarchical) {
    setupTree();
  }
 else {
    setupTable();
  }
  if (getOndrag() != null) {
    DropEffectType effect=DropEffectType.COPY;
    if (getDrageffect() != null) {
      effect=DropEffectType.valueOfIgnoreCase(getDrageffect());
    }
    super.enableDrag(effect);
  }
  if (getOndrop() != null) {
    super.enableDrop();
  }
  this.initialized=true;
}
Program: 51873
Project: 51873
Buggy source:
private BasicDialog createDialog(){
  final BasicDialog newDialog=new BasicDialog((possibleParent != null) ? possibleParent : new Shell(SWT.SHELL_TRIM),true);
  newDialog.getShell().setBackgroundMode(SWT.INHERIT_DEFAULT);
  newDialog.getShell().addListener(SWT.Dispose,new Listener(){
    public void handleEvent(    Event event){
      if (ignoreDisposeEvent == false) {
        hide();
      }
 else {
        ignoreDisposeEvent=false;
      }
    }
  }
);
  setAppicon(this.appIcon);
  return newDialog;
}

Fixed version (ground truth):
private BasicDialog createDialog(){
  final BasicDialog newDialog=new BasicDialog((possibleParent != null) ? possibleParent : new Shell(SWT.SHELL_TRIM),true){
    @Override protected void handleShellCloseEvent(){
      hide();
    }
  }
;
  newDialog.getShell().setBackgroundMode(SWT.INHERIT_DEFAULT);
  setAppicon(this.appIcon);
  return newDialog;
}
Program: 51874
Project: 51874
Buggy source:
public void hide(){
  if (dialog.getMainArea().isDisposed()) {
    return;
  }
  returnCode=IDialogConstants.CLOSE_ID;
  BasicDialog newDialog=createDialog();
  Control[] controlz=newDialog.getMainArea().getChildren();
  for (  Control c : controlz) {
    c.dispose();
  }
  Control[] controls=dialog.getMainArea().getChildren();
  for (  Control c : controls) {
    c.setParent(newDialog.getMainArea());
  }
  setButtons(newDialog);
  setAppicon(this.appIcon);
  newDialog.getShell().layout();
  ignoreDisposeEvent=true;
  dialog.close();
  isDialogHidden=true;
  dialog=newDialog;
  setManagedObject(dialog.getMainArea());
}

Fixed version (ground truth):
public void hide(){
  if (dialog.getMainArea().isDisposed()) {
    return;
  }
  returnCode=IDialogConstants.CLOSE_ID;
  BasicDialog newDialog=createDialog();
  Control[] controlz=newDialog.getMainArea().getChildren();
  for (  Control c : controlz) {
    c.dispose();
  }
  Control[] controls=dialog.getMainArea().getChildren();
  for (  Control c : controls) {
    c.setParent(newDialog.getMainArea());
  }
  setButtons(newDialog);
  setAppicon(this.appIcon);
  newDialog.getShell().layout();
  dialog.close();
  isDialogHidden=true;
  dialog=newDialog;
  setManagedObject(dialog.getMainArea());
}
Program: 51875
Project: 51875
Buggy source:
private BasicDialog createDialog(){
  final BasicDialog newDialog=new BasicDialog((possibleParent != null) ? possibleParent : new Shell(SWT.SHELL_TRIM),true);
  newDialog.getShell().setBackgroundMode(SWT.INHERIT_DEFAULT);
  newDialog.getShell().addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent arg0){
      if (ignoreDisposeEvent == false) {
        hide();
      }
 else {
        ignoreDisposeEvent=false;
      }
    }
  }
);
  setAppicon(this.appIcon);
  return newDialog;
}

Fixed version (ground truth):
private BasicDialog createDialog(){
  final BasicDialog newDialog=new BasicDialog((possibleParent != null) ? possibleParent : new Shell(SWT.SHELL_TRIM),true);
  newDialog.getShell().setBackgroundMode(SWT.INHERIT_DEFAULT);
  newDialog.getShell().addListener(SWT.Dispose,new Listener(){
    public void handleEvent(    Event event){
      if (ignoreDisposeEvent == false) {
        hide();
      }
 else {
        ignoreDisposeEvent=false;
      }
    }
  }
);
  setAppicon(this.appIcon);
  return newDialog;
}
Program: 51877
Project: 51877
Buggy source:
private void removeItem(Object parent,String childrenMethodProperty,Object toRemove){
  Collection children=getChildCollection(parent,childrenMethodProperty);
  if (children == null) {
    return;
  }
  Iterator iter=children.iterator();
  while (iter.hasNext()) {
    Object next=iter.next();
    if (next == toRemove) {
      iter.remove();
      return;
    }
    removeItem(next,childrenMethodProperty,toRemove);
  }
}

Fixed version (ground truth):
private void removeItem(Object parent,String childrenMethodProperty,Object toRemove){
  Collection children=getChildCollection(parent,childrenMethodProperty);
  if (children == null) {
    return;
  }
  Iterator iter=children.iterator();
  while (iter.hasNext()) {
    Object next=iter.next();
    if (next == toRemove) {
      children.remove(toRemove);
      return;
    }
    removeItem(next,childrenMethodProperty,toRemove);
  }
}
Program: 51878
Project: 51878
Buggy source:
protected int doCompare(Viewer v,Object e1,Object e2){
  String t1="String_Node_Str";
  String t2="String_Node_Str";
  if (viewer.getLabelProvider() instanceof XulTableColumnLabelProvider) {
    XulTableColumnLabelProvider columnLabelProvider=(XulTableColumnLabelProvider)viewer.getLabelProvider();
    t1=columnLabelProvider.getColumnText(e1,columnIndex);
    t2=columnLabelProvider.getColumnText(e2,columnIndex);
  }
 else {
    ILabelProvider labelProvider=(ILabelProvider)viewer.getLabelProvider(columnIndex);
    t1=labelProvider.getText(e1);
    t2=labelProvider.getText(e2);
  }
  if (t1 == null)   t1="String_Node_Str";
  if (t2 == null)   t2="String_Node_Str";
  return t1.compareTo(t2);
}

Fixed version (ground truth):
protected int doCompare(Viewer v,Object e1,Object e2){
  String t1="String_Node_Str";
  String t2="String_Node_Str";
  if (viewer.getLabelProvider() instanceof XulTableColumnLabelProvider) {
    XulTableColumnLabelProvider columnLabelProvider=(XulTableColumnLabelProvider)viewer.getLabelProvider();
    t1=columnLabelProvider.getColumnText(e1,columnIndex);
    t2=columnLabelProvider.getColumnText(e2,columnIndex);
  }
 else {
    ILabelProvider labelProvider=(ILabelProvider)viewer.getLabelProvider(columnIndex);
    t1=labelProvider.getText(e1);
    t2=labelProvider.getText(e2);
  }
  if (t1 == null)   t1="String_Node_Str";
  if (t2 == null)   t2="String_Node_Str";
  return t1.compareToIgnoreCase(t2);
}
Program: 51879
Project: 51879
Buggy source:
protected int doCompare(Viewer v,Object e1,Object e2){
  ILabelProvider labelProvider=(ILabelProvider)viewer.getLabelProvider(columnIndex);
  String t1=labelProvider.getText(e1);
  String t2=labelProvider.getText(e2);
  if (t1 == null)   t1="String_Node_Str";
  if (t2 == null)   t2="String_Node_Str";
  return t1.compareTo(t2);
}

Fixed version (ground truth):
protected int doCompare(Viewer v,Object e1,Object e2){
  ILabelProvider labelProvider=(ILabelProvider)viewer.getLabelProvider(columnIndex);
  String t1=labelProvider.getText(e1);
  String t2=labelProvider.getText(e2);
  if (t1 == null)   t1="String_Node_Str";
  if (t2 == null)   t2="String_Node_Str";
  return t1.compareToIgnoreCase(t2);
}
Program: 51880
Project: 51880
Buggy source:
private RETURN_CODE showOpen(){
  fc=new FileDialog((Shell)domContainer.getDocumentRoot().getRootElement().getManagedObject(),SWT.OPEN);
  if (fileHint != null) {
    fc.setFileName(fileHint.getAbsolutePath());
  }
  String retVal=fc.open();
  if (retVal != null) {
    if (this.selectionType == SEL_TYPE.SINGLE) {
      selectedFile=fc.getFileName();
    }
 else {
      selectedFiles=fc.getFileNames();
    }
    return RETURN_CODE.OK;
  }
 else {
    return RETURN_CODE.CANCEL;
  }
}

Fixed version (ground truth):
private RETURN_CODE showOpen(){
  fc=new FileDialog((Shell)((XulRoot)domContainer.getDocumentRoot().getRootElement()).getRootObject(),SWT.OPEN);
  if (fileHint != null) {
    fc.setFileName(fileHint.getAbsolutePath());
  }
  String retVal=fc.open();
  if (retVal != null) {
    if (this.selectionType == SEL_TYPE.SINGLE) {
      selectedFile=fc.getFileName();
    }
 else {
      selectedFiles=fc.getFileNames();
    }
    return RETURN_CODE.OK;
  }
 else {
    return RETURN_CODE.CANCEL;
  }
}
Program: 51881
Project: 51881
Buggy source:
protected int doCompare(Viewer v,Object e1,Object e2){
  ILabelProvider labelProvider=(ILabelProvider)viewer.getLabelProvider(columnIndex);
  String t1=labelProvider.getText(e1);
  String t2=labelProvider.getText(e2);
  if (t1 == null)   t1="String_Node_Str";
  if (t2 == null)   t2="String_Node_Str";
  return t1.compareTo(t2);
}

Fixed version (ground truth):
protected int doCompare(Viewer v,Object e1,Object e2){
  String t1="String_Node_Str";
  String t2="String_Node_Str";
  if (viewer.getLabelProvider() instanceof XulTableColumnLabelProvider) {
    XulTableColumnLabelProvider columnLabelProvider=(XulTableColumnLabelProvider)viewer.getLabelProvider();
    t1=columnLabelProvider.getColumnText(e1,columnIndex);
    t2=columnLabelProvider.getColumnText(e2,columnIndex);
  }
 else {
    ILabelProvider labelProvider=(ILabelProvider)viewer.getLabelProvider(columnIndex);
    t1=labelProvider.getText(e1);
    t2=labelProvider.getText(e2);
  }
  if (t1 == null)   t1="String_Node_Str";
  if (t2 == null)   t2="String_Node_Str";
  return t1.compareTo(t2);
}
Program: 51882
Project: 51882
Buggy source:
public Object getBoundObject(){
  return boundObjectRef.get();
}

Fixed version (ground truth):
public Object getBoundObject(){
  if (boundObjectRef != null) {
    return boundObjectRef.get();
  }
  return null;
}
Program: 51884
Project: 51884
Buggy source:
@Override public void setVisible(boolean visible){
  super.setVisible(visible);
  if (getManagedObject() instanceof Control) {
    Control control=(Control)getManagedObject();
    Object data=control.getLayoutData();
    if (data instanceof GridData) {
      ((GridData)data).exclude=!visible;
    }
    control.setLayoutData(data);
    control.setVisible(visible);
    if (!visible) {
      control.setSize(new Point(0,0));
    }
    control.getParent().pack();
    control.getParent().layout(true);
  }
}

Fixed version (ground truth):
@Override public void setVisible(boolean visible){
  super.setVisible(visible);
  if (getManagedObject() instanceof Control) {
    Control control=(Control)getManagedObject();
    Object data=control.getLayoutData();
    if (data instanceof GridData) {
      ((GridData)data).exclude=!visible;
    }
    control.setLayoutData(data);
    control.setVisible(visible);
    control.getParent().layout(true);
  }
}
Program: 51885
Project: 51885
Buggy source:
@Override public void layout(){
  box.layout(true);
  if (!getChildNodes().isEmpty()) {
    XulComponent control=getChildNodes().get(getSelectedIndex());
    layout.topControl=(Control)control.getManagedObject();
  }
}

Fixed version (ground truth):
@Override public void layout(){
  if (!getChildNodes().isEmpty()) {
    XulComponent control=getChildNodes().get(getSelectedIndex());
    layout.topControl=(Control)control.getManagedObject();
    if (layout.topControl instanceof Composite) {
      ((Composite)layout.topControl).layout(true);
    }
  }
  box.layout(true);
}
Program: 51886
Project: 51886
Buggy source:
public void setSelectedIndex(int index){
  selectedChildIndex=index;
  if (!getChildNodes().isEmpty()) {
    XulComponent control=getChildNodes().get(selectedChildIndex);
    layout.topControl=(Control)control.getManagedObject();
    layout();
  }
}

Fixed version (ground truth):
public void setSelectedIndex(int index){
  selectedChildIndex=index;
  layout();
}
Program: 51887
Project: 51887
Buggy source:
public void setOnload(final String method){
  this.onload=method;
  dialog.getShell().addListener(XulRoot.EVENT_ON_LOAD,new Listener(){
    public void handleEvent(    Event e){
      if (!StringUtils.isEmpty(method)) {
        if (SwtDialog.this.domContainer.isInitialized()) {
          invoke(method);
        }
      }
    }
  }
);
}

Fixed version (ground truth):
public void setOnload(final String method){
  this.onload=method;
}
Program: 51888
Project: 51888
Buggy source:
public void handleEvent(Event e){
  if (!StringUtils.isEmpty(method)) {
    if (SwtDialog.this.domContainer.isInitialized()) {
      invoke(method);
    }
  }
}

Fixed version (ground truth):
public void handleEvent(Event event){
  hide();
  event.doit=false;
}
Program: 51889
Project: 51889
Buggy source:
public SwtGrid(Element self,XulComponent parent,XulDomContainer domContainer,String tagName){
  super("String_Node_Str");
  int style=SWT.None;
  if (self.getAttributeValue("String_Node_Str") != null) {
    style=SWT.BORDER;
  }
  Composite box=new Composite((Composite)parent.getManagedObject(),style);
  box.setBackgroundMode(SWT.INHERIT_DEFAULT);
  setManagedObject(box);
}

Fixed version (ground truth):
public SwtGrid(Element self,XulComponent parent,XulDomContainer domContainer,String tagName){
  super("String_Node_Str");
  this.domContainer=domContainer;
  int style=SWT.None;
  if (self.getAttributeValue("String_Node_Str") != null) {
    style=SWT.BORDER;
  }
  grid=new Composite((Composite)parent.getManagedObject(),style);
  grid.setBackgroundMode(SWT.INHERIT_DEFAULT);
  setManagedObject(grid);
}
Program: 51890
Project: 51890
Buggy source:
public SwtLabel(Element self,XulComponent parent,XulDomContainer container,String tagName){
  super(tagName);
  label=new CLabel((Composite)parent.getManagedObject(),SWT.WRAP);
  setManagedObject(label);
}

Fixed version (ground truth):
public SwtLabel(Element self,XulComponent parent,XulDomContainer container,String tagName){
  super(tagName);
  String multi=self.getAttributeValue("String_Node_Str");
  if (multi != null && multi.equals("String_Node_Str")) {
    label=new Label((Composite)parent.getManagedObject(),SWT.WRAP);
    setManagedObject(label);
  }
 else {
    cLabel=new CLabel((Composite)parent.getManagedObject(),SWT.NONE);
    setManagedObject(cLabel);
  }
}
Program: 51891
Project: 51891
Buggy source:
public String getValue(){
  return label.getText();
}

Fixed version (ground truth):
public String getValue(){
  return (label != null) ? label.getText() : cLabel.getText();
}
Program: 51892
Project: 51892
Buggy source:
public void setDisabled(boolean disabled){
  this.disabled=disabled;
  if (!label.isDisposed())   label.setEnabled(!disabled);
}

Fixed version (ground truth):
public void setDisabled(boolean disabled){
  this.disabled=disabled;
  if (label != null) {
    if (!label.isDisposed()) {
      label.setEnabled(!disabled);
    }
  }
 else {
    cLabel.setEnabled(!disabled);
  }
}
Program: 51893
Project: 51893
Buggy source:
/** 
 * True parameter for bean-able attribute "value" (XUL attribute)
 * @param text
 */
public void setValue(String text){
  if (text == null) {
    text="String_Node_Str";
  }
  label.setText(text);
  if (getParent() != null) {
    label.getShell().layout(true);
  }
}

Fixed version (ground truth):
/** 
 * True parameter for bean-able attribute "value" (XUL attribute)
 * @param text
 */
public void setValue(String text){
  if (text == null) {
    text="String_Node_Str";
  }
  if (label != null) {
    label.setText(text);
    if (getParent() != null) {
      label.getShell().layout(true);
    }
  }
 else {
    cLabel.setText(text);
  }
}
Program: 51895
Project: 51895
Buggy source:
private Control createImageButton(){
  imageButton=new Label(((Composite)parent.getManagedObject()),SWT.NONE);
  return imageButton;
}

Fixed version (ground truth):
private Control createImageButton(){
  imageButton=new Label(((Composite)parent.getManagedObject()),SWT.NONE);
  imageButton.addMouseListener(new MouseAdapter(){
    @Override public void mouseUp(    MouseEvent arg0){
      if (disabled == false) {
        invoke(onclick);
      }
    }
  }
);
  imageButton.setCursor(new Cursor(((Composite)parent.getManagedObject()).getDisplay(),SWT.CURSOR_HAND));
  return imageButton;
}
Program: 51896
Project: 51896
Buggy source:
public void setButton(Button button){
  this.button=button;
  setManagedObject(button);
}

Fixed version (ground truth):
public void setButton(Button button){
  this.button=button;
  button.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    org.eclipse.swt.events.SelectionEvent arg0){
      invoke(onclick);
    }
  }
);
  setManagedObject(button);
  setVisible(isVisible());
}
Program: 51897
Project: 51897
Buggy source:
protected Button createNewButton(Composite parent){
  return new Button(parent,SWT.NONE);
}

Fixed version (ground truth):
protected Button createNewButton(Composite parent){
  Button button=new Button(parent,SWT.NONE);
  button.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    org.eclipse.swt.events.SelectionEvent arg0){
      invoke(onclick);
    }
  }
);
  return button;
}
Program: 51898
Project: 51898
Buggy source:
public void widgetSelected(org.eclipse.swt.events.SelectionEvent arg0){
  invoke(method);
}

Fixed version (ground truth):
public void widgetSelected(org.eclipse.swt.events.SelectionEvent arg0){
  invoke(onclick);
}
Program: 51899
Project: 51899
Buggy source:
public void setOnclick(final String method){
  this.onclick=method;
  if (button != null) {
    button.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      org.eclipse.swt.events.SelectionEvent arg0){
        invoke(method);
      }
    }
);
  }
 else {
    imageButton.addMouseListener(new MouseAdapter(){
      @Override public void mouseUp(      MouseEvent arg0){
        if (disabled == false) {
          invoke(method);
        }
      }
    }
);
    imageButton.setCursor(new Cursor(((Composite)parent.getManagedObject()).getDisplay(),SWT.CURSOR_HAND));
  }
}

Fixed version (ground truth):
public void setOnclick(final String method){
  this.onclick=method;
}
Program: 51900
Project: 51900
Buggy source:
@Override public void mouseUp(MouseEvent arg0){
  if (disabled == false) {
    invoke(method);
  }
}

Fixed version (ground truth):
@Override public void mouseUp(MouseEvent arg0){
  if (disabled == false) {
    invoke(onclick);
  }
}
Program: 51901
Project: 51901
Buggy source:
@Override public void layout(){
  box.layout();
  if (!getChildNodes().isEmpty()) {
    XulComponent control=getChildNodes().get(getSelectedIndex());
    layout.topControl=(Control)control.getManagedObject();
  }
}

Fixed version (ground truth):
@Override public void layout(){
  box.layout(true);
  if (!getChildNodes().isEmpty()) {
    XulComponent control=getChildNodes().get(getSelectedIndex());
    layout.topControl=(Control)control.getManagedObject();
  }
}
Program: 51903
Project: 51903
Buggy source:
/** 
 * True parameter for bean-able attribute "value" (XUL attribute)
 * @param text
 */
public void setValue(String text){
  label.setText(text);
}

Fixed version (ground truth):
/** 
 * True parameter for bean-able attribute "value" (XUL attribute)
 * @param text
 */
public void setValue(String text){
  label.setText(text);
  if (getParent() != null) {
    label.getShell().layout(true);
  }
}
Program: 51904
Project: 51904
Buggy source:
public SwtMenupopup(Element self,XulComponent parent,XulDomContainer domContainer,String tagName){
  super("String_Node_Str");
  this.parent=parent;
  Shell shell=null;
  this.domContainer=domContainer;
  if (shell == null) {
    XulComponent p=parent;
    while (p != null && p instanceof XulRoot == false) {
      if (p instanceof XulMenubar && p.getAttributeValue("String_Node_Str") != null && p.getAttributeValue("String_Node_Str").equals("String_Node_Str") && domContainer.getOuterContext() != null) {
        shell=(Shell)domContainer.getOuterContext();
        break;
      }
      p=p.getParent();
    }
    if (p != null && p instanceof XulRoot) {
      shell=(Shell)p.getManagedObject();
    }
  }
  if (parent.getManagedObject() instanceof MenuItem) {
    Menu flyout=new Menu(shell,SWT.DROP_DOWN);
    ((MenuItem)parent.getManagedObject()).setMenu(flyout);
    menu=flyout;
    setManagedObject(flyout);
  }
 else   if (parent instanceof XulMenuList) {
  }
 else {
    menu=new Menu(shell,SWT.POP_UP);
    setManagedObject(menu);
  }
}

Fixed version (ground truth):
public SwtMenupopup(Element self,XulComponent parent,XulDomContainer domContainer,String tagName){
  super("String_Node_Str");
  this.parent=parent;
  Shell shell=null;
  this.domContainer=domContainer;
  if (shell == null) {
    XulComponent p=parent;
    while (p != null && p instanceof XulRoot == false) {
      if (p instanceof XulMenubar && p.getAttributeValue("String_Node_Str") != null && p.getAttributeValue("String_Node_Str").equals("String_Node_Str") && domContainer.getOuterContext() != null) {
        shell=(Shell)domContainer.getOuterContext();
        break;
      }
      p=p.getParent();
    }
    if (p != null && p instanceof XulRoot) {
      shell=(Shell)((XulRoot)p).getRootObject();
    }
  }
  if (parent.getManagedObject() instanceof MenuItem) {
    Menu flyout=new Menu(shell,SWT.DROP_DOWN);
    ((MenuItem)parent.getManagedObject()).setMenu(flyout);
    menu=flyout;
    setManagedObject(flyout);
  }
 else   if (parent instanceof XulMenuList) {
  }
 else {
    menu=new Menu(shell,SWT.POP_UP);
    setManagedObject(menu);
  }
}
Program: 51905
Project: 51905
Buggy source:
public XulMenuitem createNewMenuitemAtPos(int pos){
  if (pos > getChildNodes().size()) {
    pos=getChildNodes().size();
  }
  return new SwtMenuitem(this,domContainer,"String_Node_Str",pos);
}

Fixed version (ground truth):
public XulMenuitem createNewMenuitemAtPos(int pos){
  if (pos > getChildNodes().size()) {
    pos=getChildNodes().size();
  }
  XulMenuitem item=new SwtMenuitem(this,domContainer,"String_Node_Str",pos);
  this.addChild(item);
  return item;
}
Program: 51906
Project: 51906
Buggy source:
public void hide(){
  if (dialog.getMainArea().isDisposed()) {
    return;
  }
  returnCode=IDialogConstants.CLOSE_ID;
  BasicDialog newDialog=new BasicDialog((possibleParent != null) ? possibleParent : new Shell(SWT.SHELL_TRIM),getResizable());
  Control[] controls=dialog.getMainArea().getChildren();
  for (  Control c : controls) {
    c.setParent(newDialog.getMainArea());
  }
  setButtons(newDialog);
  newDialog.getShell().layout();
  dialog.close();
  isDialogHidden=true;
  dialog=newDialog;
  dialog.getShell().addListener(SWT.Close,new Listener(){
    public void handleEvent(    Event event){
      hide();
      event.doit=false;
    }
  }
);
  setManagedObject(dialog.getMainArea());
}

Fixed version (ground truth):
public void hide(){
  if (dialog.getMainArea().isDisposed()) {
    return;
  }
  returnCode=IDialogConstants.CLOSE_ID;
  BasicDialog newDialog=new BasicDialog((possibleParent != null) ? possibleParent : new Shell(SWT.SHELL_TRIM),getResizable());
  Control[] controlz=newDialog.getMainArea().getChildren();
  for (  Control c : controlz) {
    c.dispose();
  }
  Control[] controls=dialog.getMainArea().getChildren();
  System.out.println("String_Node_Str");
  for (  Control c : controls) {
    System.out.println(c.toString());
    c.setParent(newDialog.getMainArea());
  }
  setButtons(newDialog);
  newDialog.getShell().layout();
  dialog.close();
  isDialogHidden=true;
  dialog=newDialog;
  dialog.getShell().addListener(SWT.Close,new Listener(){
    public void handleEvent(    Event event){
      hide();
      event.doit=false;
    }
  }
);
  setManagedObject(dialog.getMainArea());
}
Program: 51907
Project: 51907
Buggy source:
private Object getSelectedTreeItem(int[] currentSelection){
  if (this.isHierarchical && this.elements != null) {
    int[] vals=currentSelection;
    if (vals == null || vals.length == 0 || elements == null || elements.size() == 0) {
      return null;
    }
    String property=((XulTreeCol)this.getColumns().getChildNodes().get(0)).getChildrenbinding();
    property="String_Node_Str" + (property.substring(0,1).toUpperCase() + property.substring(1));
    int selectedIdx=vals[0];
    FindSelectedItemTuple tuple=findSelectedItem(this.elements,property,new FindSelectedItemTuple(selectedIdx));
    return tuple != null ? tuple.selectedItem : null;
  }
  return null;
}

Fixed version (ground truth):
private Object getSelectedTreeItem(int[] currentSelection){
  if (this.isHierarchical && this.elements != null) {
    int[] vals=currentSelection;
    if (vals == null || vals.length == 0 || elements == null || elements.size() == 0) {
      return null;
    }
    String property=((XulTreeCol)this.getColumns().getChildNodes().get(0)).getChildrenbinding();
    property="String_Node_Str" + (property.substring(0,1).toUpperCase() + property.substring(1));
    int selectedIdx=vals[0];
    if (selectedIdx == -1) {
      return null;
    }
    FindSelectedItemTuple tuple=findSelectedItem(this.elements,property,new FindSelectedItemTuple(selectedIdx));
    return tuple != null ? tuple.selectedItem : null;
  }
  return null;
}
Program: 51908
Project: 51908
Buggy source:
public SwtMenuitem(Element self,XulComponent parent,XulDomContainer domContainer,String tagName){
  super("String_Node_Str");
  setManagedObject("String_Node_Str");
  if (parent.getManagedObject() != null) {
    item=new MenuItem((Menu)parent.getManagedObject(),SWT.PUSH);
    item.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent arg0){
        String command=SwtMenuitem.this.onCommand;
        if (command != null) {
          invoke(command);
        }
      }
    }
);
  }
}

Fixed version (ground truth):
public SwtMenuitem(Element self,XulComponent parent,XulDomContainer domContainer,String tagName){
  super("String_Node_Str");
  setManagedObject("String_Node_Str");
  if (parent.getManagedObject() != null && parent.getManagedObject() instanceof Menu) {
    item=new MenuItem((Menu)parent.getManagedObject(),SWT.PUSH);
    item.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent arg0){
        String command=SwtMenuitem.this.onCommand;
        if (command != null) {
          invoke(command);
        }
      }
    }
);
  }
}
Program: 51910
Project: 51910
Buggy source:
public void componentResized(ComponentEvent e){
  Rectangle size=table.getBounds();
  int newWidth=size.width;
  if (SwingTree.this.rows > -1) {
    int minHeight=table.getRowHeight() * rows;
    scrollpane.getViewport().setMinimumSize(new Dimension(scrollpane.getWidth(),minHeight - 100));
  }
  int newHeight=size.height;
  for (int i=0; i < table.getColumnCount(); i++) {
    int newColWidth=50;
    if (totalFlex > 0) {
      int flex=SwingTree.this.columns.getColumn(table.getColumnModel().getColumn(i).getModelIndex()).getFlex();
      newColWidth=(int)(newWidth * ((double)flex / totalFlex));
    }
 else {
      newColWidth=(int)(newWidth * ((double)1 / table.getColumnCount()));
    }
    table.getColumnModel().getColumn(i).setWidth(newColWidth);
    table.getColumnModel().getColumn(i).setPreferredWidth(newColWidth);
    table.getColumnModel().getColumn(i).setMinWidth(newColWidth);
  }
  loaded=true;
}

Fixed version (ground truth):
public void componentResized(ComponentEvent e){
  calcColumnWidths();
}
Program: 51912
Project: 51912
Buggy source:
private void setupTable(){
  tableModel=new XulTableModel(this);
  table.setModel(this.tableModel);
  this.setSeltype(getSeltype());
  updateColumnModel();
  initialized=true;
  table.addComponentListener(new ComponentListener(){
    boolean loaded=false;
    public void componentHidden(    ComponentEvent arg0){
    }
    public void componentMoved(    ComponentEvent e){
    }
    public void componentShown(    ComponentEvent e){
    }
    public void componentResized(    ComponentEvent e){
      Rectangle size=table.getBounds();
      int newWidth=size.width;
      if (SwingTree.this.rows > -1) {
        int minHeight=table.getRowHeight() * rows;
        scrollpane.getViewport().setMinimumSize(new Dimension(scrollpane.getWidth(),minHeight - 100));
      }
      int newHeight=size.height;
      for (int i=0; i < table.getColumnCount(); i++) {
        int newColWidth=50;
        if (totalFlex > 0) {
          int flex=SwingTree.this.columns.getColumn(table.getColumnModel().getColumn(i).getModelIndex()).getFlex();
          newColWidth=(int)(newWidth * ((double)flex / totalFlex));
        }
 else {
          newColWidth=(int)(newWidth * ((double)1 / table.getColumnCount()));
        }
        table.getColumnModel().getColumn(i).setWidth(newColWidth);
        table.getColumnModel().getColumn(i).setPreferredWidth(newColWidth);
        table.getColumnModel().getColumn(i).setMinWidth(newColWidth);
      }
      loaded=true;
    }
  }
);
  table.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
    public void valueChanged(    ListSelectionEvent event){
      if (event.getValueIsAdjusting() == true) {
        return;
      }
      SwingTree.this.changeSupport.firePropertyChange("String_Node_Str",null,SwingTree.this.getSelectedRows());
    }
  }
);
  table.getTableHeader().setReorderingAllowed(this.isEnableColumnDrag());
  this.setDisabled(this.isDisabled());
}

Fixed version (ground truth):
private void setupTable(){
  tableModel=new XulTableModel(this);
  table.setModel(this.tableModel);
  this.setSeltype(getSeltype());
  updateColumnModel();
  initialized=true;
  table.addComponentListener(new ComponentListener(){
    public void componentHidden(    ComponentEvent arg0){
    }
    public void componentMoved(    ComponentEvent e){
    }
    public void componentShown(    ComponentEvent e){
    }
    public void componentResized(    ComponentEvent e){
      calcColumnWidths();
    }
  }
);
  table.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
    public void valueChanged(    ListSelectionEvent event){
      if (event.getValueIsAdjusting() == true) {
        return;
      }
      SwingTree.this.changeSupport.firePropertyChange("String_Node_Str",null,SwingTree.this.getSelectedRows());
    }
  }
);
  table.getTableHeader().setReorderingAllowed(this.isEnableColumnDrag());
  this.setDisabled(this.isDisabled());
}
Program: 51913
Project: 51913
Buggy source:
public GwtTabWidget(String text,String tooltip,final TabPanel tabPanel,final Widget tabContent){
  this.tabPanel=tabPanel;
  this.tabContent=tabContent;
  this.fullText=text;
  setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
  panel.setStyleName("String_Node_Str");
  leftCap.setStyleName("String_Node_Str");
  setLabelText(text);
  setLabelTooltip(tooltip);
  textLabel.setStyleName("String_Node_Str");
  textLabel.setWordWrap(false);
  textLabel.addMouseListener(this);
  tabPanel.addSelectionHandler(new SelectionHandler<Integer>(){
    public void onSelection(    SelectionEvent<Integer> event){
      int tabIndex=event.getSelectedItem();
      ElementUtils.blur(getElement().getParentElement());
      if (tabIndex == tabPanel.getWidgetIndex(tabContent)) {
        panel.setStyleName("String_Node_Str");
        leftCap.setStyleName("String_Node_Str");
      }
 else {
        panel.setStyleName("String_Node_Str");
        leftCap.setStyleName("String_Node_Str");
      }
    }
  }
);
  panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
  panel.add(textLabel);
  DOM.setStyleAttribute(textLabel.getElement(),"String_Node_Str","String_Node_Str");
  add(leftCap);
  add(panel);
  sinkEvents(Event.ONDBLCLICK | Event.ONMOUSEUP);
}

Fixed version (ground truth):
public GwtTabWidget(String text,String tooltip,final TabPanel tabPanel,final Widget tabContent){
  this.tabPanel=tabPanel;
  this.tabContent=tabContent;
  this.fullText=text;
  setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
  panel.setStyleName("String_Node_Str");
  leftCap.setStyleName("String_Node_Str");
  Image leftCapImage=new Image(GWT.getModuleBaseURL() + "String_Node_Str");
  leftCap.setSpacing(0);
  leftCapImage.setWidth("String_Node_Str");
  leftCapImage.setHeight("String_Node_Str");
  leftCap.add(leftCapImage);
  setLabelText(text);
  setLabelTooltip(tooltip);
  textLabel.setStyleName("String_Node_Str");
  textLabel.setWordWrap(false);
  textLabel.addMouseListener(this);
  tabPanel.addSelectionHandler(new SelectionHandler<Integer>(){
    public void onSelection(    SelectionEvent<Integer> event){
      int tabIndex=event.getSelectedItem();
      ElementUtils.blur(getElement().getParentElement());
      if (tabIndex == tabPanel.getWidgetIndex(tabContent)) {
        panel.setStyleName("String_Node_Str");
        leftCap.setStyleName("String_Node_Str");
      }
 else {
        panel.setStyleName("String_Node_Str");
        leftCap.setStyleName("String_Node_Str");
      }
    }
  }
);
  panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
  panel.add(textLabel);
  DOM.setStyleAttribute(textLabel.getElement(),"String_Node_Str","String_Node_Str");
  add(leftCap);
  add(panel);
  sinkEvents(Event.ONDBLCLICK | Event.ONMOUSEUP);
}
Program: 51914
Project: 51914
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");
  setCommand(command);
  if (srcEle.getAttribute("String_Node_Str") != null && srcEle.getAttribute("String_Node_Str").length() > 0) {
    setClass(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);
  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")));
  checkBox.addClickHandler(new ClickHandler(){
    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();
      }
    }
  }
);
  setCommand(srcEle.getAttribute("String_Node_Str"));
  if (srcEle.getAttribute("String_Node_Str") != null && srcEle.getAttribute("String_Node_Str").length() > 0) {
    setClass(srcEle.getAttribute("String_Node_Str"));
  }
}