Program: 51934
Project: 51934
Buggy source:
private void setupTable(){
  String cols[]=new String[getColumns().getColumnCount()];
  int len[]=new int[cols.length];
  int totalFlex=0;
  for (int i=0; i < cols.length; i++) {
    totalFlex+=getColumns().getColumn(i).getFlex();
  }
  for (int i=0; i < cols.length; i++) {
    cols[i]=getColumns().getColumn(i).getLabel();
    if (totalFlex > 0 && getWidth() > 0) {
      len[i]=(int)(getWidth() * ((double)getColumns().getColumn(i).getFlex() / totalFlex)) - 15;
    }
  }
  SelectionPolicy policy=SelectionPolicy.DISABLED;
  if ("String_Node_Str".equals(getSeltype())) {
    policy=SelectionPolicy.ONE_ROW;
  }
 else   if ("String_Node_Str".equals(getSeltype())) {
    policy=SelectionPolicy.MULTI_ROW;
  }
  int[] colWidths=(getWidth() > 0 && totalFlex > 0) ? len : null;
  table=new BaseTable(cols,colWidths,new BaseColumnComparator[cols.length],policy);
  table.addTableSelectionListener(new TableSelectionListener(){
    public void onAllRowsDeselected(    SourceTableSelectionEvents sender){
    }
    public void onCellHover(    SourceTableSelectionEvents sender,    int row,    int cell){
    }
    public void onCellUnhover(    SourceTableSelectionEvents sender,    int row,    int cell){
    }
    public void onRowDeselected(    SourceTableSelectionEvents sender,    int row){
    }
    public void onRowHover(    SourceTableSelectionEvents sender,    int row){
    }
    public void onRowUnhover(    SourceTableSelectionEvents sender,    int row){
    }
    public void onRowsSelected(    SourceTableSelectionEvents sender,    int firstRow,    int numRows){
      try {
        if (getOnselect() != null && getOnselect().trim().length() > 0) {
          getXulDomContainer().invoke(getOnselect(),new Object[]{});
        }
        Integer[] selectedRows=table.getSelectedRows().toArray(new Integer[table.getSelectedRows().size()]);
        int[] rows=new int[selectedRows.length];
        for (int i=0; i < selectedRows.length; i++) {
          rows[i]=selectedRows[i];
        }
        GwtTree.this.setSelectedRows(rows);
      }
 catch (      XulException e) {
        e.printStackTrace();
      }
    }
  }
);
  setWidgetInPanel(table);
  table.setTableWidth("String_Node_Str");
  table.setTableHeight("String_Node_Str");
  if (getWidth() > 0) {
    table.setTableWidth(getWidth() + "String_Node_Str");
  }
  if (getHeight() > 0) {
    table.setTableHeight(getHeight() + "String_Node_Str");
  }
  updateUI();
}

Fixed version (ground truth):
private void setupTable(){
  String cols[]=new String[getColumns().getColumnCount()];
  int len[]=new int[cols.length];
  int totalFlex=0;
  for (int i=0; i < cols.length; i++) {
    totalFlex+=getColumns().getColumn(i).getFlex();
  }
  for (int i=0; i < cols.length; i++) {
    cols[i]=getColumns().getColumn(i).getLabel();
    if (totalFlex > 0 && getWidth() > 0) {
      len[i]=(int)(getWidth() * ((double)getColumns().getColumn(i).getFlex() / totalFlex)) - 15;
    }
 else     if (getColumns().getColumn(i).getWidth() > 0) {
      len[i]=getColumns().getColumn(i).getWidth();
    }
  }
  SelectionPolicy policy=SelectionPolicy.DISABLED;
  if ("String_Node_Str".equals(getSeltype())) {
    policy=SelectionPolicy.ONE_ROW;
  }
 else   if ("String_Node_Str".equals(getSeltype())) {
    policy=SelectionPolicy.MULTI_ROW;
  }
  table=new BaseTable(cols,len,new BaseColumnComparator[cols.length],policy);
  table.addTableSelectionListener(new TableSelectionListener(){
    public void onAllRowsDeselected(    SourceTableSelectionEvents sender){
    }
    public void onCellHover(    SourceTableSelectionEvents sender,    int row,    int cell){
    }
    public void onCellUnhover(    SourceTableSelectionEvents sender,    int row,    int cell){
    }
    public void onRowDeselected(    SourceTableSelectionEvents sender,    int row){
    }
    public void onRowHover(    SourceTableSelectionEvents sender,    int row){
    }
    public void onRowUnhover(    SourceTableSelectionEvents sender,    int row){
    }
    public void onRowsSelected(    SourceTableSelectionEvents sender,    int firstRow,    int numRows){
      try {
        if (getOnselect() != null && getOnselect().trim().length() > 0) {
          getXulDomContainer().invoke(getOnselect(),new Object[]{});
        }
        Integer[] selectedRows=table.getSelectedRows().toArray(new Integer[table.getSelectedRows().size()]);
        int[] rows=new int[selectedRows.length];
        for (int i=0; i < selectedRows.length; i++) {
          rows[i]=selectedRows[i];
        }
        GwtTree.this.setSelectedRows(rows);
      }
 catch (      XulException e) {
        e.printStackTrace();
      }
    }
  }
);
  setWidgetInPanel(table);
  table.setTableWidth("String_Node_Str");
  table.setTableHeight("String_Node_Str");
  if (getWidth() > 0) {
    table.setTableWidth(getWidth() + "String_Node_Str");
  }
  if (getHeight() > 0) {
    table.setTableHeight(getHeight() + "String_Node_Str");
  }
  updateUI();
}