nus-yam/ex-repair huggingface dataset:
Program: 79245
Project: 79245
Buggy source:
public Image(IImageItemContent content){
  String imgUri=content.getUri();
  byte[] imgData=content.getData();
switch (content.getImageSource()) {
case ImageItemDesign.IMAGE_FILE:
    if (imgUri != null) {
      try {
        in=new BufferedInputStream(new FileInputStream(new File(imgUri)));
        this.id=imgUri;
        this.source=IImage.FILE_IMAGE;
      }
 catch (      FileNotFoundException e) {
        logger.log(Level.SEVERE,e.getMessage(),e);
      }
    }
  break;
case ImageItemDesign.IMAGE_NAME:
if (imgData != null) {
  this.data=imgData;
  this.in=new ByteArrayInputStream(this.data);
  this.source=IImage.DESIGN_IMAGE;
  this.id=imgUri;
}
break;
case ImageItemDesign.IMAGE_EXPRESSION:
if (imgData != null) {
this.data=imgData;
this.in=new ByteArrayInputStream(this.data);
this.source=IImage.CUSTOM_IMAGE;
}
break;
case ImageItemDesign.IMAGE_URI:
if (imgUri != null) {
this.id=imgUri;
this.source=IImage.URL_IMAGE;
}
break;
default :
assert(false);
}
}

Fixed version (ground truth):
public Image(IImageItemContent content){
  String imgUri=content.getUri();
  byte[] imgData=content.getData();
switch (content.getImageSource()) {
case ImageItemDesign.IMAGE_FILE:
    if (imgUri != null) {
      try {
        in=new BufferedInputStream(new FileInputStream(new File(imgUri)));
        this.id=imgUri;
        this.source=IImage.FILE_IMAGE;
      }
 catch (      FileNotFoundException e) {
        logger.log(Level.SEVERE,e.getMessage(),e);
      }
    }
  break;
case ImageItemDesign.IMAGE_NAME:
if (imgData != null) {
  this.in=new ByteArrayInputStream(imgData);
  this.data=imgData;
  this.source=IImage.DESIGN_IMAGE;
  this.id=imgUri;
}
break;
case ImageItemDesign.IMAGE_EXPRESSION:
if (imgData != null) {
this.in=new ByteArrayInputStream(imgData);
this.data=imgData;
this.source=IImage.CUSTOM_IMAGE;
}
break;
case ImageItemDesign.IMAGE_URI:
if (imgUri != null) {
this.id=imgUri;
this.source=IImage.URL_IMAGE;
}
break;
default :
assert(false);
}
}
Program: 79246
Project: 79246
Buggy source:
/** 
 * sets the task locale
 * @param locale the task locale
 */
public void setLocale(Locale locale){
  this.locale=locale;
}

Fixed version (ground truth):
/** 
 * sets the task locale
 * @param locale the task locale
 */
public void setLocale(Locale locale){
  this.locale=locale;
  executionContext.setLocale(locale);
}
Program: 79247
Project: 79247
Buggy source:
/** 
 * @param engine reference to the report engine
 * @param runnable the runnable report design reference
 */
public RunAndRenderTask(ReportEngine engine,IReportRunnable runnable){
  super(engine,runnable);
  executionContext.setRunnable(runnable);
  executionContext.setLocale(locale);
}

Fixed version (ground truth):
/** 
 * @param engine reference to the report engine
 * @param runnable the runnable report design reference
 */
public RunAndRenderTask(ReportEngine engine,IReportRunnable runnable){
  super(engine,runnable);
}
Program: 79248
Project: 79248
Buggy source:
/** 
 * @param engine
 * @param runnable
 */
public GetParameterDefinitionTask(ReportEngine engine,IReportRunnable runnable){
  super(engine,runnable);
}

Fixed version (ground truth):
/** 
 * @param engine reference to the report engine
 * @param runnable the runnable report design
 */
public GetParameterDefinitionTask(ReportEngine engine,IReportRunnable runnable){
  super(engine,runnable);
}
Program: 79249
Project: 79249
Buggy source:
public Collection getParameterDefns(boolean includeParameterGroups){
  Collection original=((ReportRunnable)runnable).getParameterDefns(includeParameterGroups);
  Iterator iter=original.iterator();
  params=new ArrayList();
  while (iter.hasNext()) {
    ParameterDefnBase paraBase=(ParameterDefnBase)iter.next();
    try {
      params.add(paraBase.clone());
    }
 catch (    CloneNotSupportedException e) {
      log.log(Level.SEVERE,e.getMessage(),e);
    }
  }
  if (params != null) {
    iter=params.iterator();
    while (iter.hasNext()) {
      IParameterDefnBase pBase=(IParameterDefnBase)iter.next();
      if (pBase instanceof ScalarParameterDefn) {
        ((ScalarParameterDefn)pBase).setReportDesign(runnable.getDesignHandle().getDesign());
        ((ScalarParameterDefn)pBase).setLocale(locale);
        ((ScalarParameterDefn)pBase).evaluateSelectionList();
      }
 else       if (pBase instanceof ParameterGroupDefn) {
        Iterator iter2=((ParameterGroupDefn)pBase).getContents().iterator();
        while (iter2.hasNext()) {
          IParameterDefnBase p=(IParameterDefnBase)iter2.next();
          if (p instanceof ScalarParameterDefn) {
            ((ScalarParameterDefn)p).setReportDesign(runnable.getDesignHandle().getDesign());
            ((ScalarParameterDefn)p).setLocale(locale);
            ((ScalarParameterDefn)pBase).evaluateSelectionList();
          }
        }
      }
    }
  }
  return params;
}

