nus-yam/ex-repair huggingface dataset:
Program: 69453
Project: 69453
Buggy source:
public void performTransfer(){
  if (getModel() instanceof TemplateElementHandle) {
    try {
      ((TemplateReportItemHandle)getModel()).transformToReportItem((ReportItemHandle)copiedHandle);
    }
 catch (    SemanticException e) {
      SessionHandleAdapter.getInstance().getCommandStack().rollbackAll();
    }
 finally {
      copiedHandle=null;
    }
  }
}

Fixed version (ground truth):
public void performTransfer(){
  if (getModel() instanceof TemplateElementHandle) {
    try {
      ((TemplateReportItemHandle)getModel()).transformToReportItem((ReportItemHandle)copiedHandle);
      ProviderFactory.createProvider(copiedHandle).performRequest(copiedHandle,new Request(IRequestConstants.REQUST_REVERT_TO_REPORTITEM));
    }
 catch (    SemanticException e) {
      SessionHandleAdapter.getInstance().getCommandStack().rollbackAll();
    }
catch (    Exception e) {
      SessionHandleAdapter.getInstance().getCommandStack().rollbackAll();
    }
 finally {
      copiedHandle=null;
    }
  }
}
Program: 69454
Project: 69454
Buggy source:
/** 
 * Transfer background for current page to Doc format. Now, the exported file will apply the first background properties, and followed background will ignore. In addition, Since the Word only support fill-in background, the background attach, pos, posX, posY and repeat are not mapped to Word easyly. At present, ignore those properties.
 * @throws IOException
 * @TODO support background properties. attach, pos, posx, posy and repeat.
 */
protected void drawDocumentBackground() throws IOException {
  IStyle style=previousPage.getComputedStyle();
  String backgroundColor=style.getBackgroundColor();
  String backgroundImageUrl=EmitterUtil.getBackgroundImageUrl(style,reportContent.getDesign().getReportDesign(),reportContext.getAppContext());
  String height=style.getBackgroundHeight();
  String width=style.getBackgroundWidth();
  wordWriter.drawDocumentBackground(backgroundColor,backgroundImageUrl,height,width);
}

Fixed version (ground truth):
/** 
 * Transfer background for current page to Doc format. Now, the exported file will apply the first background properties, and followed background will ignore. In addition, Since the Word only support fill-in background, the background attach, pos, posX, posY and repeat are not mapped to Word easyly. At present, ignore those properties.
 * @throws IOException
 * @TODO support background properties. attach, pos, posx, posy and repeat.
 */
protected void drawDocumentBackground() throws IOException {
  IStyle style=previousPage.getStyle();
  String backgroundColor=style.getBackgroundColor();
  String backgroundImageUrl=EmitterUtil.getBackgroundImageUrl(style,reportContent.getDesign().getReportDesign(),reportContext.getAppContext());
  String height=style.getBackgroundHeight();
  String width=style.getBackgroundWidth();
  wordWriter.drawDocumentBackground(backgroundColor,backgroundImageUrl,height,width);
}
Program: 69455
Project: 69455
Buggy source:
private void writeHeaderFooter() throws IOException, BirtException {
  IStyle style=previousPage.getComputedStyle();
  String backgroundHeight=style.getBackgroundHeight();
  String backgroundWidth=style.getBackgroundWidth();
  if (previousPage.getPageHeader() != null || backgroundHeight != null || backgroundWidth != null) {
    SimpleMasterPageDesign master=(SimpleMasterPageDesign)previousPage.getGenerateBy();
    wordWriter.startHeader(!master.isShowHeaderOnFirst(),headerHeight,contentWidth);
    if (backgroundHeight != null || backgroundWidth != null) {
      String backgroundImageUrl=EmitterUtil.getBackgroundImageUrl(style,reportContent.getDesign().getReportDesign(),reportContext.getAppContext());
      wordWriter.drawDocumentBackgroundImage(backgroundImageUrl,backgroundHeight,backgroundWidth,WordUtil.twipToPt(topMargin),WordUtil.twipToPt(leftMargin),WordUtil.twipToPt(pageHeight),WordUtil.twipToPt(pageWidth));
    }
    contentVisitor.visitChildren(previousPage.getPageHeader(),null);
    wordWriter.endHeader();
  }
  if (previousPage.getPageFooter() != null) {
    wordWriter.startFooter(footerHeight,contentWidth);
    contentVisitor.visitChildren(previousPage.getPageFooter(),null);
    wordWriter.endFooter();
  }
}

Fixed version (ground truth):
private void writeHeaderFooter() throws IOException, BirtException {
  IStyle style=previousPage.getStyle();
  String backgroundHeight=style.getBackgroundHeight();
  String backgroundWidth=style.getBackgroundWidth();
  if (previousPage.getPageHeader() != null || backgroundHeight != null || backgroundWidth != null) {
    SimpleMasterPageDesign master=(SimpleMasterPageDesign)previousPage.getGenerateBy();
    wordWriter.startHeader(!master.isShowHeaderOnFirst(),headerHeight,contentWidth);
    if (backgroundHeight != null || backgroundWidth != null) {
      String backgroundImageUrl=EmitterUtil.getBackgroundImageUrl(style,reportContent.getDesign().getReportDesign(),reportContext.getAppContext());
      wordWriter.drawDocumentBackgroundImage(backgroundImageUrl,backgroundHeight,backgroundWidth,WordUtil.twipToPt(topMargin),WordUtil.twipToPt(leftMargin),WordUtil.twipToPt(pageHeight),WordUtil.twipToPt(pageWidth));
    }
    contentVisitor.visitChildren(previousPage.getPageHeader(),null);
    wordWriter.endHeader();
  }
  if (previousPage.getPageFooter() != null) {
    wordWriter.startFooter(footerHeight,contentWidth);
    contentVisitor.visitChildren(previousPage.getPageFooter(),null);
    wordWriter.endFooter();
  }
}
Program: 69456
Project: 69456
Buggy source:
public Object[] getElements(Object inputElement){
  if (inputElement == null)   return new Object[0];
  if (inputElement instanceof JointDataSetHandle) {
    JointDataSetHandle handle=(JointDataSetHandle)inputElement;
    List params=getSubDataSetParameters(handle,"String_Node_Str",0);
    return params.toArray();
  }
  if (!(inputElement instanceof PropertyHandle))   return new Object[0];
  Iterator iter=((PropertyHandle)inputElement).iterator();
  ArrayList params=new ArrayList(10);
  if (iter != null) {
    while (iter.hasNext()) {
      params.add(iter.next());
    }
  }
  refreshPositions();
  return params.toArray();
}

