nus-yam/ex-repair huggingface dataset:
Program: 77075
Project: 77075
Buggy source:
public final int getDpiResolution(){
  if (iDpiResolution == 0) {
    iDpiResolution=_d.getDPI().x;
  }
  return iDpiResolution;
}

Fixed version (ground truth):
public final int getDpiResolution(){
  if (iDpiResolution == 0) {
    ((Display)_d).syncExec(new Runnable(){
      public void run(){
        iDpiResolution=_d.getDPI().x;
      }
    }
);
  }
  return iDpiResolution;
}
Program: 77076
Project: 77076
Buggy source:
public AbstractContent(IContent content){
  this(content.getReportContent());
  this.name=content.getName();
  this.x=content.getX();
  this.y=content.getY();
  this.width=content.getWidth();
  this.height=content.getHeight();
  this.hyperlink=content.getHyperlinkAction();
  this.bookmark=content.getBookmark();
  this.helpText=content.getHelpText();
  this.inlineStyle=content.getInlineStyle();
  this.generateBy=content.getGenerateBy();
  this.styleClass=content.getStyleClass();
  this.instanceId=content.getInstanceID();
  this.toc=content.getTOC();
  Object ext=content.getExtension(IContent.DOCUMENT_EXTENSION);
  if (ext != null) {
    setExtension(IContent.DOCUMENT_EXTENSION,ext);
  }
}

Fixed version (ground truth):
public AbstractContent(IContent content){
}
Program: 77077
Project: 77077
Buggy source:
public void setReportContent(IReportContent report){
  this.report=report;
  this.cssEngine=report.getCSSEngine();
}

Fixed version (ground truth):
public void setReportContent(IReportContent report){
}
Program: 77078
Project: 77078
Buggy source:
/** 
 * @return temp root dir directory
 */