Fixed version (ground truth):
public Collection getParameterDefns(boolean includeParameterGroups){
  Collection original=((ReportRunnable)runnable).getParameterDefns(includeParameterGroups);
  Iterator iter=original.iterator();
  params=new ArrayList();
  while (iter.hasNext()) {
    ParameterDefnBase pBase=(ParameterDefnBase)iter.next();
    try {
      params.add(pBase.clone());
    }
 catch (    CloneNotSupportedException e) {
      log.log(Level.SEVERE,e.getMessage(),e);
    }
  }
  if (params != null) {
    iter=params.iterator();
    while (iter.hasNext()) {
      IParameterDefnBase pBase=(IParameterDefnBase)iter.next();
      if (pBase instanceof ScalarParameterDefn) {
        ((ScalarParameterDefn)pBase).setReportDesign(runnable.getDesignHandle().getDesign());
        ((ScalarParameterDefn)pBase).setLocale(locale);
        ((ScalarParameterDefn)pBase).evaluateSelectionList();
      }
 else       if (pBase instanceof ParameterGroupDefn) {
        Iterator iter2=((ParameterGroupDefn)pBase).getContents().iterator();
        while (iter2.hasNext()) {
          IParameterDefnBase p=(IParameterDefnBase)iter2.next();
          if (p instanceof ScalarParameterDefn) {
            ((ScalarParameterDefn)p).setReportDesign(runnable.getDesignHandle().getDesign());
            ((ScalarParameterDefn)p).setLocale(locale);
            ((ScalarParameterDefn)p).evaluateSelectionList();
          }
        }
      }
    }
  }
  return params;
}
Program: 79250
Project: 79250
Buggy source:
public String getHelpText(){
  String ret=reportDesign.getMessage(helpTextKey,(locale == null) ? Locale.getDefault() : locale);
  if (ret == null)   return helpText;
  return ret;
}

Fixed version (ground truth):
public String getHelpText(){
  if (helpTextKey == null)   return helpText;
  String ret=reportDesign.getMessage(helpTextKey,(locale == null) ? Locale.getDefault() : locale);
  if (ret == null || ret.length() == 0)   return helpText;
  return ret;
}
Program: 79251
Project: 79251
Buggy source:
public String getDisplayName(){
  String ret=reportDesign.getMessage(displayNameKey,(locale == null) ? Locale.getDefault() : locale);
  if (ret == null)   return displayName;
  return ret;
}

Fixed version (ground truth):
public String getDisplayName(){
  if (displayNameKey == null)   return displayName;
  String ret=reportDesign.getMessage(displayNameKey,(locale == null) ? Locale.getDefault() : locale);
  if (ret == null || ret.length() == 0)   return displayName;
  return ret;
}
Program: 79252
Project: 79252
Buggy source:
public String getLabel(){
  if (labelKey == null)   return label;
  String ret=design.getMessage(labelKey,(locale == null) ? Locale.getDefault() : locale);
  return (ret == null) ? label : ret;
}

Fixed version (ground truth):
public String getLabel(){
  if (labelKey == null)   return label;
  String ret=design.getMessage(labelKey,(locale == null) ? Locale.getDefault() : locale);
  return (ret == null || ret.length() == 0) ? label : ret;
}
Program: 79253
Project: 79253
Buggy source:
/** 
 * @param value
 */
public void setValue(String value,int type){
  try {
switch (type) {
case IScalarParameterDefn.TYPE_BOOLEAN:
      this.value=DataTypeUtil.toBoolean(value);
    break;
case IScalarParameterDefn.TYPE_DATE_TIME:
  this.value=DataTypeUtil.toDate(value);
break;
case IScalarParameterDefn.TYPE_DECIMAL:
this.value=DataTypeUtil.toBigDecimal(value);
break;
case IScalarParameterDefn.TYPE_FLOAT:
this.value=DataTypeUtil.toDouble(value);
break;
default :
this.value=value;
break;
}
}
 catch (BirtException e) {
log.log(Level.SEVERE,e.getLocalizedMessage(),e);
this.value=value;
}
}

Fixed version (ground truth):
/** 
 * set parameter choice value. The string value is in English locale, and needs to be parsed back into object value based on the data type. 
 * @param value the string value for the object
 * @param type the parameter data type
 */
public void setValue(String value,int type){
  try {
switch (type) {
case IScalarParameterDefn.TYPE_BOOLEAN:
      this.value=DataTypeUtil.toBoolean(value);
    break;
case IScalarParameterDefn.TYPE_DATE_TIME:
  this.value=DataTypeUtil.toDate(value);
break;
case IScalarParameterDefn.TYPE_DECIMAL:
this.value=DataTypeUtil.toBigDecimal(value);
break;
case IScalarParameterDefn.TYPE_FLOAT:
this.value=DataTypeUtil.toDouble(value);
break;
default :
this.value=value;
break;
}
}
 catch (BirtException e) {
log.log(Level.SEVERE,e.getLocalizedMessage(),e);
this.value=value;
}
}
Program: 79254
Project: 79254
Buggy source:
/** 
 * @param lableKey
 * @param label
 */
public void setLabel(String lableKey,String label){
  this.label=label;
  this.labelKey=lableKey;
}

Fixed version (ground truth):
/** 
 * @param lableKey the label key string
 * @param label the label string
 */
public void setLabel(String lableKey,String label){
  this.label=label;
  this.labelKey=lableKey;
}
Program: 79255
Project: 79255
Buggy source:
/** 
 * @param locale
 */
public void setLocale(Locale locale){
  this.locale=locale;
}

Fixed version (ground truth):
/** 
 * @param locale the locale
 */
public void setLocale(Locale locale){
  this.locale=locale;
}
Program: 79256
Project: 79256
Buggy source:
public ParameterSelectionChoice(ReportDesign design){
  this.design=design;
}

Fixed version (ground truth):
/** 
 * @param design the report design
 */