Fixed version (ground truth):
public Object[] getElements(Object inputElement){
  if (inputElement == null)   return new Object[0];
  if (inputElement instanceof JointDataSetHandle) {
    JointDataSetHandle handle=(JointDataSetHandle)inputElement;
    List params=getSubDataSetParameters(handle,"String_Node_Str",0);
    return params.toArray();
  }
  if (inputElement instanceof DerivedDataSetHandle) {
    List paramList=getDerivedDataSetParameters((DerivedDataSetHandle)inputElement,"String_Node_Str",0);
    return paramList.toArray();
  }
  if (!(inputElement instanceof PropertyHandle))   return new Object[0];
  Iterator iter=((PropertyHandle)inputElement).iterator();
  ArrayList params=new ArrayList(10);
  if (iter != null) {
    while (iter.hasNext()) {
      params.add(iter.next());
    }
  }
  refreshPositions();
  return params.toArray();
}
Program: 69459
Project: 69459
Buggy source:
/** 
 * Convert DimensionType to a pixel value.
 * @param d DimensionType value
 * @return pixel value
 */
public static int getDimensionPixelValue(DimensionType d,int dpi){
  if (d == null) {
    return 0;
  }
  try {
    String units=d.getUnits();
    if (EngineIRConstants.UNITS_PX.equals(units)) {
      return (int)d.getMeasure();
    }
 else     if (EngineIRConstants.UNITS_PT.equals(units) || EngineIRConstants.UNITS_CM.equals(units) || EngineIRConstants.UNITS_MM.equals(units)|| EngineIRConstants.UNITS_PC.equals(units)|| EngineIRConstants.UNITS_IN.equals(units)) {
      double point=d.convertTo(EngineIRConstants.UNITS_PT);
      if (dpi > 0) {
        return (int)(point / 72 * dpi);
      }
 else {
        return (int)(point / 72 * 96);
      }
    }
 else     if (EngineIRConstants.UNITS_PERCENTAGE.equals(units)) {
      return 0;
    }
  }
 catch (  Exception e) {
    return 0;
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * Convert DimensionType to a pixel value.
 * @param d DimensionType value
 * @return pixel value
 */
public static int getDimensionPixelValue(DimensionType d,int dpi){
  if (d == null) {
    return 0;
  }
  int valueType=d.getValueType();
  if (valueType == DimensionType.TYPE_DIMENSION) {
    String units=d.getUnits();
    if (EngineIRConstants.UNITS_PX.equals(units)) {
      return (int)d.getMeasure();
    }
 else     if (EngineIRConstants.UNITS_PT.equals(units) || EngineIRConstants.UNITS_CM.equals(units) || EngineIRConstants.UNITS_MM.equals(units)|| EngineIRConstants.UNITS_PC.equals(units)|| EngineIRConstants.UNITS_IN.equals(units)) {
      double point=d.convertTo(EngineIRConstants.UNITS_PT);
      if (dpi > 0) {
        return (int)(point / 72 * dpi);
      }
 else {
        return (int)(point / 72 * 96);
      }
    }
  }
 else   if (valueType == DimensionType.TYPE_CHOICE) {
    String choice=d.getChoice();
    if ("String_Node_Str".equalsIgnoreCase(choice)) {
      return 3;
    }
 else     if ("String_Node_Str".equalsIgnoreCase(choice)) {
      return 5;
    }
 else     if ("String_Node_Str".equalsIgnoreCase(choice)) {
      return 1;
    }
  }
  return 0;
}
Program: 69460
Project: 69460
Buggy source:
protected void addRepeatedItem() throws BirtException {
  if (repeatList != null && repeatList.size() > 0) {
    if (!inHeaderBand) {
      if (getRepeatedHeight() < getMaxAvaHeight()) {
        for (int i=0; i < repeatList.size(); i++) {
          ContainerArea row=(ContainerArea)repeatList.get(i);
          ContainerArea cloneRow=row.deepClone();
          if (i == 0 && cloneRow instanceof RowArea) {
            ((RowArea)cloneRow).needResolveBorder=true;
          }
          cloneRow.finished=true;
          children.add(i,cloneRow);
          cloneRow.setParent(this);
          update(cloneRow);
          cloneRow.setAllocatedY(currentBP);
        }
      }
 else {
        repeatList=null;
      }
    }
  }
}

Fixed version (ground truth):
protected void addRepeatedItem() throws BirtException {
  if (repeatList != null && repeatList.size() > 0) {
    if (!inHeaderBand) {
      if (getRepeatedHeight() < getMaxAvaHeight()) {
        for (int i=0; i < repeatList.size(); i++) {
          ContainerArea row=(ContainerArea)repeatList.get(i);
          ContainerArea cloneRow=row.deepClone();
          if (cloneRow instanceof RowArea) {
            ((RowArea)cloneRow).needResolveBorder=true;
          }
          cloneRow.finished=true;
          children.add(i,cloneRow);
          cloneRow.setParent(this);
          update(cloneRow);
          cloneRow.setAllocatedY(currentBP);
        }
      }
 else {
        repeatList=null;
      }
    }
  }
}
Program: 69461
Project: 69461
Buggy source:
protected void addCaption(String caption) throws BirtException {
  if (caption == null || "String_Node_Str".equals(caption)) {
    return;
  }
  ReportContent report=(ReportContent)content.getReportContent();
  ILabelContent captionLabel=report.createLabelContent();
  captionLabel.setText(caption);
  StyleDeclaration style=new StyleDeclaration(report.getCSSEngine());
  style.setProperty(IStyle.STYLE_TEXT_ALIGN,IStyle.CENTER_VALUE);
  captionLabel.setInlineStyle(style);
  RowArea captionRow=new RowArea(getColumnCount());
  captionRow.setParent(this);
  captionRow.setWidth(width);
  CellArea captionCell=new CellArea();
  captionCell.setColSpan(getColumnCount());
  captionCell.setWidth(width);
  captionCell.setMaxAvaWidth(width);
  captionRow.children.add(captionCell);
  ILayout layout=new BlockTextArea(captionCell,context,captionLabel);
  layout.layout();
  int h=((BlockContainerArea)layout).getAllocatedHeight();
  captionCell.setContentHeight(h);
  captionRow.setHeight(captionCell.getAllocatedHeight());
  add(captionRow);
  if (repeatList == null) {
    repeatList=new ArrayList();
  }
  repeatList.add(captionRow);
  update(captionRow);
}

Fixed version (ground truth):
protected void addCaption(String caption) throws BirtException {
  if (caption == null || "String_Node_Str".equals(caption)) {
    return;
  }
  ReportContent report=(ReportContent)content.getReportContent();
  IRowContent row=report.createRowContent();
  row.setParent(content);
  ICellContent cell=report.createCellContent();
  cell.setColSpan(getColumnCount());
  cell.setColumn(0);
  StyleDeclaration cstyle=new StyleDeclaration(report.getCSSEngine());
  cstyle.setProperty(IStyle.STYLE_BORDER_TOP_STYLE,IStyle.HIDDEN_VALUE);
  cstyle.setProperty(IStyle.STYLE_BORDER_LEFT_STYLE,IStyle.HIDDEN_VALUE);
  cstyle.setProperty(IStyle.STYLE_BORDER_RIGHT_STYLE,IStyle.HIDDEN_VALUE);
  cell.setInlineStyle(cstyle);
  cell.setParent(row);
  ILabelContent captionLabel=report.createLabelContent();
  captionLabel.setParent(cell);
  captionLabel.setText(caption);
  StyleDeclaration style=new StyleDeclaration(report.getCSSEngine());
  style.setProperty(IStyle.STYLE_TEXT_ALIGN,IStyle.CENTER_VALUE);
  captionLabel.setInlineStyle(style);
  RowArea captionRow=new RowArea(this,context,row);
  captionRow.setParent(this);
  captionRow.setWidth(width);
  captionRow.initialize();
  CellArea captionCell=new CellArea(captionRow,context,cell);
  captionCell.setWidth(width);
  captionCell.setMaxAvaWidth(width);
  captionCell.initialize();
  captionRow.children.add(captionCell);
  ILayout layout=new BlockTextArea(captionCell,context,captionLabel);
  layout.layout();
  int h=((BlockContainerArea)layout).getAllocatedHeight();
  captionCell.setContentHeight(h);
  captionRow.setHeight(captionCell.getAllocatedHeight());
  captionRow.finished=true;
  add(captionRow);
  if (repeatList == null) {
    repeatList=new ArrayList();
  }
  repeatList.add(captionRow);
  update(captionRow);
}
Program: 69462
Project: 69462
Buggy source:
public void testValidateBinding() throws Exception {
  checkDuplicateBindingName();
}

Fixed version (ground truth):
public void testValidateBinding() throws Exception {
  checkDuplicateBindingName();
  checkInexistentReference();
  checkReferenceCycle();
}
Program: 69463
Project: 69463
Buggy source:
/** 
 * @param defn
 * @param scope
 */
public PreparedCubeQuery(ICubeQueryDefinition defn,DataEngineSession session,DataEngineContext context,Map appContext) throws DataException {
  this.cubeQueryDefn=defn;
  this.session=session;
  this.context=context;
  this.appContext=appContext;
}

Fixed version (ground truth):
/** 
 * @param defn
 * @param scope
 */
public PreparedCubeQuery(ICubeQueryDefinition defn,DataEngineSession session,DataEngineContext context,Map appContext) throws DataException {
  this.cubeQueryDefn=defn;
  this.session=session;
  this.context=context;
  this.appContext=appContext;
  if (!containsDrillFilter(defn))   validateQuery();
}
Program: 69471
Project: 69471
Buggy source:
public void startRow(IRowContent row){
  if (!isHidden(row)) {
    rowFilledFlag=false;
    boolean isHeader=false;
    styles.push(row.getComputedStyle());
    if (row.getBand() != null && row.getBand().getBandType() == IBandContent.BAND_HEADER) {
      isHeader=true;
    }
    double height=WordUtil.convertTo(row.getHeight());
    wordWriter.startTableRow(height,isHeader,row.getTable().isHeaderRepeat(),fixedLayout);
    context.newRow();
  }
}

Fixed version (ground truth):
public void startRow(IRowContent row){
  if (!isHidden(row)) {
    writeBookmark(row);
    rowFilledFlag=false;
    boolean isHeader=false;
    styles.push(row.getComputedStyle());
    if (row.getBand() != null && row.getBand().getBandType() == IBandContent.BAND_HEADER) {
      isHeader=true;
    }
    double height=WordUtil.convertTo(row.getHeight());
    wordWriter.startTableRow(height,isHeader,row.getTable().isHeaderRepeat(),fixedLayout);
    context.newRow();
  }
}
Program: 69472
Project: 69472
Buggy source:
public void startCell(ICellContent cell){
  rowFilledFlag=true;
  context.startCell();
  int columnId=cell.getColumn();
  List<SpanInfo> spans=context.getSpans(columnId);
  if (spans != null) {
    for (int i=0; i < spans.size(); i++) {
      wordWriter.writeSpanCell(spans.get(i));
    }
  }
  int columnSpan=cell.getColSpan();
  int rowSpan=cell.getRowSpan();
  int cellWidth=context.getCellWidth(columnId,columnSpan);
  IStyle style=computeStyle(cell.getComputedStyle());
  if (rowSpan > 1) {
    context.addSpan(columnId,columnSpan,cellWidth,rowSpan,style);
  }
  SpanInfo info=null;
  if (columnSpan > 1 || rowSpan > 1) {
    info=new SpanInfo(columnId,columnSpan,cellWidth,true,style);
  }
  wordWriter.startTableCell(cellWidth,style,info);
  context.addWidth(getCellWidth(cellWidth,style));
  writeTableToc();
  if (cell.getDiagonalNumber() != 0 && cell.getDiagonalStyle() != null && !"String_Node_Str".equalsIgnoreCase(cell.getDiagonalStyle())) {
    drawDiagonalLine(cell,WordUtil.twipToPt(cellWidth));
  }
}

Fixed version (ground truth):
public void startCell(ICellContent cell){
  rowFilledFlag=true;
  context.startCell();
  writeBookmark(cell);
  int columnId=cell.getColumn();
  List<SpanInfo> spans=context.getSpans(columnId);
  if (spans != null) {
    for (int i=0; i < spans.size(); i++) {
      wordWriter.writeSpanCell(spans.get(i));
    }
  }
  int columnSpan=cell.getColSpan();
  int rowSpan=cell.getRowSpan();
  int cellWidth=context.getCellWidth(columnId,columnSpan);
  IStyle style=computeStyle(cell.getComputedStyle());
  if (rowSpan > 1) {
    context.addSpan(columnId,columnSpan,cellWidth,rowSpan,style);
  }
  SpanInfo info=null;
  if (columnSpan > 1 || rowSpan > 1) {
    info=new SpanInfo(columnId,columnSpan,cellWidth,true,style);
  }
  wordWriter.startTableCell(cellWidth,style,info);
  context.addWidth(getCellWidth(cellWidth,style));
  writeTableToc();
  if (cell.getDiagonalNumber() != 0 && cell.getDiagonalStyle() != null && !"String_Node_Str".equalsIgnoreCase(cell.getDiagonalStyle())) {
    drawDiagonalLine(cell,WordUtil.twipToPt(cellWidth));
  }
}
Program: 69473
Project: 69473
Buggy source:
public boolean performOk(){
  if (doSaveEmptyParameter(parameters)) {
    refreshPositions();
    if (this.modelChanged && this.getContainer() != null && this.getContainer() instanceof DataSetEditor) {
      this.modelChanged=false;
      ((DataSetHandle)getContainer().getModel()).removeListener(this);
      ((DataSetEditor)getContainer()).updateDataSetDesign(this);
    }
    return super.performOk();
  }
 else {
    String name=getNoneValuedParameterName();
    boolean confirm=MessageDialog.openConfirm(null,Messages.getString("String_Node_Str"),Messages.getFormattedString("String_Node_Str",new Object[]{name}));
    if (confirm)     ((DataSetEditor)getContainer()).updateDataSetDesign(this);
    return confirm;
  }
}

Fixed version (ground truth):
public boolean performOk(){
  DataSetHandle dataSetHandle=(DataSetHandle)getContainer().getModel();
  isOdaDataSetHandle=ParameterPageUtil.isOdaDataSetHandle(dataSetHandle);
  isJointOrDerivedDataSetHandle=ParameterPageUtil.isJointOrDerivedDataSetHandle(dataSetHandle);
  if (doSaveEmptyParameter(parameters)) {
    refreshPositions();
    if (this.modelChanged && this.getContainer() != null && this.getContainer() instanceof DataSetEditor) {
      this.modelChanged=false;
      ((DataSetHandle)getContainer().getModel()).removeListener(this);
      ((DataSetEditor)getContainer()).updateDataSetDesign(this);
    }
    return super.performOk();
  }
 else {
    String name=getNoneValuedParameterName();
    boolean confirm=MessageDialog.openConfirm(null,Messages.getString("String_Node_Str"),Messages.getFormattedString("String_Node_Str",new Object[]{name}));
    if (confirm)     ((DataSetEditor)getContainer()).updateDataSetDesign(this);
    return confirm;
  }
}
Program: 69474
Project: 69474
Buggy source:
public boolean canFinish(){
  try {
    if (m_designSession != null)     return isPageComplete() && m_designSession.getNewWizard().canFinish();
 else     return isPageComplete();
  }
 catch (  OdaException e) {
    return false;
  }
}

Fixed version (ground truth):
public boolean canFinish(){
  try {
    if (m_designSession != null)     return m_designSession.getNewWizard().canFinish();
 else     return isPageComplete();
  }
 catch (  OdaException e) {
    return false;
  }
}
Program: 69475
Project: 69475
Buggy source:
public void startTable(ITableContent table){
  ContainerSizeInfo sizeInfo=engine.getCurrentContainer().getSizeInfo();
  int width=sizeInfo.getWidth();
  int[] columns=LayoutUtil.createTable(table,LayoutUtil.getElementWidth(table,width));
  ColumnsInfo info=new ColumnsInfo(columns);
  String caption=table.getCaption();
  if (caption != null) {
    engine.addCaption(caption);
  }
  engine.addTable(table,info,sizeInfo);
}

Fixed version (ground truth):
public void startTable(ITableContent table){
  ContainerSizeInfo sizeInfo=engine.getCurrentContainer().getSizeInfo();
  int width=sizeInfo.getWidth();
  ColumnsInfo info=null;
  if (isAuto) {
    info=LayoutUtil.createTable(table,width);
  }
 else {
    int[] columns=LayoutUtil.createFixedTable(table,LayoutUtil.getElementWidth(table,width));
    info=new ColumnsInfo(columns);
  }
  if (info == null)   return;
  String caption=table.getCaption();
  if (caption != null) {
    engine.addCaption(caption);
  }
  engine.addTable(table,info,sizeInfo);
}
Program: 69476
Project: 69476
Buggy source:
/** 
 * It is not going to get the coordinate, but the colId relative to this coordinate. Gets the colId of the given coordinate point
 * @param value	 the coordinate point
 * @return the colId
 */
public int getColumnIndexByCoordinate(int value){
  int index=columnCoordinates.indexOf(value);
  return (index == -1) ? 0 : index;
}

Fixed version (ground truth):
/** 
 * It is not going to get the coordinate, but the colId relative to this coordinate. Gets the colId of the given coordinate point
 * @param value	 the coordinate point
 * @return the colId
 */
public int getColumnIndexByCoordinate(int value){
  int index=columnCoordinates.indexOf(value);
  return (index == -1) ? -1 : index;
}
Program: 69477
Project: 69477
Buggy source:
private int[] calculateColumnCoordinates(ColumnsInfo table,int startCoordinate,int endCoordinate){
  int columnCount=table.getColumnCount();
  int[] columnStartCoordinates=new int[columnCount + 1];
  columnStartCoordinates[0]=startCoordinate;
  for (int i=1; i <= columnCount; i++) {
    columnStartCoordinates[i]=columnStartCoordinates[i - 1] + table.getColumnWidth(i - 1);
  }
  return columnStartCoordinates;
}

Fixed version (ground truth):
private int[] calculateColumnCoordinates(ColumnsInfo table,int startCoordinate,int endCoordinate){
  int columnCount=table.getColumnCount();
  int[] columnStartCoordinates=new int[columnCount + 1];
  columnStartCoordinates[0]=startCoordinate;
  for (int i=1; i <= columnCount; i++) {
    if ((columnStartCoordinates[i - 1] + table.getColumnWidth(i - 1)) > endCoordinate) {
      columnStartCoordinates[i]=endCoordinate;
    }
 else     columnStartCoordinates[i]=columnStartCoordinates[i - 1] + table.getColumnWidth(i - 1);
  }
  return columnStartCoordinates;
}
Program: 69478
Project: 69478
Buggy source:
private void addData(SheetData data){
  XlsContainer container=getCurrentContainer();
  container.setEmpty(false);
  int col=axis.getColumnIndexByCoordinate(data.getSizeInfo().getStartCoordinate());
  int span=axis.getColumnIndexByCoordinate(data.getSizeInfo().getEndCoordinate()) - col;
  applyTopBorderStyle(data);
  outputDataIfBufferIsFull();
  updataRowIndex(data,container);
  addDatatoCache(col,data);
  for (int i=col + 1; i < col + span; i++) {
    BlankData blankData=new BlankData(data);
    addDatatoCache(i,blankData);
  }
  if (container instanceof XlsCell) {
    XlsCell cell=(XlsCell)container;
    data.setRowSpanInDesign(cell.getRowSpan() - 1);
  }
  lastData=data;
}

Fixed version (ground truth):
private void addData(SheetData data){
  XlsContainer container=getCurrentContainer();
  container.setEmpty(false);
  int col=axis.getColumnIndexByCoordinate(data.getSizeInfo().getStartCoordinate());
  if (col == -1 || col >= cache.getColumnCount())   return;
  int span=axis.getColumnIndexByCoordinate(data.getSizeInfo().getEndCoordinate()) - col;
  applyTopBorderStyle(data);
  outputDataIfBufferIsFull();
  updataRowIndex(data,container);
  addDatatoCache(col,data);
  for (int i=col + 1; i < col + span; i++) {
    BlankData blankData=new BlankData(data);
    addDatatoCache(i,blankData);
  }
  if (container instanceof XlsCell) {
    XlsCell cell=(XlsCell)container;
    data.setRowSpanInDesign(cell.getRowSpan() - 1);
  }
  lastData=data;
}
Program: 69479
Project: 69479
Buggy source:
public static int[] createTable(ITableContent table,int tableWidth){
  int columnCount=table.getColumnCount();
  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 {
      columns[i]=ExcelUtil.covertDimensionType(value,tableWidth);
      totalAssigned+=columns[i];
    }
  }
  if (table.getWidth() == null && unassignedCount == 0) {
    return columns;
  }
  return EmitterUtil.resizeTableColumn(tableWidth,columns,unassignedCount,totalAssigned);
}

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 {
      columns[i]=ExcelUtil.covertDimensionType(value,tableWidth);
      totalAssigned+=columns[i];
    }
  }
  int leftWidth=tableWidth - totalAssigned;
  if (leftWidth != 0 && unassignedCount == 0) {
    for (int i=0; i < columnCount; i++) {
      columns[i]=resize(columns[i],totalAssigned,leftWidth);
    }
  }
 else   if (leftWidth < 0 && unassignedCount > 0) {
    for (int i=0; i < columnCount; i++) {
      if (columns[i] == -1)       columns[1]=0;
 else       columns[i]=resize(columns[i],totalAssigned,leftWidth);
    }
  }
 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);
}
Program: 69480
Project: 69480
Buggy source:
/** 
 * Convert String without specified locale to java.util.Date Try to format the given String for JRE default Locale, if it fails, try to format the String for Locale.US 
 * @param source the String to be convert
 * @param locate the locate of the string
 * @return result Date
 */