private void createTempRootDir(){
  if (tempRootDirStr != null && new File(tempRootDirStr).exists() == true)   return;
  String tempDirStr=DataEngineContextExt.getInstance().getTmpdir();
  File tempDtEDir=new File(tempDirStr,"String_Node_Str");
  if (tempDtEDir.exists() == false) {
    tempDtEDir.mkdir();
  }
 else {
    File[] sessionsFolder=tempDtEDir.listFiles();
    for (int i=0; i < sessionsFolder.length; i++) {
      File[] oneSessionFolder=sessionsFolder[i].listFiles();
      for (int j=0; j < oneSessionFolder.length; j++) {
        if (oneSessionFolder[j].isDirectory()) {
          File[] oneSessionTempFiles=oneSessionFolder[j].listFiles();
          for (int k=0; k < oneSessionTempFiles.length; k++) {
            oneSessionTempFiles[k].delete();
          }
          oneSessionFolder[j].delete();
        }
 else {
          oneSessionFolder[j].delete();
        }
      }
      sessionsFolder[i].delete();
    }
  }
  try {
    tempRootDirStr=tempDtEDir.getCanonicalPath();
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
/** 
 * @return temp root dir directory
 */
private void createTempRootDir(){
  if (tempRootDirStr != null && new File(tempRootDirStr).exists() == true)   return;
  File tempDtEDir=null;
synchronized (cacheCounter1) {
    String tempDirStr=DataEngineContextExt.getInstance().getTmpdir();
    tempDtEDir=new File(tempDirStr,"String_Node_Str" + System.currentTimeMillis() + cacheCounter1);
    cacheCounter1=new Integer(cacheCounter1.intValue() + 1);
    int x=0;
    while (tempDtEDir.exists()) {
      x++;
      tempDtEDir=new File(tempDirStr,"String_Node_Str" + System.currentTimeMillis() + cacheCounter1+ "String_Node_Str"+ x);
    }
    tempDtEDir.mkdir();
    tempDtEDir.deleteOnExit();
  }
  try {
    tempRootDirStr=tempDtEDir.getCanonicalPath();
  }
 catch (  IOException e) {
  }
}
Program: 77081
Project: 77081
Buggy source:
/** 
 * set Dte temporary dir.
 * @param tmpdir
 */
public void setTmpdir(String tmpdir){
  DataEngineContextExt.getInstance().setTmpdir(tmpdir);
}

Fixed version (ground truth):
/** 
 * set Dte temporary dir.
 * @param tmpdir
 */
public void setTmpdir(String tmpdir){
  this.tmpDir=tmpdir;
}
Program: 77082
Project: 77082
Buggy source:
/** 
 * get Dte temporary dir.
 * @return
 */
public String getTmpdir(){
  return DataEngineContextExt.getInstance().getTmpdir();
}

Fixed version (ground truth):
/** 
 * get Dte temporary dir.
 * @return
 */
public String getTmpdir(){
  return tmpDir;
}
Program: 77083
Project: 77083
Buggy source:
/** 
 * @param expr
 * @return
 */
private String getColumnRefExpression(String expr){
  return "String_Node_Str" + JavascriptEvalUtil.transformToJsConstants(expr) + "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * @param expr
 * @return
 */
private String getColumnRefExpression(String expr){
  return ExpressionUtil.createJSRowExpression(expr);
}
Program: 77084
Project: 77084
Buggy source:
public void link(){
  report.setReportDesign(handle);
  PageSetupDesign pageSetup=report.getPageSetup();
  int masterPageCount=pageSetup.getMasterPageCount();
  for (int i=0; i < masterPageCount; i++) {
    SimpleMasterPageDesign masterPage=(SimpleMasterPageDesign)pageSetup.getMasterPage(i);
    linkReportElement(masterPage);
    int count=masterPage.getHeaderCount();
    for (int j=0; j < count; j++) {
      ReportItemDesign item=masterPage.getHeader(i);
      item.accept(this,null);
    }
    count=masterPage.getFooterCount();
    for (int j=0; j < count; j++) {
      ReportItemDesign item=masterPage.getFooter(i);
      item.accept(this,null);
    }
  }
  int count=report.getContentCount();
  for (int i=0; i < count; i++) {
    ReportItemDesign item=report.getContent(i);
    item.accept(this,null);
  }
}

Fixed version (ground truth):
public void link(){
  report.setReportDesign(handle);
  PageSetupDesign pageSetup=report.getPageSetup();
  int masterPageCount=pageSetup.getMasterPageCount();
  for (int i=0; i < masterPageCount; i++) {
    SimpleMasterPageDesign masterPage=(SimpleMasterPageDesign)pageSetup.getMasterPage(i);
    linkReportElement(masterPage);
    int count=masterPage.getHeaderCount();
    for (int j=0; j < count; j++) {
      ReportItemDesign item=masterPage.getHeader(j);
      item.accept(this,null);
    }
    count=masterPage.getFooterCount();
    for (int j=0; j < count; j++) {
      ReportItemDesign item=masterPage.getFooter(j);
      item.accept(this,null);
    }
  }
  int count=report.getContentCount();
  for (int i=0; i < count; i++) {
    ReportItemDesign item=report.getContent(i);
    item.accept(this,null);
  }
}
Program: 77085
Project: 77085
Buggy source:
/** 
 * @param cx
 * @param dataSetFilters
 * @param queryFilters
 * @param temporaryComputedColumns
 * @return
 */
private List prepareFilters(Context cx,List dataSetFilters,List queryFilters,List temporaryComputedColumns){
  List result=new ArrayList();
  prepareFilter(cx,dataSetFilters,temporaryComputedColumns,result);
  prepareFilter(cx,queryFilters,temporaryComputedColumns,result);
  return result;
}

Fixed version (ground truth):
/** 
 * @param cx
 * @param dataSetFilters
 * @param queryFilters
 * @param temporaryComputedColumns
 * @return
 * @throws DataException 
 */
private List prepareFilters(Context cx,List dataSetFilters,List queryFilters,List temporaryComputedColumns) throws DataException {
  List result=new ArrayList();
  prepareFilter(cx,dataSetFilters,temporaryComputedColumns,result);
  prepareFilter(cx,queryFilters,temporaryComputedColumns,result);
  return result;
}
Program: 77086
Project: 77086
Buggy source:
/** 
 * @param cx
 * @param dataSetFilters
 * @param temporaryComputedColumns
 * @param result
 */
private void prepareFilter(Context cx,List dataSetFilters,List temporaryComputedColumns,List result){
  if (dataSetFilters != null && !dataSetFilters.isEmpty()) {
    Iterator it=dataSetFilters.iterator();
    for (int i=0; it.hasNext(); i++) {
      IFilterDefinition src=(IFilterDefinition)it.next();
      IBaseExpression expr=src.getExpression();
      if (isGroupFilter(src)) {
        ConditionalExpression ce=((ConditionalExpression)expr);
        String exprText=ce.getExpression().getText();
        ColumnInfo columnInfo=QueryExecutorUtil.getColInfoFromJSExpr(cx,exprText);
        int index=columnInfo.getColumnIndex();
        String name=columnInfo.getColumnName();
        if (name == null && index < 0) {
          temporaryComputedColumns.add(new ComputedColumn("String_Node_Str" + i + "String_Node_Str",exprText,DataType.ANY_TYPE));
          it.remove();
          result.add(new FilterDefinition(new ConditionalExpression(new ScriptExpression(String.valueOf("String_Node_Str" + i + "String_Node_Str")),ce.getOperator(),ce.getOperand1(),ce.getOperand2())));
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * @param cx
 * @param dataSetFilters
 * @param temporaryComputedColumns
 * @param result
 * @throws DataException 
 */
private void prepareFilter(Context cx,List dataSetFilters,List temporaryComputedColumns,List result) throws DataException {
  if (dataSetFilters != null && !dataSetFilters.isEmpty()) {
    Iterator it=dataSetFilters.iterator();
    for (int i=0; it.hasNext(); i++) {
      IFilterDefinition src=(IFilterDefinition)it.next();
      IBaseExpression expr=src.getExpression();
      if (isGroupFilter(src)) {
        ConditionalExpression ce=((ConditionalExpression)expr);
        String exprText=ce.getExpression().getText();
        ColumnInfo columnInfo=QueryExecutorUtil.getColInfoFromJSExpr(cx,exprText);
        int index=columnInfo.getColumnIndex();
        String name=columnInfo.getColumnName();
        if (name == null && index < 0) {
          temporaryComputedColumns.add(new ComputedColumn("String_Node_Str" + i + "String_Node_Str",exprText,DataType.ANY_TYPE));
          it.remove();
          result.add(new FilterDefinition(new ConditionalExpression(new ScriptExpression(String.valueOf("String_Node_Str" + i + "String_Node_Str")),ce.getOperator(),ce.getOperand1(),ce.getOperand2())));
        }
      }
    }
  }
}
Program: 77087
Project: 77087
Buggy source:
/** 
 * @param filter
 * @return
 */
private boolean isGroupFilter(IFilterDefinition filter){
  IBaseExpression expr=filter.getExpression();
  if (expr instanceof IConditionalExpression) {
    try {
      if (odiQuery instanceof BaseQuery) {
        return ((BaseQuery)odiQuery).getExprProcessor().hasAggregation(expr);
      }
    }
 catch (    DataException e) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param filter
 * @return
 * @throws DataException 
 */
private boolean isGroupFilter(IFilterDefinition filter) throws DataException {
  IBaseExpression expr=filter.getExpression();
  if (expr instanceof IConditionalExpression) {
    if (!ExpressionCompilerUtil.isValidExpressionInQueryFilter(expr))     throw new DataException(ResourceConstants.INVALID_DEFINITION_IN_FILTER,new Object[]{((IConditionalExpression)expr).getExpression().getText()});
    try {
      if (odiQuery instanceof BaseQuery) {
        return ((BaseQuery)odiQuery).getExprProcessor().hasAggregation(expr);
      }
    }
 catch (    DataException e) {
      return true;
    }
  }
  return false;
}
Program: 77088
Project: 77088
Buggy source:
/** 
 * Evaluates a property binding Javascript expression
 */
String evaluatePropertyBindingExpr(String expr) throws BirtException {
  Object result=JavascriptEvalUtil.evaluateScript(null,jsScope,expr,"String_Node_Str",0);
  return result.toString();
}

Fixed version (ground truth):
/** 
 * Evaluates a property binding Javascript expression
 */
String evaluatePropertyBindingExpr(String expr) throws BirtException {
  Object result=JavascriptEvalUtil.evaluateScript(null,jsScope,expr,"String_Node_Str",0);
  return result == null ? null : result.toString();
}
Program: 77089
Project: 77089
Buggy source:
private void fillExpression(Combo control){
  String te="String_Node_Str";
  if (handle != null) {
    te=handle.getTestExpression();
  }
  if (designHandle instanceof DataItemHandle && ((DataItemHandle)designHandle).getColumnBindings().iterator().hasNext()) {
    control.add(VALUE_OF_THIS_DATA_ITEM);
  }
  control.add(DEUtil.resolveNull(te));
  control.select(control.getItemCount() - 1);
}

Fixed version (ground truth):
private void fillExpression(Combo control){
  String te="String_Node_Str";
  if (handle != null) {
    te=handle.getTestExpression();
  }
  if (designHandle instanceof DataItemHandle && (((DataItemHandle)designHandle).getColumnBindings().iterator().hasNext() || (((DataItemHandle)designHandle).getResultSetColumn() != null))) {
    control.add(VALUE_OF_THIS_DATA_ITEM);
  }
  control.add(DEUtil.resolveNull(te));
  control.select(control.getItemCount() - 1);
}
Program: 77091
Project: 77091
Buggy source:
public void visitReportDesign(ReportDesign obj){
  sourceDesign=obj;
  targetDesign=(ReportDesign)localize(obj);
  visitSlots(obj,targetDesign,ReportDesign.SLOT_COUNT);
  addExternalElements();
  addExternalStructures();
  release();
}

Fixed version (ground truth):
public void visitReportDesign(ReportDesign obj){
  sourceDesign=obj;
  targetDesign=(ReportDesign)localize(obj);
  visitSlots(obj,targetDesign,ReportDesign.SLOT_COUNT);
  addExternalElements();
  addExternalStructures();
  release();
  targetDesign.getVersionManager().setVersion(sourceDesign.getVersionManager().getVersion());
}
Program: 77092
Project: 77092
Buggy source:
/** 
 * Reset the result column name for the data item. Since the bound column name may recreated in this state, the corresponding result set colum must be resetted.
 * @param group the group element
 * @param columns the bound column list
 */
private void reCheckResultSetColumnName(GroupElement group,List columns,Module module){
}

Fixed version (ground truth):
/** 
 * Reset the result column name for the data item. Since the bound column name may recreated in this state, the corresponding result set colum must be resetted.
 * @param group the group element
 * @param columns the bound column list
 */
private void reCheckResultSetColumnName(GroupElement group,List columns,Module module){
  int level=-1;
  if (group instanceof TableGroup)   level=3;
  if (group instanceof ListGroup)   level=1;
  LevelContentIterator contentIter=new LevelContentIterator(group,level);
  while (contentIter.hasNext()) {
    DesignElement item=(DesignElement)contentIter.next();
    if (!(item instanceof DataItem))     continue;
    String resultSetColumn=(String)item.getLocalProperty(module,DataItem.RESULT_SET_COLUMN_PROP);
    if (StringUtil.isBlank(resultSetColumn))     continue;
    ComputedColumn foundColumn=DataColumnNameValidator.getColumn(columns,resultSetColumn);
    if (foundColumn == null)     continue;
    foundColumn=checkMatchedBoundColumnForGroup(columns,foundColumn.getExpression(),(String)group.getLocalProperty(module,GroupElement.GROUP_NAME_PROP));
    if (foundColumn == null)     continue;
    item.setProperty(DataItem.RESULT_SET_COLUMN_PROP,foundColumn.getName());
  }
}
Program: 77093
Project: 77093
Buggy source:
/** 
 * Create a row expression base on a binding column name.
 * @param columnName the column name
 * @return the expression, or null if the column name is blank.
 */
public static String getColumnExpression(String columnName){
  Assert.isNotNull(columnName);
  if (StringUtil.isBlank(columnName)) {
    return null;
  }
  return IReportElementConstants.BINDING_COLUMN_PREFIX + "String_Node_Str" + DEUtil.escape(columnName)+ "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Create a row expression base on a binding column name.
 * @param columnName the column name
 * @return the expression, or null if the column name is blank.
 */
public static String getColumnExpression(String columnName){
  Assert.isNotNull(columnName);
  if (StringUtil.isBlank(columnName)) {
    return null;
  }
  return ExpressionUtil.createJSRowExpression(columnName);
}
Program: 77094
Project: 77094
Buggy source:
/** 
 * Gets the proper expression for the given model
 * @param model the given model
 * @return Returns the proper expression for the given model, or null if noproper one exists
 */
public static String getExpression(Object model){
  if (model instanceof ParameterHandle) {
    return IReportElementConstants.PARAMETER_PREFIX + "String_Node_Str" + escape(((ParameterHandle)model).getQualifiedName())+ "String_Node_Str";
  }
  if (model instanceof DataSetItemModel) {
    String colName=((DataSetItemModel)model).getAlias();
    if (colName == null || colName.trim().length() == 0) {
      colName=((DataSetItemModel)model).getName();
    }
    return getColumnExpression(colName);
  }
  if (model instanceof ComputedColumnHandle) {
    return getColumnExpression(((ComputedColumnHandle)model).getName());
  }
  if (model instanceof ResultSetColumnHandle) {
    return getResultSetColumnExpression(((ResultSetColumnHandle)model).getColumnName());
  }
  if (model instanceof DataSetParameterHandle) {
    return IReportElementConstants.STOREDPROCUDURE_OUTPUT_PREFIX + "String_Node_Str" + escape(((DataSetParameterHandle)model).getName())+ "String_Node_Str";
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gets the proper expression for the given model
 * @param model the given model
 * @return Returns the proper expression for the given model, or null if noproper one exists
 */
public static String getExpression(Object model){
  if (model instanceof ParameterHandle) {
    return ExpressionUtil.createJSParameterExpression(((ParameterHandle)model).getQualifiedName());
  }
  if (model instanceof DataSetItemModel) {
    String colName=((DataSetItemModel)model).getAlias();
    if (colName == null || colName.trim().length() == 0) {
      colName=((DataSetItemModel)model).getName();
    }
    return getColumnExpression(colName);
  }
  if (model instanceof ComputedColumnHandle) {
    return getColumnExpression(((ComputedColumnHandle)model).getName());
  }
  if (model instanceof ResultSetColumnHandle) {
    return getResultSetColumnExpression(((ResultSetColumnHandle)model).getColumnName());
  }
  if (model instanceof DataSetParameterHandle) {
    return IReportElementConstants.STOREDPROCUDURE_OUTPUT_PREFIX + "String_Node_Str" + escape(((DataSetParameterHandle)model).getName())+ "String_Node_Str";
  }
  return null;
}
Program: 77095
Project: 77095
Buggy source:
/** 
 * Create a row expression base on a result set column name.
 * @param columnName the column name
 * @return the expression, or null if the column name is blank.
 */
public static String getResultSetColumnExpression(String columnName){
  Assert.isNotNull(columnName);
  if (StringUtil.isBlank(columnName)) {
    return null;
  }
  return IReportElementConstants.RESULTSET_COLUMN_PREFIX + "String_Node_Str" + DEUtil.escape(columnName)+ "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Create a row expression base on a result set column name.
 * @param columnName the column name
 * @return the expression, or null if the column name is blank.
 */
public static String getResultSetColumnExpression(String columnName){
  Assert.isNotNull(columnName);
  if (StringUtil.isBlank(columnName)) {
    return null;
  }
  return ExpressionUtil.createJSDataSetRowExpression(columnName);
}
Program: 77096
Project: 77096
Buggy source:
/** 
 * Transform a String value to a Timestamp value
 * @param stringValue String value
 * @return Corresponding Timestamp value
 * @throws OdaException 
 */
private Timestamp stringToTimestamp(String stringValue) throws OdaException {
  testClosed();
  if (stringValue != null) {
    try {
      long timeMills=new Long(stringValue).longValue();
      return new Timestamp(timeMills);
    }
 catch (    NumberFormatException e1) {
      try {
        java.util.Date date=DateUtil.toDate(stringValue);
        Timestamp timeStamp=new Timestamp(date.getTime());
        return timeStamp;
      }
 catch (      OdaException oe) {
        this.wasNull=true;
        return null;
      }
    }
  }
  this.wasNull=true;
  return null;
}

Fixed version (ground truth):
/** 
 * Transform a String value to a Timestamp value
 * @param stringValue String value
 * @return Corresponding Timestamp value
 * @throws OdaException 
 */
private Timestamp stringToTimestamp(String stringValue) throws OdaException {
  testClosed();
  if (stringValue != null) {
    try {
      stringValue=stringValue.replaceAll("String_Node_Str","String_Node_Str").split("String_Node_Str")[0];
      return Timestamp.valueOf(stringValue);
    }
 catch (    IllegalArgumentException e) {
      try {
        long timeMills=new Long(stringValue).longValue();
        return new Timestamp(timeMills);
      }
 catch (      NumberFormatException e1) {
        try {
          java.util.Date date=DateUtil.toDate(stringValue);
          Timestamp timeStamp=new Timestamp(date.getTime());
          return timeStamp;
        }
 catch (        OdaException oe) {
          this.wasNull=true;
          return null;
        }
      }
    }
  }
  this.wasNull=true;
  return null;
}
Program: 77097
Project: 77097
Buggy source:
/** 
 * clear unused column hints
 * @throws BirtException 
 */
private final void clearUnusedColumnHints(DataSetHandle dataSetHandle,IResultMetaData metaData) throws BirtException {
  PropertyHandle handle=dataSetHandle.getPropertyHandle(DataSetHandle.COLUMN_HINTS_PROP);
  if (handle != null && handle.getListValue() != null) {
    ArrayList list=handle.getListValue();
    int count=list.size();
    for (int n=count - 1; n >= 0; n--) {
      ColumnHint hint=(ColumnHint)list.get(n);
      String columnName=(String)hint.getProperty(handle.getDesign(),ColumnHint.COLUMN_NAME_MEMBER);
      boolean found=false;
      if (!isEmpty(hint,handle.getModule().getModuleHandle())) {
        for (int m=0; m < metaData.getColumnCount() && !found; m++) {
          found=columnName.equals(metaData.getColumnName(m + 1));
        }
      }
      if (!found) {
        try {
          handle.removeItem(hint);
        }
 catch (        PropertyValueException e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * clear unused column hints
 * @throws BirtException 
 */
private final void clearUnusedColumnHints(DataSetHandle dataSetHandle,IResultMetaData metaData) throws BirtException {
  PropertyHandle handle=dataSetHandle.getPropertyHandle(DataSetHandle.COLUMN_HINTS_PROP);
  if (handle != null && handle.getListValue() != null) {
    ArrayList list=handle.getListValue();
    int count=list.size();
    for (int n=count - 1; n >= 0; n--) {
      ColumnHint hint=(ColumnHint)list.get(n);
      String columnName=(String)hint.getProperty(handle.getModule(),ColumnHint.COLUMN_NAME_MEMBER);
      boolean found=false;
      if (!isEmpty(hint,handle.getModule().getModuleHandle())) {
        for (int m=0; m < metaData.getColumnCount() && !found; m++) {
          found=columnName.equals(metaData.getColumnName(m + 1));
        }
      }
      if (!found) {
        try {
          handle.removeItem(hint);
        }
 catch (        PropertyValueException e) {
        }
      }
    }
  }
}
Program: 77098
Project: 77098
Buggy source:
/** 
 * @param meta
 * @throws BirtException 
 */
private void addResultSetColumn(DataSetHandle dataSetHandle,IResultMetaData meta) throws BirtException {
  if (meta == null || !(dataSetHandle instanceof OdaDataSetHandle))   return;
  List columnList=new ArrayList();
  for (int i=1; i <= meta.getColumnCount(); i++) {
    OdaResultSetColumn rsColumn=new OdaResultSetColumn();
    if (!meta.isComputedColumn(i)) {
      rsColumn.setColumnName(meta.getColumnName(i));
      rsColumn.setDataType(toModelDataType(meta.getColumnType(i)));
      rsColumn.setNativeName(meta.getColumnName(i));
      rsColumn.setPosition(new Integer(i));
      columnList.add(rsColumn);
    }
  }
  CompaibilityUtil.addResultSetColumn(dataSetHandle,columnList);
}

Fixed version (ground truth):
/** 
 * @param meta
 * @throws BirtException 
 */
private void addResultSetColumn(DataSetHandle dataSetHandle,IResultMetaData meta) throws BirtException {
  if (meta == null || !(dataSetHandle instanceof OdaDataSetHandle))   return;
  List columnList=new ArrayList();
  for (int i=1; i <= meta.getColumnCount(); i++) {
    OdaResultSetColumn rsColumn=new OdaResultSetColumn();
    String uniqueName;
    HashSet orgColumnNameSet=new HashSet();
    HashSet uniqueColumnNameSet=new HashSet();
    if (!meta.isComputedColumn(i)) {
      uniqueName=MetaDataPopulator.getUniqueName(orgColumnNameSet,uniqueColumnNameSet,meta.getColumnName(i),i);
      rsColumn.setColumnName(uniqueName);
      rsColumn.setDataType(toModelDataType(meta.getColumnType(i)));
      rsColumn.setNativeName(meta.getColumnName(i));
      rsColumn.setPosition(new Integer(i));
      columnList.add(rsColumn);
      uniqueColumnNameSet.add(uniqueName);
    }
  }
  CompaibilityUtil.addResultSetColumn(dataSetHandle,columnList);
}
Program: 77099
Project: 77099
Buggy source:
/** 
 * @param dataSetHandle
 * @return
 * @throws BirtException
 */
IResultMetaData refreshMetaData(DataSetHandle dataSetHandle,boolean holdEvent) throws BirtException {
  IResultMetaData rsMeta=null;
  BirtException e=null;
  try {
    rsMeta=this.getDataSetMetaData(dataSetHandle,false);
  }
 catch (  BirtException e1) {
    e=e1;
  }
  if (needsSetCachedMetaData(dataSetHandle,rsMeta)) {
    List columnList=new ArrayList();
    if (rsMeta != null && rsMeta.getColumnCount() != 0) {
      for (int i=1; i <= rsMeta.getColumnCount(); i++) {
        ResultSetColumn rsc=StructureFactory.createResultSetColumn();
        rsc.setColumnName(getColumnName(rsMeta,i));
        rsc.setDataType(toModelDataType(rsMeta.getColumnType(i)));
        rsc.setPosition(new Integer(i));
        columnList.add(rsc);
      }
    }
    if (holdEvent) {
      CompaibilityUtil.updateResultSetinCachedMetaData(dataSetHandle,columnList);
    }
 else {
      dataSetHandle.setCachedMetaData(StructureFactory.createCachedMetaData());
      for (int i=0; i < columnList.size(); i++) {
        dataSetHandle.getCachedMetaDataHandle().getResultSet().addItem((ResultSetColumn)columnList.get(i));
      }
    }
  }
  if (e != null)   throw e;
  return rsMeta;
}

Fixed version (ground truth):
/** 
 * @param dataSetHandle
 * @return
 * @throws BirtException
 */
IResultMetaData refreshMetaData(DataSetHandle dataSetHandle,boolean holdEvent) throws BirtException {
  IResultMetaData rsMeta=null;
  BirtException e=null;
  try {
    rsMeta=this.getDataSetMetaData(dataSetHandle,false);
  }
 catch (  BirtException e1) {
    e=e1;
  }
  if (needsSetCachedMetaData(dataSetHandle,rsMeta)) {
    List columnList=new ArrayList();
    if (rsMeta != null && rsMeta.getColumnCount() != 0) {
      for (int i=1; i <= rsMeta.getColumnCount(); i++) {
        ResultSetColumn rsc=StructureFactory.createResultSetColumn();
        rsc.setColumnName(getColumnName(rsMeta,i));
        rsc.setDataType(toModelDataType(rsMeta.getColumnType(i)));
        rsc.setPosition(new Integer(i));
        columnList.add(rsc);
      }
    }
    if (holdEvent || !dataSetHandle.canEdit()) {
      CompaibilityUtil.updateResultSetinCachedMetaData(dataSetHandle,columnList);
    }
 else {
      dataSetHandle.setCachedMetaData(StructureFactory.createCachedMetaData());
      for (int i=0; i < columnList.size(); i++) {
        dataSetHandle.getCachedMetaDataHandle().getResultSet().addItem((ResultSetColumn)columnList.get(i));
      }
    }
  }
  if (e != null)   throw e;
  return rsMeta;
}
Program: 77100
Project: 77100
Buggy source:
/** 
 * @param dataSetHandle
 * @param metaData
 * @throws BirtException 
 */
private final void clearUnusedData(DataSetHandle dataSetHandle,IResultMetaData metaData) throws BirtException {
  clearUnusedColumnHints(dataSetHandle,metaData);
  clearUnusedResultSetColumns(dataSetHandle,metaData);
}

Fixed version (ground truth):
/** 
 * @param dataSetHandle
 * @param metaData
 * @throws BirtException 
 */
private final void clearUnusedData(DataSetHandle dataSetHandle,IResultMetaData metaData) throws BirtException {
  clearUnusedColumnHints(dataSetHandle,metaData);
}
Program: 77101
Project: 77101
Buggy source:
/** 
 * @param dataSetName
 * @return
 * @throws BirtException
 */
private IResultMetaData getRealMetaData(DataSetHandle dataSetHandle) throws BirtException {
  QueryDefinition query=new QueryDefinition();
  query.setDataSetName(dataSetHandle.getQualifiedName());
  query.setMaxRows(1);
  IResultMetaData metaData=MetaDataPopulator.retrieveResultMetaData(dataSetHandle);
  if (metaData == null) {
    metaData=new QueryExecutionHelper(dataEngine,modelAdaptor,sessionContext,false).executeQuery(query).getResultMetaData();
    if (dataSetHandle.canEdit())     addResultSetColumn(dataSetHandle,metaData);
    if (MetaDataPopulator.needsUseResultHint(dataSetHandle,metaData)) {
      metaData=new QueryExecutionHelper(dataEngine,modelAdaptor,sessionContext,true).executeQuery(query).getResultMetaData();
    }
  }
  if (!(dataSetHandle instanceof ScriptDataSetHandle))   clearUnusedData(dataSetHandle,metaData);
  return metaData;
}

Fixed version (ground truth):
/** 
 * @param dataSetName
 * @return
 * @throws BirtException
 */
private IResultMetaData getRealMetaData(DataSetHandle dataSetHandle) throws BirtException {
  QueryDefinition query=new QueryDefinition();
  query.setDataSetName(dataSetHandle.getQualifiedName());
  query.setMaxRows(1);
  IResultMetaData metaData=MetaDataPopulator.retrieveResultMetaData(dataSetHandle);
  if (metaData == null) {
    metaData=new QueryExecutionHelper(dataEngine,modelAdaptor,sessionContext,false).executeQuery(query).getResultMetaData();
    addResultSetColumn(dataSetHandle,metaData);
    if (MetaDataPopulator.needsUseResultHint(dataSetHandle,metaData)) {
      metaData=new QueryExecutionHelper(dataEngine,modelAdaptor,sessionContext,true).executeQuery(query).getResultMetaData();
    }
  }
  if (!(dataSetHandle instanceof ScriptDataSetHandle))   clearUnusedData(dataSetHandle,metaData);
  return metaData;
}
Program: 77102
Project: 77102
Buggy source:
/** 
 * @param orgColumnNameSet
 * @param newColumnNameSet
 * @param columnName
 * @param index
 * @return
 */
private static String getUniqueName(HashSet orgColumnNameSet,HashSet newColumnNameSet,String columnName,int index){
  String newColumnName;
  if (columnName == null || columnName.trim().length() == 0 || newColumnNameSet.contains(columnName)) {
    if (columnName == null || columnName.trim().length() == 0)     newColumnName=UNNAME_PREFIX + RENAME_SEPARATOR + String.valueOf(index + 1);
 else     newColumnName=columnName + RENAME_SEPARATOR + String.valueOf(index + 1);
    int i=1;
    while (orgColumnNameSet.contains(newColumnName) || newColumnNameSet.contains(newColumnName)) {
      newColumnName+=String.valueOf(RENAME_SEPARATOR) + i;
      i++;
    }
  }
 else {
    newColumnName=columnName;
  }
  return newColumnName;
}

Fixed version (ground truth):
/** 
 * @param orgColumnNameSet
 * @param newColumnNameSet
 * @param columnName
 * @param index
 * @return
 */
public static String getUniqueName(HashSet orgColumnNameSet,HashSet newColumnNameSet,String columnName,int index){
  String newColumnName;
  if (columnName == null || columnName.trim().length() == 0 || newColumnNameSet.contains(columnName)) {
    if (columnName == null || columnName.trim().length() == 0)     newColumnName=UNNAME_PREFIX + RENAME_SEPARATOR + String.valueOf(index + 1);
 else     newColumnName=columnName + RENAME_SEPARATOR + String.valueOf(index + 1);
    int i=1;
    while (orgColumnNameSet.contains(newColumnName) || newColumnNameSet.contains(newColumnName)) {
      newColumnName+=String.valueOf(RENAME_SEPARATOR) + i;
      i++;
    }
  }
 else {
    newColumnName=columnName;
  }
  return newColumnName;
}
Program: 77104
Project: 77104
Buggy source:
/** 
 * Gets all the Styles available.
 * @return A String array contains all the Styles.
 */
public static String[] getStyles(){
  ArrayList list=new ArrayList();
  list.add(CHOICE_NONE);
  Iterator iterator=DEUtil.getStyles();
  if (iterator != null) {
    while (iterator.hasNext()) {
      ReportElementHandle elementHandle=(ReportElementHandle)iterator.next();
      list.add(elementHandle.getDisplayLabel());
    }
  }
  return (String[])list.toArray(new String[0]);
}

Fixed version (ground truth):
/** 
 * Gets all the Styles available.
 * @return A String array contains all the Styles.
 */
public static String[] getStyles(){
  ArrayList list=new ArrayList();
  list.add(CHOICE_NONE);
  Iterator iterator=DEUtil.getStyles();
  if (iterator != null) {
    while (iterator.hasNext()) {
      StyleHandle styleHandle=(StyleHandle)iterator.next();
      list.add(styleHandle.getName());
    }
  }
  return (String[])list.toArray(new String[0]);
}
Program: 77105
Project: 77105
Buggy source:
private IContentEmitter createContentEmitter() throws EngineException {
  String format=executionContext.getOutputFormat();
  ExtensionManager extManager=ExtensionManager.getInstance();
  boolean supported=false;
  Collection supportedFormats=extManager.getSupportedFormat();
  Iterator iter=supportedFormats.iterator();
  while (iter.hasNext()) {
    String supportedFormat=(String)iter.next();
    if (supportedFormat != null && supportedFormat.equalsIgnoreCase(format)) {
      supported=true;
      break;
    }
  }
  if (!supported) {
    log.log(Level.SEVERE,MessageConstants.FORMAT_NOT_SUPPORTED_EXCEPTION,format);
    throw new UnsupportedFormatException(MessageConstants.FORMAT_NOT_SUPPORTED_EXCEPTION,format);
  }
  initializePagination(format,extManager);
  IContentEmitter emitter=null;
  try {
    emitter=extManager.createEmitter(format,emitterID);
  }
 catch (  Throwable t) {
    log.log(Level.SEVERE,"String_Node_Str",format);
    throw new EngineException(MessageConstants.CANNOT_CREATE_EMITTER_EXCEPTION,t);
  }
  if (emitter == null) {
    log.log(Level.SEVERE,"String_Node_Str",format);
    throw new EngineException(MessageConstants.CANNOT_CREATE_EMITTER_EXCEPTION);
  }
  return emitter;
}

Fixed version (ground truth):
protected IContentEmitter createContentEmitter() throws EngineException {
  String format=executionContext.getOutputFormat();
  ExtensionManager extManager=ExtensionManager.getInstance();
  boolean supported=false;
  Collection supportedFormats=extManager.getSupportedFormat();
  Iterator iter=supportedFormats.iterator();
  while (iter.hasNext()) {
    String supportedFormat=(String)iter.next();
    if (supportedFormat != null && supportedFormat.equalsIgnoreCase(format)) {
      supported=true;
      break;
    }
  }
  if (!supported) {
    log.log(Level.SEVERE,MessageConstants.FORMAT_NOT_SUPPORTED_EXCEPTION,format);
    throw new UnsupportedFormatException(MessageConstants.FORMAT_NOT_SUPPORTED_EXCEPTION,format);
  }
  initializePagination(format,extManager);
  IContentEmitter emitter=null;
  try {
    emitter=extManager.createEmitter(format,emitterID);
  }
 catch (  Throwable t) {
    log.log(Level.SEVERE,"String_Node_Str",format);
    throw new EngineException(MessageConstants.CANNOT_CREATE_EMITTER_EXCEPTION,t);
  }
  if (emitter == null) {
    log.log(Level.SEVERE,"String_Node_Str",format);
    throw new EngineException(MessageConstants.CANNOT_CREATE_EMITTER_EXCEPTION);
  }
  return emitter;
}
Program: 77106
Project: 77106
Buggy source:
protected boolean traverseChildren(){
  if (last != null) {
    parent.addArea(last);
    last=null;
    if (breakAfterRelayout) {
      breakAfterRelayout=false;
      return true;
    }
  }
  boolean childBreak=false;
  if (children.size() > 0) {
    Iterator iterLM=children.iterator();
    while (iterLM.hasNext()) {
      PDFAbstractLM childLM=(PDFAbstractLM)iterLM.next();
      child=childLM;
      boolean currentBreak=childLM.layout();
      if (currentBreak) {
        childBreak=true;
      }
 else {
        iterLM.remove();
      }
    }
    if (childBreak) {
      return true;
    }
 else {
      endLine();
    }
  }
  boolean childHasNext=false;
  while (executor.hasNextChild() || unfinishedExecutor != null) {
    IReportItemExecutor childExecutor=null;
    if (unfinishedExecutor != null) {
      childExecutor=unfinishedExecutor;
      unfinishedExecutor=null;
    }
 else {
      childExecutor=executor.getNextChild();
    }
    assert(childExecutor != null);
    childHasNext=handleChild(childExecutor) || childHasNext;
    if (childHasNext && unfinishedExecutor != null) {
      if (lineFinished) {
        return true;
      }
    }
  }
  return childHasNext;
}

Fixed version (ground truth):
protected boolean traverseChildren(){
  if (last != null) {
    parent.addArea(last);
    last=null;
    if (breakAfterRelayout) {
      breakAfterRelayout=false;
      return true;
    }
  }
  boolean childBreak=false;
  if (children.size() > 0) {
    Iterator iterLM=children.iterator();
    while (iterLM.hasNext()) {
      PDFAbstractLM childLM=(PDFAbstractLM)iterLM.next();
      child=childLM;
      boolean currentBreak=childLM.layout();
      if (currentBreak) {
        childBreak=true;
      }
 else {
        iterLM.remove();
      }
    }
    if (childBreak) {
      return true;
    }
  }
  boolean childHasNext=false;
  while (executor.hasNextChild() || unfinishedExecutor != null) {
    IReportItemExecutor childExecutor=null;
    if (unfinishedExecutor != null) {
      childExecutor=unfinishedExecutor;
      unfinishedExecutor=null;
    }
 else {
      childExecutor=executor.getNextChild();
    }
    assert(childExecutor != null);
    childHasNext=handleChild(childExecutor) || childHasNext;
    if (childHasNext) {
      if (lineFinished) {
        return true;
      }
    }
  }
  return childHasNext;
}
Program: 77108
Project: 77108
Buggy source:
public boolean compose(){
  boolean hasMore;
  while ((hasMore=hasMore()) && !PDFTextLM.this.needPause()) {
    handleNext();
  }
  return hasMore;
}

Fixed version (ground truth):
public boolean compose(){
  while (hasMore()) {
    handleNext();
    if (PDFTextLM.this.needPause()) {
      return true;
    }
  }
  return false;
}
Program: 77110
Project: 77110
Buggy source:
/** 
 * @param meta
 * @throws BirtException 
 */
private void addResultSetColumn(DataSetHandle dataSetHandle,IResultMetaData meta) throws BirtException {
  if (meta == null || !(dataSetHandle instanceof OdaDataSetHandle))   return;
  List columnList=new ArrayList();
  HashSet orgColumnNameSet=new HashSet();
  HashSet uniqueColumnNameSet=new HashSet();
  for (int i=1; i <= meta.getColumnCount(); i++) {
    OdaResultSetColumn rsColumn=new OdaResultSetColumn();
    String uniqueName;
    if (!meta.isComputedColumn(i)) {
      uniqueName=MetaDataPopulator.getUniqueName(orgColumnNameSet,uniqueColumnNameSet,meta.getColumnName(i),i);
      rsColumn.setColumnName(uniqueName);
      rsColumn.setDataType(toModelDataType(meta.getColumnType(i)));
      rsColumn.setNativeName(meta.getColumnName(i));
      rsColumn.setPosition(new Integer(i));
      columnList.add(rsColumn);
      uniqueColumnNameSet.add(uniqueName);
    }
  }
  CompaibilityUtil.addResultSetColumn(dataSetHandle,columnList);
}

Fixed version (ground truth):
/** 
 * @param meta
 * @throws BirtException 
 */
private void addResultSetColumn(DataSetHandle dataSetHandle,IResultMetaData meta) throws BirtException {
  if (meta == null || !(dataSetHandle instanceof OdaDataSetHandle))   return;
  List columnList=new ArrayList();
  HashSet orgColumnNameSet=new HashSet();
  HashSet uniqueColumnNameSet=new HashSet();
  for (int i=1; i <= meta.getColumnCount(); i++) {
    OdaResultSetColumn rsColumn=new OdaResultSetColumn();
    String uniqueName;
    if (!meta.isComputedColumn(i)) {
      uniqueName=MetaDataPopulator.getUniqueName(orgColumnNameSet,uniqueColumnNameSet,meta.getColumnName(i),i - 1);
      rsColumn.setColumnName(uniqueName);
      rsColumn.setDataType(toModelDataType(meta.getColumnType(i)));
      rsColumn.setNativeName(meta.getColumnName(i));
      rsColumn.setPosition(new Integer(i));
      columnList.add(rsColumn);
      uniqueColumnNameSet.add(uniqueName);
    }
  }
  CompaibilityUtil.addResultSetColumn(dataSetHandle,columnList);
}
Program: 77112
Project: 77112
Buggy source:
protected IContentEmitter createContentEmitter() throws EngineException {
  String format=executionContext.getOutputFormat();
  ExtensionManager extManager=ExtensionManager.getInstance();
  boolean supported=false;
  Collection supportedFormats=extManager.getSupportedFormat();
  Iterator iter=supportedFormats.iterator();
  while (iter.hasNext()) {
    String supportedFormat=(String)iter.next();
    if (supportedFormat != null && supportedFormat.equalsIgnoreCase(format)) {
      supported=true;
      break;
    }
  }
  if (!supported) {
    log.log(Level.SEVERE,MessageConstants.FORMAT_NOT_SUPPORTED_EXCEPTION,format);
    throw new UnsupportedFormatException(MessageConstants.FORMAT_NOT_SUPPORTED_EXCEPTION,format);
  }
  IContentEmitter emitter;
  try {
    emitter=extManager.createEmitter(format,emitterID);
  }
 catch (  Throwable t) {
    log.log(Level.SEVERE,"String_Node_Str",format);
    throw new EngineException(MessageConstants.CANNOT_CREATE_EMITTER_EXCEPTION,t);
  }
  if (emitter == null) {
    log.log(Level.SEVERE,"String_Node_Str",format);
    throw new EngineException(MessageConstants.CANNOT_CREATE_EMITTER_EXCEPTION);
  }
  initializePagination(format,extManager);
  if (pagination != ExtensionManager.PAPER_SIZE_PAGINATION) {
    emitter=new HTMLTableLayoutNestEmitter(emitter);
  }
  return emitter;
}

Fixed version (ground truth):
protected IContentEmitter createContentEmitter() throws EngineException {
  String format=executionContext.getOutputFormat();
  ExtensionManager extManager=ExtensionManager.getInstance();
  boolean supported=false;
  Collection supportedFormats=extManager.getSupportedFormat();
  Iterator iter=supportedFormats.iterator();
  while (iter.hasNext()) {
    String supportedFormat=(String)iter.next();
    if (supportedFormat != null && supportedFormat.equalsIgnoreCase(format)) {
      supported=true;
      break;
    }
  }
  if (!supported) {
    log.log(Level.SEVERE,MessageConstants.FORMAT_NOT_SUPPORTED_EXCEPTION,format);
    throw new UnsupportedFormatException(MessageConstants.FORMAT_NOT_SUPPORTED_EXCEPTION,format);
  }
  IContentEmitter emitter;
  try {
    emitter=extManager.createEmitter(format,emitterID);
  }
 catch (  Throwable t) {
    log.log(Level.SEVERE,"String_Node_Str",format);
    throw new EngineException(MessageConstants.CANNOT_CREATE_EMITTER_EXCEPTION,t);
  }
  if (emitter == null) {
    log.log(Level.SEVERE,"String_Node_Str",format);
    throw new EngineException(MessageConstants.CANNOT_CREATE_EMITTER_EXCEPTION);
  }
  initializePagination(format,extManager);
  if (!ExtensionManager.PAPER_SIZE_PAGINATION.equals(pagination)) {
    emitter=new HTMLTableLayoutNestEmitter(emitter);
  }
  return emitter;
}
Program: 77113
Project: 77113
Buggy source:
/** 
 * @param meta
 * @throws BirtException 
 */
private void addResultSetColumn(DataSetHandle dataSetHandle,IResultMetaData meta) throws BirtException {
  if (meta == null || !(dataSetHandle instanceof OdaDataSetHandle))   return;
  List columnList=new ArrayList();
  for (int i=1; i <= meta.getColumnCount(); i++) {
    OdaResultSetColumn rsColumn=new OdaResultSetColumn();
    String uniqueName;
    HashSet orgColumnNameSet=new HashSet();
    HashSet uniqueColumnNameSet=new HashSet();
    if (!meta.isComputedColumn(i)) {
      uniqueName=MetaDataPopulator.getUniqueName(orgColumnNameSet,uniqueColumnNameSet,meta.getColumnName(i),i);
      rsColumn.setColumnName(uniqueName);
      rsColumn.setDataType(toModelDataType(meta.getColumnType(i)));
      rsColumn.setNativeName(meta.getColumnName(i));
      rsColumn.setPosition(new Integer(i));
      columnList.add(rsColumn);
      uniqueColumnNameSet.add(uniqueName);
    }
  }
  CompaibilityUtil.addResultSetColumn(dataSetHandle,columnList);
}

Fixed version (ground truth):
/** 
 * @param meta
 * @throws BirtException 
 */
private void addResultSetColumn(DataSetHandle dataSetHandle,IResultMetaData meta) throws BirtException {
  if (meta == null || !(dataSetHandle instanceof OdaDataSetHandle))   return;
  List columnList=new ArrayList();
  HashSet orgColumnNameSet=new HashSet();
  HashSet uniqueColumnNameSet=new HashSet();
  for (int i=1; i <= meta.getColumnCount(); i++) {
    OdaResultSetColumn rsColumn=new OdaResultSetColumn();
    String uniqueName;
    if (!meta.isComputedColumn(i)) {
      uniqueName=MetaDataPopulator.getUniqueName(orgColumnNameSet,uniqueColumnNameSet,meta.getColumnName(i),i);
      rsColumn.setColumnName(uniqueName);
      rsColumn.setDataType(toModelDataType(meta.getColumnType(i)));
      rsColumn.setNativeName(meta.getColumnName(i));
      rsColumn.setPosition(new Integer(i));
      columnList.add(rsColumn);
      uniqueColumnNameSet.add(uniqueName);
    }
  }
  CompaibilityUtil.addResultSetColumn(dataSetHandle,columnList);
}
Program: 77114
Project: 77114
Buggy source:
/** 
 * @param meta
 * @throws BirtException 
 */
private void addResultSetColumn(DataSetHandle dataSetHandle,IResultMetaData meta) throws BirtException {
  if (meta == null || !(dataSetHandle instanceof OdaDataSetHandle))   return;
  PropertyHandle resultSetColumnHandle=dataSetHandle.getPropertyHandle(DataSetHandle.RESULT_SET_PROP);
  for (int i=1; i <= meta.getColumnCount(); i++) {
    OdaResultSetColumn rsColumn=new OdaResultSetColumn();
    if (!meta.isComputedColumn(i)) {
      try {
        rsColumn.setColumnName(meta.getColumnName(i));
        rsColumn.setDataType(toModelDataType(meta.getColumnType(i)));
        rsColumn.setNativeName(meta.getColumnName(i));
        rsColumn.setPosition(new Integer(i));
        resultSetColumnHandle.addItem(rsColumn);
      }
 catch (      BirtException e) {
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * @param meta
 * @throws BirtException 
 */
private void addResultSetColumn(DataSetHandle dataSetHandle,IResultMetaData meta) throws BirtException {
  if (meta == null || !(dataSetHandle instanceof OdaDataSetHandle))   return;
  List columnList=new ArrayList();
  for (int i=1; i <= meta.getColumnCount(); i++) {
    OdaResultSetColumn rsColumn=new OdaResultSetColumn();
    if (!meta.isComputedColumn(i)) {
      rsColumn.setColumnName(meta.getColumnName(i));
      rsColumn.setDataType(toModelDataType(meta.getColumnType(i)));
      rsColumn.setNativeName(meta.getColumnName(i));
      rsColumn.setPosition(new Integer(i));
      columnList.add(rsColumn);
    }
  }
  CompaibilityUtil.addResultSetColumn(dataSetHandle,columnList);
}
Program: 77115
Project: 77115
Buggy source:
public void getBIRTHome(String birtHome){
  properties.put(BIRT_HOME,birtHome);
}

Fixed version (ground truth):
public String getBIRTHome(){
  Object birtHome=properties.get(BIRT_HOME);
  if (birtHome instanceof String) {
    return (String)birtHome;
  }
  return null;
}
Program: 77116
Project: 77116
Buggy source:
public void transform(ITextContent textContent){
  String transformType=textContent.getComputedStyle().getTextTransform();
  if (transformType.equalsIgnoreCase("String_Node_Str")) {
    textContent.setText(textContent.getText().toUpperCase());
  }
 else   if (transformType.equalsIgnoreCase("String_Node_Str")) {
    textContent.setText(textContent.getText().toLowerCase());
  }
 else   if (transformType.equalsIgnoreCase("String_Node_Str")) {
    textContent.setText(capitalize(textContent.getText()));
  }
}

Fixed version (ground truth):
public void transform(ITextContent textContent){
  String transformType=textContent.getComputedStyle().getTextTransform();
  if (transformType.equalsIgnoreCase("String_Node_Str")) {
    textContent.setText(textContent.getText().toUpperCase());
  }
 else   if (transformType.equalsIgnoreCase("String_Node_Str")) {
    textContent.setText(textContent.getText().toLowerCase());
  }
 else   if (transformType.equalsIgnoreCase("String_Node_Str")) {
    textContent.setText(capitalize(textContent.getText()));
  }
  ArabicShaping shaping=new ArabicShaping(ArabicShaping.LETTERS_SHAPE);
  try {
    String shapingText=shaping.shape(textContent.getText());
    textContent.setText(shapingText);
  }
 catch (  ArabicShapingException e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
}