public ParameterSelectionChoice(ReportDesign design){
  this.design=design;
}
Program: 79257
Project: 79257
Buggy source:
public Image(IImageItemContent content){
  String imgUri=content.getUri();
  byte[] imgData=content.getData();
switch (content.getImageSource()) {
case ImageItemDesign.IMAGE_FILE:
    if (imgUri != null) {
      try {
        in=new BufferedInputStream(new FileInputStream(new File(imgUri)));
        this.id=imgUri;
        this.source=IImage.FILE_IMAGE;
      }
 catch (      FileNotFoundException e) {
        logger.log(Level.SEVERE,e.getMessage(),e);
      }
    }
  break;
case ImageItemDesign.IMAGE_NAME:
if (imgData != null) {
  this.in=new ByteArrayInputStream(this.data);
  this.data=imgData;
  this.source=IImage.DESIGN_IMAGE;
  this.id=imgUri;
}
break;
case ImageItemDesign.IMAGE_EXPRESSION:
if (imgData != null) {
this.in=new ByteArrayInputStream(this.data);
this.data=imgData;
this.source=IImage.CUSTOM_IMAGE;
}
break;
case ImageItemDesign.IMAGE_URI:
if (imgUri != null) {
this.id=imgUri;
this.source=IImage.URL_IMAGE;
}
break;
default :
assert(false);
}
}

Fixed version (ground truth):
public Image(IImageItemContent content){
  String imgUri=content.getUri();
  byte[] imgData=content.getData();
switch (content.getImageSource()) {
case ImageItemDesign.IMAGE_FILE:
    if (imgUri != null) {
      try {
        in=new BufferedInputStream(new FileInputStream(new File(imgUri)));
        this.id=imgUri;
        this.source=IImage.FILE_IMAGE;
      }
 catch (      FileNotFoundException e) {
        logger.log(Level.SEVERE,e.getMessage(),e);
      }
    }
  break;
case ImageItemDesign.IMAGE_NAME:
if (imgData != null) {
  this.data=imgData;
  this.in=new ByteArrayInputStream(this.data);
  this.source=IImage.DESIGN_IMAGE;
  this.id=imgUri;
}
break;
case ImageItemDesign.IMAGE_EXPRESSION:
if (imgData != null) {
this.data=imgData;
this.in=new ByteArrayInputStream(this.data);
this.source=IImage.CUSTOM_IMAGE;
}
break;
case ImageItemDesign.IMAGE_URI:
if (imgUri != null) {
this.id=imgUri;
this.source=IImage.URL_IMAGE;
}
break;
default :
assert(false);
}
}
Program: 79258
Project: 79258
Buggy source:
public void visitExtendedItem(ExtendedItemDesign item){
  ExtendedItemHandle handle=(ExtendedItemHandle)item.getHandle();
  String tagName=handle.getExtensionName();
  IReportItemQuery itemQuery=ExtensionManager.getInstance().createQueryItem(tagName);
  IBaseQueryDefinition[] queries=null;
  IBaseQueryDefinition parentQuery=getParentQuery();
  if (itemQuery != null) {
    try {
      itemQuery.setModelObject(handle);
      queries=itemQuery.getReportQueries(parentQuery);
    }
 catch (    BirtException ex) {
      logger.log(Level.WARNING,ex.getMessage(),ex);
    }
    if (queries != null) {
      item.setQueries(queries);
      for (int i=0; i < queries.length; i++) {
        if (queries[i] != null) {
          this.queries.add(queries[i]);
        }
      }
      if (queries.length > 0) {
        IBaseQueryDefinition query=queries[0];
        if (query != null) {
          item.setQuery(query);
          pushQuery(query);
          pushExpressions(query.getRowExpressions());
          handleReportItemExpressions(item);
          popExpressions();
          popQuery();
        }
      }
    }
  }
}

Fixed version (ground truth):
public void visitExtendedItem(ExtendedItemDesign item){
  ExtendedItemHandle handle=(ExtendedItemHandle)item.getHandle();
  String tagName=handle.getExtensionName();
  IReportItemQuery itemQuery=ExtensionManager.getInstance().createQueryItem(tagName);
  IBaseQueryDefinition[] queries=null;
  IBaseQueryDefinition parentQuery=getParentQuery();
  if (itemQuery != null) {
    try {
      itemQuery.setModelObject(handle);
      queries=itemQuery.getReportQueries(parentQuery);
    }
 catch (    BirtException ex) {
      logger.log(Level.WARNING,ex.getMessage(),ex);
    }
    if (queries != null) {
      item.setQueries(queries);
      for (int i=0; i < queries.length; i++) {
        if (queries[i] != null && queries[i] instanceof IQueryDefinition) {
          this.queries.add(queries[i]);
        }
      }
      if (queries.length > 0) {
        IBaseQueryDefinition query=queries[0];
        if (query != null) {
          item.setQuery(query);
          pushQuery(query);
          pushExpressions(query.getRowExpressions());
          handleReportItemExpressions(item);
          popExpressions();
          popQuery();
        }
      }
    }
  }
}
Program: 79259
Project: 79259
Buggy source:
/** 
 * Calculates and returns a list containing insert positions of copied cells.
 * @param originalPositions positions of to be replaced cells
 * @param originalRowSpans row spans of to be replaced cells
 * @param copiedRowSpans row spans of copied cells
 * @return a list containing insert positions of copied cells.
 */
protected static int[] getIndexToAdd(int[] originalPositions,int[] originalRowSpans,int[] copiedRowSpans){
  int[] retValue=new int[copiedRowSpans.length];
  int copiedRowCount=0;
  int originalRowCount=0;
  for (int i=0, j=-1; i < copiedRowSpans.length; i++) {
    int copiedRowSpan=copiedRowSpans[i];
    copiedRowCount+=copiedRowSpan;
    while (originalRowCount < copiedRowCount)     originalRowCount+=originalRowSpans[++j];
    retValue[i]=originalPositions[j];
  }
  return retValue;
}

Fixed version (ground truth):
/** 
 * Calculates and returns a list containing insert positions of copied cells.
 * @param originalPositions positions of to be replaced cells
 * @param originalRowSpans row spans of to be replaced cells
 * @param copiedRowSpans row spans of copied cells
 * @return a list containing insert positions of copied cells.
 */