private static Date toDate(String source) throws BirtException {
  try {
    return toDateISO8601(source,null);
  }
 catch (  BirtException e) {
    try {
      return toDate(source,JRE_DEFAULT_LOCALE);
    }
 catch (    BirtException use) {
      return toDate(source,DEFAULT_LOCALE);
    }
  }
}

Fixed version (ground truth):
/** 
 * Convert String without specified locale to java.util.Date Try to format the given String for JRE default Locale, if it fails, try to format the String for Locale.US 
 * @param source the String to be convert
 * @param locate the locate of the string
 * @return result Date
 */
private static Date toDate(String source) throws BirtException {
  try {
    return toDateISO8601(source,null);
  }
 catch (  BirtException e) {
    try {
      return toDate(source,JRE_DEFAULT_LOCALE);
    }
 catch (    BirtException use) {
      try {
        return toDate(source,DEFAULT_LOCALE);
      }
 catch (      BirtException de) {
        return toDateForSpecialFormat(source);
      }
    }
  }
}
Program: 69481
Project: 69481
Buggy source:
public void setTextIndent(ITextContent content){
  lineParent.setTextIndent(content);
}

Fixed version (ground truth):
public void setTextIndent(ITextContent content){
  int pi=lineParent.getCurrentIP();
  lineParent.setTextIndent(content);
  if (pi != lineParent.getCurrentIP()) {
    maxAvaWidth=parent.getCurrentMaxContentWidth();
  }
}
Program: 69482
Project: 69482
Buggy source:
/** 
 * @param severity
 * @param message
 * @return
 */
