Program: 68906
Project: 68906
Buggy source:
public static ColumnsInfo createTable(ITableContent table,int width){
  int tableWidth=getElementWidth(table,width);
  int columnCount=table.getColumnCount();
  if (columnCount == 0) {
    return null;
  }
  int[] columns=new int[columnCount];
  int unassignedCount=0;
  int totalAssigned=0;
  for (int i=0; i < columnCount; i++) {
    DimensionType value=table.getColumn(i).getWidth();
    if (value == null) {
      columns[i]=-1;
      unassignedCount++;
    }
 else {
      if (ExcelUtil.convertDimensionType(value,tableWidth) > 576000) {
        System.out.println("String_Node_Str");
      }
      columns[i]=ExcelUtil.convertDimensionType(value,tableWidth);
      totalAssigned+=columns[i];
    }
  }
  int leftWidth=tableWidth - totalAssigned;
  if (leftWidth != 0 && unassignedCount == 0) {
    int totalResized=0;
    for (int i=0; i < columnCount - 1; i++) {
      columns[i]=resize(columns[i],totalAssigned,leftWidth);
      totalResized+=columns[i];
    }
    columns[columnCount - 1]=tableWidth - totalResized;
  }
 else   if (leftWidth < 0 && unassignedCount > 0) {
    int totalResized=0;
    int lastAssignedIndex=0;
    for (int i=0; i < columnCount; i++) {
      if (columns[i] == -1) {
        columns[1]=0;
      }
 else {
        columns[i]=resize(columns[i],totalAssigned,leftWidth);
        lastAssignedIndex=i;
      }
      totalResized+=columns[i];
    }
    columns[lastAssignedIndex]+=tableWidth - totalResized;
  }
 else   if (leftWidth >= 0 && unassignedCount > 0) {
    int per=(int)leftWidth / unassignedCount;
    int index=0;
    for (int i=0; i < columns.length; i++) {
      if (columns[i] == -1) {
        columns[i]=per;
        index=i;
      }
    }
    columns[index]=leftWidth - per * (unassignedCount - 1);
  }
  return new ColumnsInfo(columns);
}

Fixed version (ground truth):
public static ColumnsInfo createTable(ITableContent table,int width){
  int tableWidth=getElementWidth(table,width);
  int columnCount=table.getColumnCount();
  if (columnCount == 0) {
    return null;
  }
  int[] columns=new int[columnCount];
  int unassignedCount=0;
  int totalAssigned=0;
  for (int i=0; i < columnCount; i++) {
    DimensionType value=table.getColumn(i).getWidth();
    if (value == null) {
      columns[i]=-1;
      unassignedCount++;
    }
 else {
      if (ExcelUtil.convertDimensionType(value,tableWidth) > 576000) {
        System.out.println("String_Node_Str");
      }
      columns[i]=ExcelUtil.convertDimensionType(value,tableWidth);
      totalAssigned+=columns[i];
    }
  }
  int leftWidth=tableWidth - totalAssigned;
  if (leftWidth != 0 && unassignedCount == 0) {
    int totalResized=0;
    for (int i=0; i < columnCount - 1; i++) {
      columns[i]=resize(columns[i],totalAssigned,leftWidth);
      totalResized+=columns[i];
    }
    columns[columnCount - 1]=tableWidth - totalResized;
  }
 else   if (leftWidth < 0 && unassignedCount > 0) {
    int totalResized=0;
    int lastAssignedIndex=0;
    for (int i=0; i < columnCount; i++) {
      if (columns[i] == -1) {
        columns[i]=0;
      }
 else {
        columns[i]=resize(columns[i],totalAssigned,leftWidth);
        lastAssignedIndex=i;
      }
      totalResized+=columns[i];
    }
    columns[lastAssignedIndex]+=tableWidth - totalResized;
  }
 else   if (leftWidth >= 0 && unassignedCount > 0) {
    int per=(int)leftWidth / unassignedCount;
    int index=0;
    for (int i=0; i < columns.length; i++) {
      if (columns[i] == -1) {
        columns[i]=per;
        index=i;
      }
    }
    columns[index]=leftWidth - per * (unassignedCount - 1);
  }
  return new ColumnsInfo(columns);
}