Program: 76520
Project: 76520
Buggy source:
/** 
 * Adjust size of table layout.
 * @param size is all figure size
 * @throws SemanticException
 */
public void ajustSize(Dimension size) throws SemanticException {
  if (!(getModelAdaptHelper() instanceof ITableAdapterHelper)) {
    return;
  }
  ITableAdapterHelper tableHelper=(ITableAdapterHelper)getModelAdaptHelper();
  size=size.shrink(tableHelper.getInsets().getWidth(),tableHelper.getInsets().getHeight());
  int columnCount=getColumnCount();
  int samColumnWidth=0;
  for (int i=0; i < columnCount; i++) {
    if (i != columnCount - 1) {
      samColumnWidth=samColumnWidth + tableHelper.caleVisualWidth(i + 1);
    }
  }
  int lastColumnWidth=size.width - samColumnWidth;
  if (lastColumnWidth < tableHelper.getMinWidth(columnCount)) {
    lastColumnWidth=tableHelper.getMinWidth(columnCount);
    HandleAdapterFactory.getInstance().getColumnHandleAdapter(getColumn(columnCount)).setWidth(lastColumnWidth);
  }
 else   if (lastColumnWidth != tableHelper.caleVisualWidth(columnCount)) {
    HandleAdapterFactory.getInstance().getColumnHandleAdapter(getColumn(columnCount)).setWidth(lastColumnWidth);
  }
  int rowCount=getRowCount();
  int samRowHeight=0;
  for (int i=0; i < rowCount; i++) {
    if (i != rowCount - 1) {
      samRowHeight=samRowHeight + tableHelper.caleVisualHeight(i + 1);
    }
  }
  int lastRowHeight=size.height - samRowHeight;
  if (lastRowHeight < tableHelper.getMinHeight(rowCount)) {
    lastRowHeight=tableHelper.getMinHeight(rowCount);
    HandleAdapterFactory.getInstance().getRowHandleAdapter(getRow(rowCount)).setHeight(lastRowHeight);
  }
 else   if (lastRowHeight != tableHelper.caleVisualHeight(rowCount)) {
    HandleAdapterFactory.getInstance().getRowHandleAdapter(getRow(rowCount)).setHeight(lastRowHeight);
  }
  HandleAdapterFactory.getInstance().getRowHandleAdapter(getRow(rowCount)).setHeight(lastRowHeight);
  setSize(new Dimension(samColumnWidth + lastColumnWidth,samRowHeight + lastRowHeight).expand(tableHelper.getInsets().getWidth(),tableHelper.getInsets().getHeight()));
}

Fixed version (ground truth):
/** 
 * Adjust size of table layout.
 * @param size is all figure size
 * @throws SemanticException
 */
public void ajustSize(Dimension size) throws SemanticException {
  if (!(getModelAdaptHelper() instanceof ITableAdapterHelper)) {
    return;
  }
  ITableAdapterHelper tableHelper=(ITableAdapterHelper)getModelAdaptHelper();
  size=size.shrink(tableHelper.getInsets().getWidth(),tableHelper.getInsets().getHeight());
  int columnCount=getColumnCount();
  int samColumnWidth=0;
  for (int i=0; i < columnCount; i++) {
    if (i != columnCount - 1) {
      samColumnWidth=samColumnWidth + tableHelper.caleVisualWidth(i + 1);
    }
  }
  int lastColumnWidth=size.width - samColumnWidth;
  if (lastColumnWidth < tableHelper.getMinWidth(columnCount)) {
    lastColumnWidth=tableHelper.getMinWidth(columnCount);
    HandleAdapterFactory.getInstance().getColumnHandleAdapter(getColumn(columnCount)).setWidth(lastColumnWidth);
  }
 else   if (lastColumnWidth != tableHelper.caleVisualWidth(columnCount)) {
    HandleAdapterFactory.getInstance().getColumnHandleAdapter(getColumn(columnCount)).setWidth(lastColumnWidth);
  }
  int rowCount=getRowCount();
  int samRowHeight=0;
  for (int i=0; i < rowCount; i++) {
    if (i != rowCount - 1) {
      samRowHeight=samRowHeight + tableHelper.caleVisualHeight(i + 1);
    }
  }
  int lastRowHeight=size.height - samRowHeight;
  if (lastRowHeight < tableHelper.getMinHeight(rowCount)) {
    lastRowHeight=tableHelper.getMinHeight(rowCount);
    HandleAdapterFactory.getInstance().getRowHandleAdapter(getRow(rowCount)).setHeight(lastRowHeight);
  }
 else   if (lastRowHeight != tableHelper.caleVisualHeight(rowCount)) {
    HandleAdapterFactory.getInstance().getRowHandleAdapter(getRow(rowCount)).setHeight(lastRowHeight);
  }
  setSize(new Dimension(samColumnWidth + lastColumnWidth,samRowHeight + lastRowHeight).expand(tableHelper.getInsets().getWidth(),tableHelper.getInsets().getHeight()));
}