protected Status getMiscStatus(int severity,String message){
  return new Status(severity,PlatformUI.PLUGIN_ID,IStatus.OK,message,null);
}

Fixed version (ground truth):
/** 
 * @param severity
 * @param message
 * @return
 */
protected Status getMiscStatus(int severity,String message){
  return new Status(severity,PlatformUI.PLUGIN_ID,severity,message,null);
}
Program: 69483
Project: 69483
Buggy source:
public ExportDataSourceDialog(Shell parentShell,String title,DataSourceHandle selection){
  this(parentShell,title);
  this.dataSourceHandle=selection;
  this.fileName=this.dataSourceHandle.getQualifiedName();
}

Fixed version (ground truth):
public ExportDataSourceDialog(Shell parentShell,String title,DataSourceHandle selection){
  this(parentShell,title);
  this.dataSourceHandle=selection;
  initProfileName();
}
Program: 69484
Project: 69484
Buggy source:
protected void writeText(int type,String txt,IContent content,InlineFlag inlineFlag,IStyle computedStyle,IStyle inlineStyle){
  HyperlinkInfo hyper=getHyperlink(content);
  if (content instanceof TextContent) {
    TextFlag textFlag=TextFlag.START;
    String fontFamily=null;
    if ("String_Node_Str".equals(txt) || txt == null || WordUtil.isField(content)) {
      wordWriter.writeContent(type,txt,computedStyle,inlineStyle,fontFamily,hyper,inlineFlag,textFlag);
    }
 else {
      FontSplitter fontSplitter=getFontSplitter(content);
      while (fontSplitter.hasMore()) {
        Chunk ch=fontSplitter.getNext();
        int offset=ch.getOffset();
        int length=ch.getLength();
        fontFamily=getFontFamily(computedStyle,ch);
        wordWriter.writeContent(type,txt.substring(offset,offset + length),computedStyle,inlineStyle,fontFamily,hyper,inlineFlag,textFlag);
        textFlag=fontSplitter.hasMore() ? TextFlag.MIDDLE : TextFlag.END;
      }
    }
    if (inlineFlag == InlineFlag.BLOCK) {
      wordWriter.writeContent(type,null,computedStyle,inlineStyle,fontFamily,hyper,inlineFlag,TextFlag.END);
    }
  }
 else {
    wordWriter.writeContent(type,txt,computedStyle,inlineStyle,computedStyle.getFontFamily(),hyper,inlineFlag,TextFlag.WHOLE);
  }
}