private static int[] getIndexToAdd(int[] originalPositions,int[] originalRowSpans,int[] copiedRowSpans){
  int[] retValue=new int[copiedRowSpans.length];
  int copiedRowCount=0;
  int originalRowCount=0;
  for (int i=0, j=-1; i < copiedRowSpans.length; i++) {
    int copiedRowSpan=copiedRowSpans[i];
    copiedRowCount+=copiedRowSpan;
    while (originalRowCount < copiedRowCount)     originalRowCount+=originalRowSpans[++j];
    retValue[i]=originalPositions[j];
  }
  return retValue;
}
Program: 79260
Project: 79260
Buggy source:
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param columnIndex the column index
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
protected boolean canInsertAndPaste(int columnIndex){
  int columnCount=getColumnCount();
  if (columnIndex >= columnCount)   return true;
  int targetColumnIndex=columnIndex++;
  List originalCells=getCellsContextInfo(getCellsUnderColumn(targetColumnIndex));
  if (!isValidInsertAndPasteArea(originalCells))   return false;
  List cells=data.getCells();
  try {
    isSameLayout(cells,originalCells);
  }
 catch (  SemanticException e) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param columnIndex the column index
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
protected boolean canInsertAndPaste(int columnIndex){
  int columnCount=getColumnCount();
  int targetColumnIndex=columnIndex + 1;
  List originalCells=null;
  if (targetColumnIndex > columnCount) {
    originalCells=getCellsContextInfo(getCellsUnderColumn(1));
  }
 else {
    originalCells=getCellsContextInfo(getCellsUnderColumn(targetColumnIndex));
    if (!isValidInsertAndPasteArea(originalCells))     return false;
  }
  List cells=data.getCells();
  try {
    isSameLayout(cells,originalCells);
  }
 catch (  SemanticException e) {
    return false;
  }
  return true;
}
Program: 79261
Project: 79261
Buggy source:
/** 
 * Pastes the copied column <code>column</code> to the given <code>columnNumber</code> in the target element.
 * @param column the copied column
 * @param columnNumber the column number
 * @param isInsert <code>true</code> if this is an insert and paste action. Otherwise <code>false</code>.
 * @throws SemanticException if any error occurs during pasting a column header
 */
protected void pasteColumn(TableColumn column,int columnNumber,boolean isInsert) throws SemanticException {
  TableColumn targetColumn=null;
  SlotHandle columns=getColumns();
  if (columns.getCount() == 0 && column == null)   return;
  if (columns.getCount() == 0 && column != null) {
    addColumnHeader(column,columnNumber,isInsert);
    return;
  }
  targetColumn=ColumnHelper.findColumn(getDesign(),columns.getSlot(),columnNumber);
  replaceColumn(column,targetColumn.handle(getDesign()),columnNumber,isInsert);
}

Fixed version (ground truth):
/** 
 * Pastes the copied column <code>column</code> to the given <code>columnNumber</code> in the target element.
 * @param column the copied column
 * @param columnNumber the column number
 * @param isInsert <code>true</code> if this is an insert and paste action. Otherwise <code>false</code>.
 * @throws SemanticException if any error occurs during pasting a column header
 */
protected void pasteColumn(TableColumn column,int columnNumber,boolean isInsert) throws SemanticException {
  TableColumn targetColumn=null;
  SlotHandle columns=getColumns();
  if (columns.getCount() == 0 && column == null)   return;
  if (columns.getCount() == 0 && column != null) {
    addColumnHeader(column,columnNumber,isInsert);
    return;
  }
  if (isInsert && columnNumber == 0) {
    columns.add(column.handle(getDesign()),0);
    return;
  }
  targetColumn=ColumnHelper.findColumn(getDesign(),columns.getSlot(),columnNumber);
  replaceColumn(column,targetColumn.handle(getDesign()),columnNumber,isInsert);
}
Program: 79262
Project: 79262
Buggy source:
/** 
 * Checks whether the insert and paste operation can be done with the given copied column band data, the column index and the operation flag. This is different from <code>canPasteColumn</code> since this action creates an extra column for the table.
 * @param data the column band data to paste
 * @param columnIndex the column index
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
public boolean canInsertAndPasteColumn(ColumnBandData data,int columnIndex){
  if (data == null)   throw new IllegalArgumentException("String_Node_Str");
  GridColumnBandAdapter adapter=new GridColumnBandAdapter(data);
  return adapter.canInsertAndPaste(this,columnIndex);
}

Fixed version (ground truth):
/** 
 * Checks whether the insert and paste operation can be done with the given copied column band data, the column index and the operation flag. This is different from <code>canPasteColumn</code> since this action creates an extra column for the table.
 * @param data the column band data to paste
 * @param columnIndex the column index from 0 to the number of columns in the grid
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
public boolean canInsertAndPasteColumn(ColumnBandData data,int columnIndex){
  if (data == null)   throw new IllegalArgumentException("String_Node_Str");
  GridColumnBandAdapter adapter=new GridColumnBandAdapter(data);
  return adapter.canInsertAndPaste(this,columnIndex);
}
Program: 79263
Project: 79263
Buggy source:
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param data the column band data to paste
 * @param columnIndex the column index
 * @param inForce <code>true</code> indicates to paste the column regardless of the different layout of cells. <code>false</code> indicates not.
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
public boolean canPasteColumn(ColumnBandData data,int columnIndex,boolean inForce){
  if (data == null)   throw new IllegalArgumentException("String_Node_Str");
  GridColumnBandAdapter adapter=new GridColumnBandAdapter(data);
  return adapter.canPaste(this,columnIndex,inForce);
}

Fixed version (ground truth):
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param data the column band data to paste
 * @param columnIndex the column index from 1 to the number of columns in the grid
 * @param inForce <code>true</code> indicates to paste the column regardless of the different layout of cells. <code>false</code> indicates not.
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
public boolean canPasteColumn(ColumnBandData data,int columnIndex,boolean inForce){
  if (data == null)   throw new IllegalArgumentException("String_Node_Str");
  GridColumnBandAdapter adapter=new GridColumnBandAdapter(data);
  return adapter.canPaste(this,columnIndex,inForce);
}
Program: 79264
Project: 79264
Buggy source:
/** 
 * Pastes a column with its cells to the given column number.
 * @param data the data of a column band to paste
 * @param columnNumber the column number
 * @param inForce <code>true</code> if pastes the column regardless of the warning. Otherwise <code>false</code>.
 * @throws SemanticException
 */
public void pasteColumn(ColumnBandData data,int columnNumber,boolean inForce) throws SemanticException {
  if (data == null)   throw new IllegalArgumentException("String_Node_Str");
  GridColumnBandAdapter adapter=new GridColumnBandAdapter(data);
  adapter.pasteColumnBand(this,columnNumber,inForce);
}

Fixed version (ground truth):
/** 
 * Pastes a column with its cells to the given column number.
 * @param data the data of a column band to paste
 * @param columnNumber the column index from 1 to the number of columns in the grid
 * @param inForce <code>true</code> if pastes the column regardless of the warning. Otherwise <code>false</code>.
 * @throws SemanticException
 */
public void pasteColumn(ColumnBandData data,int columnNumber,boolean inForce) throws SemanticException {
  if (data == null)   throw new IllegalArgumentException("String_Node_Str");
  GridColumnBandAdapter adapter=new GridColumnBandAdapter(data);
  adapter.pasteColumnBand(this,columnNumber,inForce);
}
Program: 79265
Project: 79265
Buggy source:
/** 
 * Inserts and pastes a column with its cells to the given column number.
 * @param data the data of a column band to paste
 * @param columnNumber the column number
 * @throws SemanticException
 */
public void insertAndPasteColumn(ColumnBandData data,int columnNumber) throws SemanticException {
  if (data == null)   throw new IllegalArgumentException("String_Node_Str");
  GridColumnBandAdapter adapter=new GridColumnBandAdapter(data);
  adapter.insertAndPasteColumnBand(this,columnNumber);
}

Fixed version (ground truth):
/** 
 * Inserts and pastes a column with its cells to the given column number.
 * @param data the data of a column band to paste
 * @param columnIndex the column index from 0 to the number of columns in the grid
 * @throws SemanticException
 */
public void insertAndPasteColumn(ColumnBandData data,int columnIndex) throws SemanticException {
  if (data == null)   throw new IllegalArgumentException("String_Node_Str");
  GridColumnBandAdapter adapter=new GridColumnBandAdapter(data);
  adapter.insertAndPasteColumnBand(this,columnIndex);
}
Program: 79266
Project: 79266
Buggy source:
/** 
 * Pastes a column with its cells to the given column number.
 * @param data the data of a column band to paste
 * @param columnNumber the column number
 * @param inForce <code>true</code> if pastes the column regardless of the warning. Otherwise <code>false</code>.
 * @throws SemanticException
 */
public void pasteColumn(ColumnBandData data,int columnNumber,boolean inForce) throws SemanticException {
  if (data == null)   throw new IllegalArgumentException("String_Node_Str");
  TableColumnBandAdapter adapter=new TableColumnBandAdapter(data);
  adapter.pasteColumnBand(this,columnNumber,inForce);
}

Fixed version (ground truth):
/** 
 * Pastes a column with its cells to the given column number.
 * @param data the data of a column band to paste
 * @param columnNumber the column index from 1 to the number of columns in the table
 * @param inForce <code>true</code> if pastes the column regardless of the warning. Otherwise <code>false</code>.
 * @throws SemanticException
 */
public void pasteColumn(ColumnBandData data,int columnNumber,boolean inForce) throws SemanticException {
  if (data == null)   throw new IllegalArgumentException("String_Node_Str");
  TableColumnBandAdapter adapter=new TableColumnBandAdapter(data);
  adapter.pasteColumnBand(this,columnNumber,inForce);
}
Program: 79267
Project: 79267
Buggy source:
/** 
 * Checks whether the insert and paste operation can be done with the given copied column band data, the column index and the operation flag. This is different from <code>canPasteColumn</code> since this action creates an extra column for the table.
 * @param data the column band data to paste
 * @param columnIndex the column index
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
public boolean canInsertAndPasteColumn(ColumnBandData data,int columnIndex){
  if (data == null)   throw new IllegalArgumentException("String_Node_Str");
  TableColumnBandAdapter adapter=new TableColumnBandAdapter(data);
  return adapter.canInsertAndPaste(this,columnIndex);
}

Fixed version (ground truth):
/** 
 * Checks whether the insert and paste operation can be done with the given copied column band data, the column index and the operation flag. This is different from <code>canPasteColumn</code> since this action creates an extra column for the table.
 * @param data the column band data to paste
 * @param columnIndex the column index from 0 to the number of columns in the table
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
public boolean canInsertAndPasteColumn(ColumnBandData data,int columnIndex){
  if (data == null)   throw new IllegalArgumentException("String_Node_Str");
  TableColumnBandAdapter adapter=new TableColumnBandAdapter(data);
  return adapter.canInsertAndPaste(this,columnIndex);
}
Program: 79268
Project: 79268
Buggy source:
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param data the column band data to paste
 * @param columnIndex the column index
 * @param inForce <code>true</code> indicates to paste the column regardless of the different layout of cells. <code>false</code> indicates not.
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
public boolean canPasteColumn(ColumnBandData data,int columnIndex,boolean inForce){
  if (data == null)   throw new IllegalArgumentException("String_Node_Str");
  TableColumnBandAdapter adapter=new TableColumnBandAdapter(data);
  return adapter.canPaste(this,columnIndex,inForce);
}

Fixed version (ground truth):
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param data the column band data to paste
 * @param columnIndex the column index from 1 to the number of columns in the table
 * @param inForce <code>true</code> indicates to paste the column regardless of the different layout of cells. <code>false</code> indicates not.
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
public boolean canPasteColumn(ColumnBandData data,int columnIndex,boolean inForce){
  if (data == null)   throw new IllegalArgumentException("String_Node_Str");
  TableColumnBandAdapter adapter=new TableColumnBandAdapter(data);
  return adapter.canPaste(this,columnIndex,inForce);
}
Program: 79269
Project: 79269
Buggy source:
/** 
 * Inserts and pastes a column with its cells to the given column number.
 * @param data the data of a column band to paste
 * @param columnNumber the column number
 * @throws SemanticException
 */
public void insertAndPasteColumn(ColumnBandData data,int columnNumber) throws SemanticException {
  if (data == null)   throw new IllegalArgumentException("String_Node_Str");
  TableColumnBandAdapter adapter=new TableColumnBandAdapter(data);
  adapter.insertAndPasteColumnBand(this,columnNumber);
}

Fixed version (ground truth):
/** 
 * Inserts and pastes a column with its cells to the given column number.
 * @param data the data of a column band to paste
 * @param columnNumber the column index from 0 to the number of columns in the table
 * @throws SemanticException
 */
public void insertAndPasteColumn(ColumnBandData data,int columnNumber) throws SemanticException {
  if (data == null)   throw new IllegalArgumentException("String_Node_Str");
  TableColumnBandAdapter adapter=new TableColumnBandAdapter(data);
  adapter.insertAndPasteColumnBand(this,columnNumber);
}
Program: 79270
Project: 79270
Buggy source:
/** 
 * Checks whether there is any cell that has "drop" property.
 * @param element a grid or table element
 * @return <code>true</code> if any cell has the "drop" property,otherwise <code>false</code>.
 */
private boolean hasDroppingCell(DesignElement element){
  if (element instanceof GridItem)   return false;
  ContainerSlot groups=element.getSlot(ListingElement.GROUP_SLOT);
  int groupCount=groups.getCount();
  for (int groupIndex=0; groupIndex < groupCount; groupIndex++) {
    TableGroup group=(TableGroup)groups.getContent(groupIndex);
    ContainerSlot header=group.getSlot(TableGroup.HEADER_SLOT);
    TableRow row=(TableRow)header.getContent(header.getCount() - 1);
    ContainerSlot cells=row.getSlot(TableRow.CONTENT_SLOT);
    for (int cellIndex=0; cellIndex < cells.getCount(); cellIndex++) {
      Cell cell=(Cell)cells.getContent(cellIndex);
      String drop=(String)cell.getLocalProperty(null,Cell.DROP_PROP);
      if (DesignChoiceConstants.DROP_TYPE_ALL.equalsIgnoreCase(drop) || DesignChoiceConstants.DROP_TYPE_DETAIL.equalsIgnoreCase(drop))       return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks whether there is any cell that has "drop" property.
 * @param element a grid or table element
 * @return <code>true</code> if any cell has the "drop" property,otherwise <code>false</code>.
 */
private boolean hasDroppingCell(DesignElement element){
  if (element instanceof GridItem)   return false;
  ContainerSlot groups=element.getSlot(ListingElement.GROUP_SLOT);
  int groupCount=groups.getCount();
  for (int groupIndex=0; groupIndex < groupCount; groupIndex++) {
    TableGroup group=(TableGroup)groups.getContent(groupIndex);
    ContainerSlot header=group.getSlot(TableGroup.HEADER_SLOT);
    if (header.getCount() <= 0)     continue;
    TableRow row=(TableRow)header.getContent(header.getCount() - 1);
    ContainerSlot cells=row.getSlot(TableRow.CONTENT_SLOT);
    for (int cellIndex=0; cellIndex < cells.getCount(); cellIndex++) {
      Cell cell=(Cell)cells.getContent(cellIndex);
      String drop=(String)cell.getLocalProperty(null,Cell.DROP_PROP);
      if (DesignChoiceConstants.DROP_TYPE_ALL.equalsIgnoreCase(drop) || DesignChoiceConstants.DROP_TYPE_DETAIL.equalsIgnoreCase(drop))       return true;
    }
  }
  return false;
}
Program: 79271
Project: 79271
Buggy source:
public RowSet(DteResultSet rset){
  this.rset=rset;
  try {
    metaData=new RowMetaData(rset.getQr().getResultMetaData());
  }
 catch (  BirtException ex) {
  }
}

Fixed version (ground truth):
public RowSet(DteResultSet rset){
  closed=false;
  this.rset=rset;
  try {
    metaData=new RowMetaData(rset.getQr().getResultMetaData());
  }
 catch (  BirtException ex) {
  }
}
Program: 79272
Project: 79272
Buggy source:
public void close(){
  rset.close();
}

Fixed version (ground truth):
public void close(){
  if (closed == false) {
    closed=true;
    rset.close();
  }
}
Program: 79273
Project: 79273
Buggy source:
public IReportItemQuery createQueryItem(String itemType){
  IConfigurationElement config=(IConfigurationElement)queryExtensions.get(itemType);
  if (config != null) {
    Object object=createObject(config,"String_Node_Str");
    if (object instanceof IReportItemPresentation) {
      return (IReportItemQuery)object;
    }
  }
  return null;
}

Fixed version (ground truth):
public IReportItemQuery createQueryItem(String itemType){
  IConfigurationElement config=(IConfigurationElement)queryExtensions.get(itemType);
  if (config != null) {
    Object object=createObject(config,"String_Node_Str");
    if (object instanceof IReportItemQuery) {
      return (IReportItemQuery)object;
    }
  }
  return null;
}
Program: 79274
Project: 79274
Buggy source:
WrappedDriver(Driver d){
  this.driver=d;
}

Fixed version (ground truth):
WrappedDriver(Driver d,String driverClass){
  logger.entering(WrappedDriver.class.getName(),"String_Node_Str",driverClass);
  this.driver=d;
  this.driverClass=driverClass;
}
Program: 79275
Project: 79275
Buggy source:
/** 
 * Search driver in the "drivers" directory and load it if found
 * @param className
 * @return
 * @throws DriverException
 * @throws OdaException
 */
private Class loadExtraDriver(String className){
  if (extraDriverLoader == null)   extraDriverLoader=new DriverClassLoader();
  try {
    return extraDriverLoader.loadClass(className);
  }
 catch (  ClassNotFoundException e) {
    if (!extraDriverLoader.refreshURLs()) {
      return null;
    }
    try {
      return extraDriverLoader.loadClass(className);
    }
 catch (    ClassNotFoundException e1) {
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Search driver in the "drivers" directory and load it if found
 * @param className
 * @return
 * @throws DriverException
 * @throws OdaException
 */
private Class loadExtraDriver(String className,boolean refreshUrlsWhenFail){
}
Program: 79276
Project: 79276
Buggy source:
public DriverClassLoader(){
  super(new URL[0],DriverClassLoader.class.getClassLoader());
  getDriverHomeDir();
  refreshURLs();
}

Fixed version (ground truth):
public DriverClassLoader(){
  super(new URL[0],DriverClassLoader.class.getClassLoader());
  logger.entering(DriverClassLoader.class.getName(),"String_Node_Str");
  getDriverHomeDir();
  refreshURLs();
}
Program: 79277
Project: 79277
Buggy source:
public boolean acceptsURL(String u) throws SQLException {
  return this.driver.acceptsURL(u);
}

Fixed version (ground truth):
public boolean acceptsURL(String u) throws SQLException {
  boolean res=this.driver.acceptsURL(u);
  if (logger.isLoggable(Level.FINER))   logger.log(Level.FINER,"String_Node_Str" + driverClass + "String_Node_Str"+ u+ "String_Node_Str"+ res);
  return res;
}
Program: 79278
Project: 79278
Buggy source:
/** 
 * Refresh the URL list of DriverClassLoader
 * @return if the refreshURL is different than the former one then return true otherwisereturn false
 */
public boolean refreshURLs(){
  String[] newJARFiles=getNewJARFiles();
  if (newJARFiles == null || newJARFiles.length == 0)   return false;
  for (int i=0; i < newJARFiles.length; i++) {
    addURL(constructURL(newJARFiles[i]));
    fileNameList.add(newJARFiles[i]);
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Refresh the URL list of DriverClassLoader
 * @return if the refreshURL is different than the former one then return true otherwisereturn false
 */
public boolean refreshURLs(){
  String[] newJARFiles=getNewJARFiles();
  if (newJARFiles == null || newJARFiles.length == 0)   return false;
  for (int i=0; i < newJARFiles.length; i++) {
    URL fileUrl=constructURL(newJARFiles[i]);
    addURL(fileUrl);
    fileNameList.add(newJARFiles[i]);
    logger.info("String_Node_Str" + newJARFiles[i] + "String_Node_Str"+ fileUrl);
  }
  return true;
}
Program: 79279
Project: 79279
Buggy source:
/** 
 * Gets a JDBC connection 
 * @param driverClass Class name of JDBC driver
 * @param url Connection URL
 * @param user connection user name
 * @param password connection password
 * @return new JDBC connection
 * @throws SQLException
 */
public Connection getConnection(String driverClass,String url,String user,String password) throws SQLException, ClassNotFoundException {
  loadAndRegisterDriver(driverClass);
  return DriverManager.getConnection(url,user,password);
}

Fixed version (ground truth):
/** 
 * Gets a JDBC connection 
 * @param driverClass Class name of JDBC driver
 * @param url Connection URL
 * @param user connection user name
 * @param password connection password
 * @return new JDBC connection
 * @throws SQLException
 */
public Connection getConnection(String driverClass,String url,String user,String password) throws SQLException, ClassNotFoundException {
  if (url == null)   throw new NullPointerException("String_Node_Str");
  if (logger.isLoggable(Level.FINE))   logger.fine("String_Node_Str" + (driverClass == null ? "String_Node_Str" : driverClass) + "String_Node_Str"+ url+ "String_Node_Str"+ ((user == null) ? "String_Node_Str" : user));
  loadAndRegisterDriver(driverClass);
  return DriverManager.getConnection(url,user,password);
}
Program: 79280
Project: 79280
Buggy source:
private boolean loadAndRegisterDriver(String className) throws ClassNotFoundException {
  if (className == null || className.length() == 0)   return false;
  Class driverClass=null;
  if (!registeredDrivers.contains(className)) {
    try {
      driverClass=Class.forName(className);
    }
 catch (    ClassNotFoundException e) {
      driverClass=loadExtraDriver(className);
      if (driverClass == null)       return false;
    }
    Driver driver=null;
    try {
      driver=(Driver)driverClass.newInstance();
    }
 catch (    IllegalAccessException e) {
      return false;
    }
catch (    InstantiationException e) {
      return false;
    }
    try {
      DriverManager.registerDriver(new WrappedDriver(driver));
    }
 catch (    SQLException e) {
    }
    registeredDrivers.add(className);
  }
  return true;
}

Fixed version (ground truth):
private boolean loadAndRegisterDriver(String className) throws ClassNotFoundException {
  if (className == null || className.length() == 0)   return false;
  Class driverClass=null;
  if (registeredDrivers.contains(className))   return true;
  if (logger.isLoggable(Level.INFO)) {
    logger.info("String_Node_Str" + className);
  }
  boolean driverInClassPath=false;
  try {
    driverClass=Class.forName(className);
    logger.info("String_Node_Str" + className);
    driverInClassPath=true;
  }
 catch (  ClassNotFoundException e) {
    if (logger.isLoggable(Level.FINE)) {
      logger.info("String_Node_Str" + className + "String_Node_Str");
    }
    driverClass=loadExtraDriver(className,true);
    if (driverClass == null) {
      logger.warning("String_Node_Str" + className);
      return false;
    }
  }
  if (!driverInClassPath) {
    Driver driver=null;
    try {
      driver=(Driver)driverClass.newInstance();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,"String_Node_Str" + className,e);
      return false;
    }
    try {
      if (logger.isLoggable(Level.FINER))       logger.finer("String_Node_Str" + className);
      DriverManager.registerDriver(new WrappedDriver(driver,className));
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,"String_Node_Str",e);
    }
  }
  registeredDrivers.add(className);
  return true;
}
Program: 79281
Project: 79281
Buggy source:
public java.sql.Connection connect(String u,Properties p) throws SQLException {
  return this.driver.connect(u,p);
}

Fixed version (ground truth):
public java.sql.Connection connect(String u,Properties p) throws SQLException {
  logger.entering(WrappedDriver.class.getName() + "String_Node_Str" + driverClass,"String_Node_Str",u);
  return this.driver.connect(u,p);
}
Program: 79282
Project: 79282
Buggy source:
/** 
 * Construct a URL using given file name.
 * @param filename the name of file the constructed URL linked to 
 * @return URL constructed based on the given file name
 */
private URL constructURL(String filename){
  URL url=null;
  try {
    url=new URL("String_Node_Str",null,-1,new File(driverHomeDir,filename).getAbsolutePath());
  }
 catch (  MalformedURLException e) {
    assert(false);
  }
  return url;
}

Fixed version (ground truth):
/** 
 * Construct a URL using given file name.
 * @param filename the name of file the constructed URL linked to 
 * @return URL constructed based on the given file name
 */
private URL constructURL(String filename){
  URL url=null;
  try {
    url=new URL("String_Node_Str",null,-1,new File(driverHomeDir,filename).getAbsolutePath());
  }
 catch (  MalformedURLException e) {
    logger.log(Level.WARNING,"String_Node_Str" + filename,e);
    assert(false);
  }
  return url;
}
Program: 79283
Project: 79283
Buggy source:
/** 
 * Gets the list of property definitions available to this element. Includes all properties defined for this element, all user-defined properties defined on this element or its ancestors, any style properties that this element supports and extension properties that the extended element of this item supports.
 * @see org.eclipse.birt.report.model.core.DesignElement#getPropertyDefns()
 */
public List getPropertyDefns(){
  if (provider != null)   return provider.getPropertyDefns();
  return super.getPropertyDefns();
}

Fixed version (ground truth):
/** 
 * Gets the list of property definitions available to this element. Includes all properties defined for this element, all user-defined properties defined on this element or its ancestors, any style properties that this element supports and extension properties that the extended element of this item supports.
 * @see org.eclipse.birt.report.model.core.DesignElement#getPropertyDefns()
 */
public List getPropertyDefns(){
  ElementDefn elementDefn=(ElementDefn)super.getDefn();
  List propDefns=elementDefn.getProperties();
  if (provider != null)   propDefns.addAll(provider.getPropertyDefns());
  return propDefns;
}
Program: 79284
Project: 79284
Buggy source:
/** 
 * Returns the read-only list of all property definitions, including not only those defined in Model and extension definition file, but those defined by <code>IReportItem</code>. The returned list is read-only, so no modification is allowed on this list. Each one in list is the instance of <code>IPropertyDefn</code>.
 * @return the read-only list of all property definitions. Return empty listif there is no property defined.
 */
public List getPropertyDefns(){
  List props=super.getPropertyDefns();
  PeerExtensionElementDefn extDefn=(PeerExtensionElementDefn)getExtDefn();
  if (extDefn == null)   return props;
  IPropertyDefinition[] dynamicProps=getExtensionModelPropertyDefns();
  if (dynamicProps != null) {
    for (int i=0; i < dynamicProps.length; i++) {
      IPropertyDefinition extProp=dynamicProps[i];
      props.add(new ExtensionModelPropertyDefn(extProp,extDefn.getReportItemFactory().getMessages()));
    }
  }
  return props;
}

Fixed version (ground truth):
/** 
 * Returns the read-only list of all property definitions, including not only those defined in Model and extension definition file, but those defined by <code>IReportItem</code>. The returned list is read-only, so no modification is allowed on this list. Each one in list is the instance of <code>IPropertyDefn</code>.
 * @return the read-only list of all property definitions. Return empty listif there is no property defined.
 */
public List getPropertyDefns(){
  List props=new ArrayList();
  PeerExtensionElementDefn extDefn=(PeerExtensionElementDefn)getExtDefn();
  if (extDefn == null)   return props;
  props.addAll(extDefn.getLocalProperties());
  IPropertyDefinition[] dynamicProps=getExtensionModelPropertyDefns();
  if (dynamicProps != null) {
    for (int i=0; i < dynamicProps.length; i++) {
      IPropertyDefinition extProp=dynamicProps[i];
      props.add(new ExtensionModelPropertyDefn(extProp,extDefn.getReportItemFactory().getMessages()));
    }
  }
  return props;
}
Program: 79286
Project: 79286
Buggy source:
/** 
 * Gets the tool used to process multil-selection.
 * @param modelList DE model list.
 * @return The tool used to process multil-selection.
 */
public static GroupElementHandle getMultiSelectionHandle(List modelList){
  ReportDesign design=SessionHandleAdapter.getInstance().getReportDesign();
  GroupElementHandle handle=new GroupElementHandle(design,modelList);
  return handle;
}

Fixed version (ground truth):
/** 
 * Gets the tool used to process multil-selection.
 * @param modelList DE model list.
 * @return The tool used to process multil-selection.
 */
public static GroupElementHandle getMultiSelectionHandle(List modelList){
  ReportDesignHandle designHandle=SessionHandleAdapter.getInstance().getReportDesignHandle();
  GroupElementHandle handle=new GroupElementHandle(designHandle,modelList);
  return handle;
}
Program: 79287
Project: 79287
Buggy source:
private URL generateURL(String uri) throws MalformedURLException {
  String path=URIUtil.getLocalPath(uri);
  if (path != null) {
    String fullPath=SessionHandleAdapter.getInstance().getSessionHandle().getFileLocator().findFile(SessionHandleAdapter.getInstance().getReportDesign(),path);
    if (fullPath == null) {
      return null;
    }
    File file=new File(fullPath);
    if (file.exists()) {
      return file.toURL();
    }
    return null;
  }
  return URI.create(uri).toURL();
}

Fixed version (ground truth):
private URL generateURL(String uri) throws MalformedURLException {
  String path=URIUtil.getLocalPath(uri);
  if (path != null) {
    String fullPath=SessionHandleAdapter.getInstance().getSessionHandle().getFileLocator().findFile(SessionHandleAdapter.getInstance().getReportDesignHandle(),path);
    if (fullPath == null) {
      return null;
    }
    File file=new File(fullPath);
    if (file.exists()) {
      return file.toURL();
    }
    return null;
  }
  return URI.create(uri).toURL();
}