Fixed version (ground truth):
protected void writeText(int type,String txt,IContent content,InlineFlag inlineFlag,IStyle computedStyle,IStyle inlineStyle){
  HyperlinkInfo hyper=getHyperlink(content);
  int paragraphWidth=(int)WordUtil.twipToPt(context.getCurrentWidth());
  if (content instanceof TextContent) {
    TextFlag textFlag=TextFlag.START;
    String fontFamily=null;
    if ("String_Node_Str".equals(txt) || txt == null || WordUtil.isField(content)) {
      wordWriter.writeContent(type,txt,computedStyle,inlineStyle,fontFamily,hyper,inlineFlag,textFlag,paragraphWidth);
    }
 else {
      FontSplitter fontSplitter=getFontSplitter(content);
      while (fontSplitter.hasMore()) {
        Chunk ch=fontSplitter.getNext();
        int offset=ch.getOffset();
        int length=ch.getLength();
        fontFamily=getFontFamily(computedStyle,ch);
        wordWriter.writeContent(type,txt.substring(offset,offset + length),computedStyle,inlineStyle,fontFamily,hyper,inlineFlag,textFlag,paragraphWidth);
        textFlag=fontSplitter.hasMore() ? TextFlag.MIDDLE : TextFlag.END;
      }
    }
    if (inlineFlag == InlineFlag.BLOCK) {
      wordWriter.writeContent(type,null,computedStyle,inlineStyle,fontFamily,hyper,inlineFlag,TextFlag.END,paragraphWidth);
    }
  }
 else {
    wordWriter.writeContent(type,txt,computedStyle,inlineStyle,computedStyle.getFontFamily(),hyper,inlineFlag,TextFlag.WHOLE,paragraphWidth);
  }
}
Program: 69485
Project: 69485
Buggy source:
void writeContent(int type,String txt,IStyle style,IStyle inlineStyle,String fontFamily,HyperlinkInfo info,InlineFlag inlineFlag,TextFlag flag);

Fixed version (ground truth):
void writeContent(int type,String txt,IStyle style,IStyle inlineStyle,String fontFamily,HyperlinkInfo info,InlineFlag inlineFlag,TextFlag flag,int paragraphWidth);
Program: 69486
Project: 69486
Buggy source:
public void writeText(int type,String txt,IStyle style,String fontFamily,HyperlinkInfo info,TextFlag flag){
  if (flag == TextFlag.START) {
    writeTextInParagraph(type,txt,style,fontFamily,info);
  }
 else   if (flag == TextFlag.END) {
    writer.closeTag("String_Node_Str");
  }
 else   if (flag == TextFlag.MIDDLE) {
    writeTextInRun(type,txt,style,fontFamily,info,false);
  }
 else {
    writeTextInParagraph(type,txt,style,fontFamily,info);
    writer.closeTag("String_Node_Str");
  }
}

Fixed version (ground truth):
public void writeText(int type,String txt,IStyle style,String fontFamily,HyperlinkInfo info,TextFlag flag,int paragraphWidth){
  if (flag == TextFlag.START) {
    writeTextInParagraph(type,txt,style,fontFamily,info,paragraphWidth);
  }
 else   if (flag == TextFlag.END) {
    writer.closeTag("String_Node_Str");
  }
 else   if (flag == TextFlag.MIDDLE) {
    writeTextInRun(type,txt,style,fontFamily,info,false,paragraphWidth);
  }
 else {
    writeTextInParagraph(type,txt,style,fontFamily,info,paragraphWidth);
    writer.closeTag("String_Node_Str");
  }
}
Program: 69487
Project: 69487
Buggy source:
public void writeTextInRun(int type,String txt,IStyle style,String fontFamily,HyperlinkInfo info,boolean isInline){
}

Fixed version (ground truth):
public void writeTextInRun(int type,String txt,IStyle style,String fontFamily,HyperlinkInfo info,boolean isInline,int paragraphWidth){
}
Program: 69488
Project: 69488
Buggy source:
private void writeTextInParagraph(int type,String txt,IStyle style,String fontFamily,HyperlinkInfo info){
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  CSSValue lineHeight=style.getProperty(StyleConstants.STYLE_LINE_HEIGHT);
  if (!"String_Node_Str".equalsIgnoreCase(lineHeight.getCssText())) {
    writeSpacing(lineHeight);
  }
  writeAlign(style.getTextAlign(),style.getDirection());
  writeBackgroundColor(style.getBackgroundColor());
  writeParagraphBorders(style);
  writer.closeTag("String_Node_Str");
  writeTextInRun(type,txt,style,fontFamily,info,false);
}

Fixed version (ground truth):
private void writeTextInParagraph(int type,String txt,IStyle style,String fontFamily,HyperlinkInfo info,int paragraphWidth){
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  CSSValue lineHeight=style.getProperty(StyleConstants.STYLE_LINE_HEIGHT);
  if (!"String_Node_Str".equalsIgnoreCase(lineHeight.getCssText())) {
    writeSpacing(lineHeight);
  }
  writeAlign(style.getTextAlign(),style.getDirection());
  writeBackgroundColor(style.getBackgroundColor());
  writeParagraphBorders(style);
  int indent=PropertyUtil.getDimensionValue(style.getProperty(StyleConstants.STYLE_TEXT_INDENT),paragraphWidth * 1000) / 1000 * 20;
  if (indent != 0) {
    writeIndent(indent);
  }
  writer.closeTag("String_Node_Str");
  writeTextInRun(type,txt,style,fontFamily,info,false,paragraphWidth);
}
Program: 69489
Project: 69489
Buggy source:
public void startParagraph(IStyle style,boolean isInline){
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writeSpacing((style.getProperty(StyleConstants.STYLE_MARGIN_TOP)),(style.getProperty(StyleConstants.STYLE_MARGIN_BOTTOM)));
  writeAlign(style.getTextAlign(),style.getDirection());
  if (!isInline) {
    writeBackgroundColor(style.getBackgroundColor());
    writeParagraphBorders(style);
  }
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
public void startParagraph(IStyle style,boolean isInline,int paragraphWidth){
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writeSpacing((style.getProperty(StyleConstants.STYLE_MARGIN_TOP)),(style.getProperty(StyleConstants.STYLE_MARGIN_BOTTOM)));
  writeAlign(style.getTextAlign(),style.getDirection());
  int indent=PropertyUtil.getDimensionValue(style.getProperty(StyleConstants.STYLE_TEXT_INDENT),paragraphWidth) / 1000 * 20;
  if (indent != 0) {
    writeIndent(indent);
  }
  if (!isInline) {
    writeBackgroundColor(style.getBackgroundColor());
    writeParagraphBorders(style);
  }
  writer.closeTag("String_Node_Str");
}
Program: 69490
Project: 69490
Buggy source:
public void writeContent(int type,String txt,IStyle style,IStyle inlineStyle,String fontFamily,HyperlinkInfo info,InlineFlag inlineFlag,TextFlag flag){
  if (inlineFlag == InlineFlag.BLOCK) {
    writeText(type,txt,style,fontFamily,info,flag);
  }
 else {
    boolean isInline=true;
    if (inlineFlag == InlineFlag.FIRST_INLINE && flag == TextFlag.START) {
      startParagraph(style,isInline);
    }
    if (inlineStyle != null)     writeTextInRun(type,txt,inlineStyle,fontFamily,info,isInline);
 else     writeTextInRun(type,txt,style,fontFamily,info,isInline);
  }
}

Fixed version (ground truth):
public void writeContent(int type,String txt,IStyle style,IStyle inlineStyle,String fontFamily,HyperlinkInfo info,InlineFlag inlineFlag,TextFlag flag,int paragraphWidth){
  if (inlineFlag == InlineFlag.BLOCK) {
    writeText(type,txt,style,fontFamily,info,flag,paragraphWidth);
  }
 else {
    boolean isInline=true;
    if (inlineFlag == InlineFlag.FIRST_INLINE && flag == TextFlag.START) {
      startParagraph(style,isInline,paragraphWidth);
    }
    if (inlineStyle != null)     writeTextInRun(type,txt,inlineStyle,fontFamily,info,isInline,paragraphWidth);
 else     writeTextInRun(type,txt,style,fontFamily,info,isInline,paragraphWidth);
  }
}
Program: 69491
Project: 69491
Buggy source:
/** 
 * check if it is a J2EE Dynamic Web Project
 */
protected boolean isValidProject(IProject fProject){
  return J2EEProjectUtilities.isDynamicWebProject(fProject);
}

Fixed version (ground truth):
/** 
 * check if it is a J2EE Dynamic Web Project
 */
protected boolean isValidProject(IProject fProject){
  return JavaEEProjectUtilities.isDynamicWebProject(fProject);
}
Program: 69492
Project: 69492
Buggy source:
/** 
 * Returns the web contents folder of the specified project
 * @param project the project which web contents path is needed
 * @return IPath of the web contents folder
 */
public static IPath getWebContentPath(IProject project){
  IPath path=null;
  if (project != null && J2EEProjectUtilities.isDynamicWebProject(project)) {
    IVirtualComponent component=ComponentCore.createComponent(project);
    path=component.getRootFolder().getWorkspaceRelativePath();
  }
  return path;
}

Fixed version (ground truth):
/** 
 * Returns the web contents folder of the specified project
 * @param project the project which web contents path is needed
 * @return IPath of the web contents folder
 */
public static IPath getWebContentPath(IProject project){
  IPath path=null;
  if (project != null && JavaEEProjectUtilities.isDynamicWebProject(project)) {
    IVirtualComponent component=ComponentCore.createComponent(project);
    path=component.getRootFolder().getWorkspaceRelativePath();
  }
  return path;
}
Program: 69493
Project: 69493
Buggy source:
/** 
 * Resets size of column.
 * @param start
 * @param end
 * @param value
 */
public void resizeColumn(int start,int end,int value){
  Object startColumn=getColumn(start);
  ColumnHandleAdapter startAdapt=HandleAdapterFactory.getInstance().getColumnHandleAdapter(startColumn);
  Object endColumn=getColumn(end);
  ColumnHandleAdapter endAdapt=HandleAdapterFactory.getInstance().getColumnHandleAdapter(endColumn);
  int startWidth=0;
  int endWidth=0;
  startWidth=TableUtil.caleVisualWidth(this,startColumn);
  try {
    getTableAdapter().transStar(RESIZE_COLUMN_TRANS_LABEL);
    startAdapt.setWidth(startWidth + value);
    getTableAdapter().transEnd();
  }
 catch (  SemanticException e) {
    ExceptionHandler.handle(e);
  }
}

Fixed version (ground truth):
/** 
 * Resets size of column.
 * @param start
 * @param end
 * @param value
 */
public void resizeColumn(int start,int end,int value,boolean isResetEnd){
  Object startColumn=getColumn(start);
  ColumnHandleAdapter startAdapt=HandleAdapterFactory.getInstance().getColumnHandleAdapter(startColumn);
  Object endColumn=getColumn(end);
  ColumnHandleAdapter endAdapt=HandleAdapterFactory.getInstance().getColumnHandleAdapter(endColumn);
  int startWidth=0;
  int endWidth=0;
  startWidth=TableUtil.caleVisualWidth(this,startColumn);
  endWidth=TableUtil.caleVisualWidth(this,endColumn);
  try {
    getTableAdapter().transStar(RESIZE_COLUMN_TRANS_LABEL);
    startAdapt.setWidth(startWidth + value);
    if (isResetEnd) {
      endAdapt.setWidth(endWidth - value);
    }
    getTableAdapter().transEnd();
  }
 catch (  SemanticException e) {
    ExceptionHandler.handle(e);
  }
}
Program: 69495
Project: 69495
Buggy source:
private void resizeColumn(int value,int start,int end){
  TableEditPart part=(TableEditPart)getSourceEditPart();
  if (start != end) {
    value=getTrueValue(value,start,end);
    part.resizeColumn(start,end,value);
  }
 else {
    Dimension dimension=getDragWidth(start,end);
    if (value < dimension.width) {
      value=dimension.width;
    }
    TableHandleAdapter adp=HandleAdapterFactory.getInstance().getTableHandleAdapter(part.getModel());
    Dimension dm=adp.calculateSize();
    dm.width+=value;
    dm.height=-1;
    try {
      adp.ajustSize(dm);
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
    }
  }
}

Fixed version (ground truth):
private void resizeColumn(int value,int start,int end){
  TableEditPart part=(TableEditPart)getSourceEditPart();
  if (start != end) {
    value=getTrueValue(value,start,end);
    part.resizeColumn(start,end,value,!isCtrlDown());
  }
 else {
    Dimension dimension=getDragWidth(start,end);
    if (value < dimension.width) {
      value=dimension.width;
    }
    TableHandleAdapter adp=HandleAdapterFactory.getInstance().getTableHandleAdapter(part.getModel());
    Dimension dm=adp.calculateSize();
    dm.width+=value;
    dm.height=-1;
    try {
      adp.ajustSize(dm);
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
    }
  }
}
Program: 69496
Project: 69496
Buggy source:
private void adjustOthersColumn(List exclusion){
  AbstractTableEditPart part=getAbstractTableEditPart();
  WorkingData data=getTableWorkingData();
  ColumnData[] datas=data.columnWidths;
  if (datas == null) {
    return;
  }
  for (int i=0; i < datas.length; i++) {
    if (exclusion.contains(Integer.valueOf(datas[i].columnNumber))) {
      continue;
    }
    ITableLayoutOwner.DimensionInfomation dim=part.getColumnWidth(datas[i].columnNumber);
    if (DesignChoiceConstants.UNITS_PERCENTAGE.equals(dim.getUnits())) {
      resizeFixColumn(0,datas[i].columnNumber,1);
    }
 else     if (dim.getUnits() == null || dim.getUnits().length() == 0) {
      resizeFixColumn(0,datas[i].columnNumber,1);
    }
  }
}

Fixed version (ground truth):
private void adjustOthersColumn(List exclusion){
  AbstractTableEditPart part=getAbstractTableEditPart();
  WorkingData data=getTableWorkingData();
  ColumnData[] datas=data.columnWidths;
  if (datas == null) {
    return;
  }
  for (int i=0; i < datas.length; i++) {
    if (exclusion.contains(Integer.valueOf(datas[i].columnNumber))) {
      continue;
    }
    ITableLayoutOwner.DimensionInfomation dim=part.getColumnWidth(datas[i].columnNumber);
    if (DesignChoiceConstants.UNITS_PERCENTAGE.equals(dim.getUnits())) {
      resizeFixColumn(0,datas[i].columnNumber,1);
    }
 else     if (dim.getUnits() == null || dim.getUnits().length() == 0) {
      resizeFixColumn(0,datas[i].columnNumber,datas[i].columnNumber);
    }
  }
}
Program: 69497
Project: 69497
Buggy source:
private void resizeFixColumn(int value,int start,int end){
  TableEditPart part=(TableEditPart)getSourceEditPart();
  value=getTrueValue(value,start,end);
  Object startColumn=part.getColumn(start);
  if (!(startColumn instanceof ColumnHandle)) {
    return;
  }
  int startWidth=0;
  int endWidth=0;
  startWidth=TableUtil.caleVisualWidth(part,startColumn);
  try {
    double width=converPixToDefaultUnit(startWidth + value);
    DimensionValue dimensionValue=new DimensionValue(width,getDefaultUnits());
    ((ColumnHandle)startColumn).getWidth().setValue(dimensionValue);
  }
 catch (  SemanticException e) {
    ExceptionHandler.handle(e);
  }
}

Fixed version (ground truth):
private void resizeFixColumn(int value,int start,int end){
  TableEditPart part=(TableEditPart)getSourceEditPart();
  value=getTrueValue(value,start,end);
  Object startColumn=part.getColumn(start);
  if (!(startColumn instanceof ColumnHandle)) {
    return;
  }
  Object endColumn=part.getColumn(end);
  if (!(endColumn instanceof ColumnHandle)) {
    return;
  }
  int startWidth=0;
  int endWidth=0;
  startWidth=TableUtil.caleVisualWidth(part,startColumn);
  endWidth=TableUtil.caleVisualWidth(part,endColumn);
  try {
    double width=converPixToDefaultUnit(startWidth + value);
    DimensionValue dimensionValue=new DimensionValue(width,getDefaultUnits());
    ((ColumnHandle)startColumn).getWidth().setValue(dimensionValue);
    width=converPixToDefaultUnit(endWidth - value);
    dimensionValue=new DimensionValue(width,getDefaultUnits());
    if (!isCtrlDown() && start != end) {
      ((ColumnHandle)endColumn).getWidth().setValue(dimensionValue);
    }
  }
 catch (  SemanticException e) {
    ExceptionHandler.handle(e);
  }
}
Program: 69498
Project: 69498
Buggy source:
protected Dimension getDragWidth(int start,int end){
  TableEditPart part=(TableEditPart)getSourceEditPart();
  Dimension retValue=new Dimension(part.getMinWidth(start) - getColumnWidth(start),Integer.MAX_VALUE);
  return retValue;
}

Fixed version (ground truth):
protected Dimension getDragWidth(int start,int end){
  TableEditPart part=(TableEditPart)getSourceEditPart();
  if (isCtrlDown()) {
    Dimension retValue=new Dimension(part.getMinWidth(start) - getColumnWidth(start),Integer.MAX_VALUE);
    return retValue;
  }
 else {
    if (getStart() == getEnd()) {
      return new Dimension(part.getMinWidth(getStart()) - getColumnWidth(getStart()),Integer.MAX_VALUE);
    }
    return new Dimension(part.getMinWidth(getStart()) - getColumnWidth(getStart()),getColumnWidth(getEnd()) - part.getMinWidth(getEnd()));
  }
}