nus-yam/ex-repair huggingface dataset:
Program: 76274
Project: 76274
Buggy source:
/** 
 * does the output should keep the pagination. For some emitter, it will has its own pagination, so the report page reader only read out the page content and merge the contente together. The emitter will re-paginate the content again. Such as output PDF using HTML paginhints. Some emitter in the otherside, will use the same pagination with the page hint. For those emitter, the output will include the master pages. such as output HTML with the HTML emitter.
 * @param context context used to read the report.
 * @param pages page list
 * @param keepPaginate should the output keep pagianted.
 */
public ReportPageReader(ExecutionContext context,List pages,int paginationType){
  super(context);
  outputPages.addAll(pages);
  this.paginationType=paginationType;
  if (paginationType == IReportContentLoader.SINGLE_PAGE) {
    nextPage=1;
  }
}

Fixed version (ground truth):
/** 
 * does the output should keep the pagination. For some emitter, it will has its own pagination, so the report page reader only read out the page content and merge the contente together. The emitter will re-paginate the content again. Such as output PDF using HTML paginhints. Some emitter in the otherside, will use the same pagination with the page hint. For those emitter, the output will include the master pages. such as output HTML with the HTML emitter.
 * @param context context used to read the report.
 * @param pages page list
 * @param keepPaginate should the output keep pagianted.
 */
public ReportPageReader(ExecutionContext context,List pages,int paginationType){
  super(context);
  outputPages.addAll(pages);
  this.paginationType=paginationType;
  if (paginationType == IReportContentLoader.SINGLE_PAGE) {
    nextPage=1;
  }
  l18nVisitor=new LocalizedContentVisitor(context);
}
Program: 76275
Project: 76275
Buggy source:
public IPageContent createPage(long pageNumber,MasterPageDesign pageDesign){
  IPageContent pageContent=executor.createPage(pageNumber,pageDesign);
  if (pageContent != null) {
    l18nVisitor.localize(pageContent);
  }
  return pageContent;
}

Fixed version (ground truth):
public IPageContent createPage(long pageNumber,MasterPageDesign pageDesign){
  return createLocalizedPage(pageNumber,pageDesign);
}
Program: 76276
Project: 76276
Buggy source:
public LocalizedReportExecutor(ExecutionContext context,IReportExecutor executor){
  this.l18nVisitor=new LocalizedContentVisitor(context);
  this.manager=new LocalizedReportItemExecutorManager(l18nVisitor);
  this.executor=executor;
}

Fixed version (ground truth):
public LocalizedReportExecutor(ExecutionContext context,IReportExecutor executor){
  this.l18nVisitor=new LocalizedContentVisitor(context);
  this.manager=new LocalizedReportItemExecutorManager(l18nVisitor);
  this.executor=executor;
  this.context=context;
  this.executorContext=new ExecutorContext(context);
}
Program: 76277
Project: 76277
Buggy source:
public Object visitPage(IPageContent page,Object value){
  context.setExecutingMasterPage(true);
  value=localizeAllChildren(page);
  context.setExecutingMasterPage(false);
  return value;
}

Fixed version (ground truth):
public Object visitPage(IPageContent page,Object value){
  return page;
}
Program: 76278
Project: 76278
Buggy source:
/** 
 * @param query
 * @param resultMetaList
 * @param levelNameColumnNamePair
 * @param hierHandle
 */
private void prepareLevels(QueryDefinition query,List resultMetaList,Map levelNameColumnNamePair,TabularHierarchyHandle hierHandle){
  List levels=hierHandle.getContents(TabularHierarchyHandle.LEVELS_PROP);
  for (int j=0; j < levels.size(); j++) {
    TabularLevelHandle level=(TabularLevelHandle)levels.get(j);
    ColumnMeta temp=new ColumnMeta(level.getName());
    resultMetaList.add(temp);
    levelNameColumnNamePair.put(level.getColumnName(),temp);
    Iterator it=level.attributesIterator();
    while (it.hasNext()) {
      LevelAttributeHandle levelAttr=(LevelAttributeHandle)it.next();
      ColumnMeta meta=new ColumnMeta(level.getName() + "String_Node_Str" + levelAttr.getName());
      meta.setDataType(ModelAdapter.adaptModelDataType(levelAttr.getDataType()));
      query.addResultSetExpression(meta.getName(),new ScriptExpression(ExpressionUtil.createJSDataSetRowExpression(levelAttr.getName())));
      resultMetaList.add(meta);
    }
    GroupDefinition gd=new GroupDefinition();
    gd.setKeyExpression(ExpressionUtil.createJSRowExpression(level.getName()));
    query.addResultSetExpression(level.getName(),new ScriptExpression(ExpressionUtil.createJSDataSetRowExpression(level.getColumnName())));
    query.addGroup(gd);
  }
}

Fixed version (ground truth):
/** 
 * @param query
 * @param resultMetaList
 * @param levelNameColumnNamePair
 * @param hierHandle
 */
private void prepareLevels(QueryDefinition query,List resultMetaList,Map levelNameColumnNamePair,TabularHierarchyHandle hierHandle){
  List levels=hierHandle.getContents(TabularHierarchyHandle.LEVELS_PROP);
  for (int j=0; j < levels.size(); j++) {
    TabularLevelHandle level=(TabularLevelHandle)levels.get(j);
    ColumnMeta temp=new ColumnMeta(level.getColumnName());
    resultMetaList.add(temp);
    levelNameColumnNamePair.put(level.getColumnName(),temp);
    Iterator it=level.attributesIterator();
    while (it.hasNext()) {
      LevelAttributeHandle levelAttr=(LevelAttributeHandle)it.next();
      ColumnMeta meta=new ColumnMeta(level.getName() + "String_Node_Str" + levelAttr.getName());
      meta.setDataType(ModelAdapter.adaptModelDataType(levelAttr.getDataType()));
      query.addResultSetExpression(meta.getName(),new ScriptExpression(ExpressionUtil.createJSDataSetRowExpression(levelAttr.getName())));
      resultMetaList.add(meta);
    }
    GroupDefinition gd=new GroupDefinition();
    gd.setKeyExpression(ExpressionUtil.createJSRowExpression(level.getColumnName()));
    query.addResultSetExpression(level.getColumnName(),new ScriptExpression(ExpressionUtil.createJSDataSetRowExpression(level.getColumnName())));
    query.addGroup(gd);
  }
}
Program: 76279
Project: 76279
Buggy source:
/** 
 * Convert parameter to Object
 * @param dataType
 * @param format
 * @param value
 * @param locale
 * @param isLocale indicate whether it is a locale string
 * @return Object
 * @throws ValidationValueException
 */
public static Object validate(String dataType,String format,String value,Locale locale,boolean isLocale) throws ValidationValueException {
  Object obj=null;
  if (value == null)   return obj;
  if (isLocale) {
    try {
      obj=ParameterValidationUtil.validate(dataType,format,value,locale);
    }
 catch (    ValidationValueException e1) {
      String defFormat=null;
      if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equalsIgnoreCase(dataType)) {
        defFormat=ParameterValidationUtil.DEFAULT_DATETIME_FORMAT;
      }
      obj=ParameterValidationUtil.validate(dataType,defFormat,value);
    }
  }
 else {
    format=null;
    if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equalsIgnoreCase(dataType)) {
      format=ParameterValidationUtil.DEFAULT_DATETIME_FORMAT;
    }
    obj=ParameterValidationUtil.validate(dataType,format,value);
  }
  return obj;
}

Fixed version (ground truth):
/** 
 * Convert parameter to Object
 * @param dataType
 * @param format
 * @param value
 * @param locale
 * @param isLocale indicate whether it is a locale string
 * @return Object
 * @throws ValidationValueException
 */
public static Object validate(String dataType,String format,String value,Locale locale,boolean isLocale) throws ValidationValueException {
  Object obj=null;
  if (value == null)   return obj;
  String defFormat=null;
  if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equalsIgnoreCase(dataType)) {
    defFormat=ParameterValidationUtil.DEFAULT_DATETIME_FORMAT;
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DATE.equalsIgnoreCase(dataType)) {
    defFormat=ParameterValidationUtil.DEFAULT_DATE_FORMAT;
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_TIME.equalsIgnoreCase(dataType)) {
    defFormat=ParameterValidationUtil.DEFAULT_TIME_FORMAT;
  }
  if (isLocale) {
    try {
      if (format == null) {
        if (DesignChoiceConstants.PARAM_TYPE_DATE.equalsIgnoreCase(dataType)) {
          format=ParameterValidationUtil.DISPLAY_DATE_FORMAT;
        }
 else         if (DesignChoiceConstants.PARAM_TYPE_TIME.equalsIgnoreCase(dataType)) {
          format=ParameterValidationUtil.DISPLAY_TIME_FORMAT;
        }
 else         if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equalsIgnoreCase(dataType)) {
          format=DesignChoiceConstants.DATETIEM_FORMAT_TYPE_UNFORMATTED;
        }
      }
      obj=ParameterValidationUtil.validate(dataType,format,value,locale);
    }
 catch (    Exception e) {
      obj=ParameterValidationUtil.validate(dataType,defFormat,value);
    }
  }
 else {
    obj=ParameterValidationUtil.validate(dataType,defFormat,value);
  }
  return obj;
}
Program: 76280
Project: 76280
Buggy source:
public static int toDteDataType(String modelDataType){
  if (modelDataType == null)   return DataType.UNKNOWN_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_ANY))   return DataType.ANY_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER))   return DataType.INTEGER_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_STRING))   return DataType.STRING_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME))   return DataType.DATE_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DECIMAL))   return DataType.DECIMAL_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_FLOAT))   return DataType.DOUBLE_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_BOOLEAN))   return DataType.BOOLEAN_TYPE;
  return DataType.UNKNOWN_TYPE;
}

Fixed version (ground truth):
public static int toDteDataType(String modelDataType){
  if (modelDataType == null)   return DataType.UNKNOWN_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_ANY))   return DataType.ANY_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER))   return DataType.INTEGER_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_STRING))   return DataType.STRING_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME))   return DataType.DATE_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DATE))   return DataType.SQL_DATE_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_TIME))   return DataType.SQL_TIME_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DECIMAL))   return DataType.DECIMAL_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_FLOAT))   return DataType.DOUBLE_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_BOOLEAN))   return DataType.BOOLEAN_TYPE;
  return DataType.UNKNOWN_TYPE;
}
Program: 76282
Project: 76282
Buggy source:
protected Object convertToType(Object value,String type){
  try {
    if (DesignChoiceConstants.PARAM_TYPE_BOOLEAN.equals(type)) {
      return DataTypeUtil.toBoolean(value);
    }
 else     if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type)) {
      return DataTypeUtil.toDate(value);
    }
 else     if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(type)) {
      return DataTypeUtil.toBigDecimal(value);
    }
 else     if (DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(type)) {
      return DataTypeUtil.toDouble(value);
    }
 else     if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type)) {
      return DataTypeUtil.toString(value);
    }
 else     if (DesignChoiceConstants.PARAM_TYPE_INTEGER.equals(type)) {
      return DataTypeUtil.toInteger(value);
    }
    return value;
  }
 catch (  BirtException e) {
    log.log(Level.SEVERE,e.getLocalizedMessage(),e);
  }
  return null;
}

Fixed version (ground truth):
protected Object convertToType(Object value,String type){
  try {
    if (DesignChoiceConstants.PARAM_TYPE_BOOLEAN.equals(type)) {
      return DataTypeUtil.toBoolean(value);
    }
 else     if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type)) {
      return DataTypeUtil.toDate(value);
    }
 else     if (DesignChoiceConstants.PARAM_TYPE_DATE.equals(type)) {
      return DataTypeUtil.toSqlDate(value);
    }
 else     if (DesignChoiceConstants.PARAM_TYPE_TIME.equals(type)) {
      return DataTypeUtil.toSqlTime(value);
    }
 else     if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(type)) {
      return DataTypeUtil.toBigDecimal(value);
    }
 else     if (DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(type)) {
      return DataTypeUtil.toDouble(value);
    }
 else     if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type)) {
      return DataTypeUtil.toString(value);
    }
 else     if (DesignChoiceConstants.PARAM_TYPE_INTEGER.equals(type)) {
      return DataTypeUtil.toInteger(value);
    }
    return value;
  }
 catch (  BirtException e) {
    log.log(Level.SEVERE,e.getLocalizedMessage(),e);
  }
  return null;
}
Program: 76284
Project: 76284
Buggy source:
/** 
 * convert the string to value.
 * @param value value string
 * @param valueType value type
 * @return object with the specified value
 */
private Object getStringValue(String value,String valueType){
  try {
    if (DesignChoiceConstants.PARAM_TYPE_BOOLEAN.equals(valueType))     return DataTypeUtil.toBoolean(value);
    if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(valueType))     return DataTypeUtil.toDate(value);
    if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(valueType))     return DataTypeUtil.toBigDecimal(value);
    if (DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(valueType))     return DataTypeUtil.toDouble(value);
    if (DesignChoiceConstants.PARAM_TYPE_INTEGER.equals(valueType))     return DataTypeUtil.toInteger(value);
  }
 catch (  BirtException e) {
    log.log(Level.SEVERE,e.getLocalizedMessage(),e);
  }
  return value;
}

Fixed version (ground truth):
/** 
 * convert the string to value.
 * @param value value string
 * @param valueType value type
 * @return object with the specified value
 */
private Object getStringValue(String value,String valueType){
  try {
    if (DesignChoiceConstants.PARAM_TYPE_BOOLEAN.equals(valueType))     return DataTypeUtil.toBoolean(value);
    if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(valueType))     return DataTypeUtil.toDate(value);
    if (DesignChoiceConstants.PARAM_TYPE_DATE.equals(valueType))     return DataTypeUtil.toSqlDate(value);
    if (DesignChoiceConstants.PARAM_TYPE_TIME.equals(valueType))     return DataTypeUtil.toSqlTime(value);
    if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(valueType))     return DataTypeUtil.toBigDecimal(value);
    if (DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(valueType))     return DataTypeUtil.toDouble(value);
    if (DesignChoiceConstants.PARAM_TYPE_INTEGER.equals(valueType))     return DataTypeUtil.toInteger(value);
  }
 catch (  BirtException e) {
    log.log(Level.SEVERE,e.getLocalizedMessage(),e);
  }
  return value;
}
Program: 76285
Project: 76285
Buggy source:
protected void setupLayoutOptions(){
  Object fitToPage=options.get(IPDFRenderOption.FIT_TO_PAGE);
  if (fitToPage != null && fitToPage instanceof Boolean) {
    if (((Boolean)fitToPage).booleanValue()) {
      context.setFitToPage(true);
    }
  }
  Object pageBreakOnly=options.get(IPDFRenderOption.PAGEBREAK_PAGINATION_ONLY);
  if (pageBreakOnly != null && pageBreakOnly instanceof Boolean) {
    if (((Boolean)pageBreakOnly).booleanValue()) {
      context.setPagebreakPaginationOnly(true);
    }
  }
}

Fixed version (ground truth):
protected void setupLayoutOptions(){
  Object fitToPage=options.get(IPDFRenderOption.FIT_TO_PAGE);
  if (fitToPage != null && fitToPage instanceof Boolean) {
    if (((Boolean)fitToPage).booleanValue()) {
      context.setFitToPage(true);
    }
  }
  Object pageBreakOnly=options.get(IPDFRenderOption.PAGEBREAK_PAGINATION_ONLY);
  if (pageBreakOnly != null && pageBreakOnly instanceof Boolean) {
    if (((Boolean)pageBreakOnly).booleanValue()) {
      context.setPagebreakPaginationOnly(true);
    }
  }
  context.setFitToPage(true);
  context.setPagebreakPaginationOnly(true);
}
Program: 76286
Project: 76286
Buggy source:
public void testLogger() throws Exception {
  Logger logger=Logger.getAnonymousLogger();
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  StreamHandler handler=new StreamHandler(out,new SimpleFormatter());
  handler.setLevel(Level.FINEST);
  logger.addHandler(handler);
  logger.setLevel(Level.FINE);
  engine.setLogger(logger);
  new File("String_Node_Str").mkdirs();
  copyResource("String_Node_Str","String_Node_Str");
  IReportRunnable runnable=engine.openReportDesign("String_Node_Str");
  IRunTask task=engine.createRunTask(runnable);
  task.setParameter("String_Node_Str","String_Node_Str","String_Node_Str");
  task.run("String_Node_Str");
  task.close();
  engine.setLogger(logger);
  removeFile("String_Node_Str");
  handler.close();
  System.out.println(out.toString());
  assertTrue(out.toString().contains("String_Node_Str"));
}

Fixed version (ground truth):
public void testLogger() throws Exception {
  Logger logger=Logger.getAnonymousLogger();
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  StreamHandler handler=new StreamHandler(out,new SimpleFormatter());
  handler.setLevel(Level.FINEST);
  logger.addHandler(handler);
  logger.setLevel(Level.FINE);
  engine.setLogger(logger);
  new File("String_Node_Str").mkdirs();
  copyResource("String_Node_Str","String_Node_Str");
  IReportRunnable runnable=engine.openReportDesign("String_Node_Str");
  IRunTask task=engine.createRunTask(runnable);
  task.setParameter("String_Node_Str","String_Node_Str","String_Node_Str");
  task.run("String_Node_Str");
  task.close();
  engine.setLogger(logger);
  removeFile("String_Node_Str");
  handler.close();
  System.out.println(out.toString());
  assertTrue(out.toString().indexOf("String_Node_Str") != -1);
}
Program: 76287
Project: 76287
Buggy source:
/** 
 * Get all EdgeCursor of a CubeCursor.
 * @param cursor
 * @return
 * @throws OLAPException
 */
private static List getAllEdges(CubeCursor cursor) throws OLAPException {
  List ordinateEdge=cursor.getOrdinateEdge();
  ordinateEdge.addAll(cursor.getPageEdge());
  return ordinateEdge;
}

Fixed version (ground truth):
/** 
 * Get all EdgeCursor of a CubeCursor.
 * @param cursor
 * @return
 * @throws OLAPException
 */
private static List getAllEdges(CubeCursor cursor) throws OLAPException {
  List ordinateEdge=new ArrayList();
  ordinateEdge.addAll(cursor.getOrdinateEdge());
  ordinateEdge.addAll(cursor.getPageEdge());
  return ordinateEdge;
}
Program: 76288
Project: 76288
Buggy source:
/** 
 * Set cube cursor to a given position. A cube cursor's position is decided by its edge cursors.
 * @param cursor
 * @param position
 * @throws OLAPException 
 * @throws EngineException 
 */
public static void positionCursor(CubeCursor cursor,String position) throws OLAPException, EngineException {
  if (position == null || position.trim().length() == 0)   return;
  String[] positions=position.split("String_Node_Str" + POSITION_DELIMITER + "String_Node_Str");
  List edges=getAllEdges(cursor);
  if (positions.length != edges.size())   throw new EngineException("String_Node_Str" + position);
  for (int i=0; i < edges.size(); i++) {
    ((EdgeCursor)edges.get(i)).setPosition(new Long(positions[i]).longValue());
  }
}

Fixed version (ground truth):
/** 
 * Set cube cursor to a given position. A cube cursor's position is decided by its edge cursors.
 * @param cursor
 * @param position
 * @throws OLAPException 
 * @throws EngineException 
 */
public static void positionCursor(CubeCursor cursor,String position) throws OLAPException, EngineException {
  if (position == null || position.trim().length() == 0)   return;
  if (position.startsWith("String_Node_Str")) {
    position=position.substring(2);
  }
  String[] positions=position.split("String_Node_Str" + POSITION_DELIMITER + "String_Node_Str");
  List edges=getAllEdges(cursor);
  if (positions.length != edges.size())   throw new EngineException("String_Node_Str" + position);
  for (int i=0; i < edges.size(); i++) {
    ((EdgeCursor)edges.get(i)).setPosition(new Long(positions[i]).longValue());
  }
}
Program: 76289
Project: 76289
Buggy source:
/** 
 * Get the position id of a CubeCursor. The position id is decided by the combination of edge cursors.
 * @param cursor
 * @return
 * @throws OLAPException
 */
public static String getPositionID(CubeCursor cursor) throws OLAPException {
  String result="String_Node_Str";
  List ordinateEdge=getAllEdges(cursor);
  for (int i=0; i < ordinateEdge.size(); i++) {
    EdgeCursor edge=(EdgeCursor)ordinateEdge.get(i);
    result+=POSITION_DELIMITER + edge.getPosition();
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Get the position id of a CubeCursor. The position id is decided by the combination of edge cursors.
 * @param cursor
 * @return
 * @throws OLAPException
 */
public static String getPositionID(CubeCursor cursor) throws OLAPException {
  StringBuffer result=new StringBuffer();
  List ordinateEdge=getAllEdges(cursor);
  for (int i=0; i < ordinateEdge.size(); i++) {
    EdgeCursor edge=(EdgeCursor)ordinateEdge.get(i);
    result.append(POSITION_DELIMITER);
    result.append(edge.getPosition());
  }
  return result.toString();
}
Program: 76290
Project: 76290
Buggy source:
static DataID parse(char[] buffer,int offset,int length){
  int ptr=offset + length - 1;
  while (ptr >= offset && buffer[ptr] != ':') {
    ptr--;
  }
  if (ptr >= offset && buffer[ptr] == ':') {
    String strRowId=new String(buffer,ptr + 1,offset + length - ptr - 1);
    ptr--;
    if (ptr >= offset) {
      DataSetID dataSetId=DataSetID.parse(buffer,offset,ptr - offset + 1);
      if (dataSetId != null) {
        try {
          long rowId=Long.parseLong(strRowId);
          return new DataID(dataSetId,rowId);
        }
 catch (        Exception ex) {
        }
        return new DataID(dataSetId,strRowId);
      }
    }
  }
  return null;
}

Fixed version (ground truth):
static DataID parse(char[] buffer,int offset,int length){
  int ptr=offset + length - 1;
  while (ptr >= offset) {
    if (buffer[ptr] != ':') {
      ptr--;
    }
 else {
      if (ptr > offset && buffer[ptr - 1] == ':') {
        ptr--;
        ptr--;
      }
 else {
        break;
      }
    }
  }
  if (ptr >= offset && buffer[ptr] == ':') {
    String strRowId=new String(buffer,ptr + 1,offset + length - ptr - 1);
    ptr--;
    if (ptr >= offset) {
      DataSetID dataSetId=DataSetID.parse(buffer,offset,ptr - offset + 1);
      if (dataSetId != null) {
        try {
          long rowId=Long.parseLong(strRowId);
          return new DataID(dataSetId,rowId);
        }
 catch (        Exception ex) {
        }
        return new DataID(dataSetId,strRowId);
      }
    }
  }
  return null;
}
Program: 76291
Project: 76291
Buggy source:
/** 
 * add the instance id to the string buffer. It is a util class used by other internal packages.
 * @param buffer
 */
public void append(StringBuffer buffer){
  if (dataSet != null) {
    dataSet.append(buffer);
  }
  buffer.append("String_Node_Str");
  buffer.append(rowId);
}

Fixed version (ground truth):
/** 
 * add the instance id to the string buffer. It is a util class used by other internal packages.
 * @param buffer
 */
public void append(StringBuffer buffer){
  if (dataSet != null) {
    dataSet.append(buffer);
  }
  buffer.append("String_Node_Str");
  if (rowId != -1) {
    buffer.append(rowId);
  }
 else {
    buffer.append(cellId);
  }
}
Program: 76292
Project: 76292
Buggy source:
protected IBaseResultSet doExecuteCube(IBaseResultSet parentResult,ICubeQueryDefinition query){
  String queryID=(String)queryIDMap.get(query);
  try {
    String resultSetID=loadResultSetID(parentResult,queryID);
    if (resultSetID == null) {
      logger.log(Level.SEVERE,"String_Node_Str");
      return null;
    }
    IBaseQueryResults queryResults=dteSession.getQueryResults(resultSetID);
    CubeResultSet resultSet=null;
    if (parentResult == null) {
      resultSet=new CubeResultSet(this,context,query,(ICubeQueryResults)queryResults);
    }
 else {
      resultSet=new CubeResultSet(this,context,resultSet,query,(ICubeQueryResults)queryResults);
    }
    return resultSet;
  }
 catch (  BirtException be) {
    logger.log(Level.SEVERE,be.getMessage());
    context.addException(be);
    return null;
  }
}

Fixed version (ground truth):
protected IBaseResultSet doExecuteCube(IBaseResultSet parentResult,ICubeQueryDefinition query){
  String queryID=(String)queryIDMap.get(query);
  try {
    String resultSetID=loadResultSetID(parentResult,queryID);
    IBaseQueryResults queryResults=null;
    if (resultSetID == null) {
      IBasePreparedQuery pQuery=dteSession.prepare(query,context.getAppContext());
      if (parentResult != null) {
        queryResults=dteSession.execute(pQuery,parentResult.getQueryResults(),context.getSharedScope());
      }
 else {
        queryResults=dteSession.execute(pQuery,null,context.getSharedScope());
      }
    }
 else {
      queryResults=dteSession.getQueryResults(resultSetID);
    }
    CubeResultSet resultSet=null;
    if (parentResult == null) {
      resultSet=new CubeResultSet(this,context,query,(ICubeQueryResults)queryResults);
    }
 else {
      resultSet=new CubeResultSet(this,context,resultSet,query,(ICubeQueryResults)queryResults);
    }
    return resultSet;
  }
 catch (  BirtException be) {
    logger.log(Level.SEVERE,be.getMessage());
    context.addException(be);
    return null;
  }
}
Program: 76293
Project: 76293
Buggy source:
public Object visitExtendedItem(ExtendedItemDesign item,Object value){
  ExtendedItemHandle handle=(ExtendedItemHandle)item.getHandle();
  String tagName=handle.getExtensionName();
  IReportItemQuery itemQuery=ExtensionManager.getInstance().createQueryItem(tagName);
  IDataQueryDefinition[] queries=null;
  IDataQueryDefinition parentQuery=(IDataQueryDefinition)value;
  if (itemQuery != null) {
    try {
      itemQuery.setModelObject(handle);
      itemQuery.setQueryContext(queryContext);
      queries=itemQuery.createReportQueries(parentQuery);
    }
 catch (    BirtException ex) {
      logger.log(Level.WARNING,ex.getMessage(),ex);
    }
    if (queries != null) {
      if (queries.length > 0) {
        IDataQueryDefinition query=queries[0];
        if (query instanceof IBaseQueryDefinition) {
          transformExpressions(item,(IBaseQueryDefinition)query,null);
        }
      }
      return queries;
    }
  }
  BaseQueryDefinition query=createQuery(item,parentQuery);
  finishVisit(item,query);
  if (query != value) {
    return new IBaseQueryDefinition[]{query};
  }
  return null;
}

Fixed version (ground truth):
public Object visitExtendedItem(ExtendedItemDesign item,Object value){
  ExtendedItemHandle handle=(ExtendedItemHandle)item.getHandle();
  String tagName=handle.getExtensionName();
  IReportItemQuery itemQuery=ExtensionManager.getInstance().createQueryItem(tagName);
  IDataQueryDefinition[] queries=null;
  IDataQueryDefinition parentQuery=(IDataQueryDefinition)value;
  if (itemQuery != null) {
    try {
      itemQuery.setModelObject(handle);
      itemQuery.setQueryContext(queryContext);
      queries=itemQuery.createReportQueries(parentQuery);
    }
 catch (    BirtException ex) {
      logger.log(Level.WARNING,ex.getMessage(),ex);
    }
    if (queries != null) {
      if (queries.length > 0) {
        IDataQueryDefinition query=queries[0];
        if (query instanceof IBaseQueryDefinition) {
          transformExpressions(item,(IBaseQueryDefinition)query,null);
        }
      }
      return queries;
    }
  }
  BaseQueryDefinition query=createQuery(item,parentQuery);
  finishVisit(item,query);
  return getResultQuery(query,value);
}
Program: 76294
Project: 76294
Buggy source:
public Object visitGridItem(GridItemDesign grid,Object value){
  BaseQueryDefinition query=createQuery(grid,value);
  for (int i=0; i < grid.getRowCount(); i++) {
    build(query,grid.getRow(i));
  }
  finishVisit(grid,query);
  if (query != value) {
    return new IBaseQueryDefinition[]{query};
  }
  return null;
}

Fixed version (ground truth):
public Object visitGridItem(GridItemDesign grid,Object value){
  BaseQueryDefinition query=createQuery(grid,value);
  for (int i=0; i < grid.getRowCount(); i++) {
    build(query,grid.getRow(i));
  }
  finishVisit(grid,query);
  return getResultQuery(query,value);
}
Program: 76295
Project: 76295
Buggy source:
public Object visitDynamicTextItem(DynamicTextItemDesign dynamicText,Object value){
  BaseQueryDefinition query=createQuery(dynamicText,value);
  String newContent=transformExpression(dynamicText.getContent(),query,null);
  dynamicText.setContent(newContent);
  finishVisit(dynamicText,query);
  if (query != value) {
    return new IBaseQueryDefinition[]{query};
  }
  return null;
}

Fixed version (ground truth):
public Object visitDynamicTextItem(DynamicTextItemDesign dynamicText,Object value){
  BaseQueryDefinition query=createQuery(dynamicText,value);
  String newContent=transformExpression(dynamicText.getContent(),query,null);
  dynamicText.setContent(newContent);
  finishVisit(dynamicText,query);
  return getResultQuery(query,value);
}
Program: 76296
Project: 76296
Buggy source:
/** 
 * handles a cell in a row
 */
public Object visitCell(CellDesign cell,Object value){
  BaseQueryDefinition query=createQuery(cell,value);
  for (int i=0; i < cell.getContentCount(); i++) {
    build(query,cell.getContent(i));
  }
  finishVisit(cell,query);
  if (query != value) {
    return new IBaseQueryDefinition[]{query};
  }
  return null;
}

Fixed version (ground truth):
/** 
 * handles a cell in a row
 */
public Object visitCell(CellDesign cell,Object value){
  BaseQueryDefinition query=createQuery(cell,value);
  for (int i=0; i < cell.getContentCount(); i++) {
    build(query,cell.getContent(i));
  }
  finishVisit(cell,query);
  return getResultQuery(query,value);
}
Program: 76297
Project: 76297
Buggy source:
public Object visitDataItem(DataItemDesign data,Object value){
  BaseQueryDefinition query=createQuery(data,value);
  finishVisit(data,query);
  if (query != value) {
    return new IBaseQueryDefinition[]{query};
  }
  return null;
}

Fixed version (ground truth):
public Object visitDataItem(DataItemDesign data,Object value){
  BaseQueryDefinition query=createQuery(data,value);
  finishVisit(data,query);
  return getResultQuery(query,value);
}
Program: 76298
Project: 76298
Buggy source:
public Object visitLabelItem(LabelItemDesign label,Object value){
  BaseQueryDefinition query=createQuery(label,value);
  finishVisit(label,query);
  if (query != value) {
    return new IBaseQueryDefinition[]{query};
  }
  return null;
}

Fixed version (ground truth):
public Object visitLabelItem(LabelItemDesign label,Object value){
  BaseQueryDefinition query=createQuery(label,value);
  finishVisit(label,query);
  return getResultQuery(query,value);
}
Program: 76299
Project: 76299
Buggy source:
public Object visitFreeFormItem(FreeFormItemDesign container,Object value){
  BaseQueryDefinition query=createQuery(container,value);
  for (int i=0; i < container.getItemCount(); i++)   build(query,container.getItem(i));
  finishVisit(container,query);
  if (query != value) {
    return new IBaseQueryDefinition[]{query};
  }
  return null;
}

Fixed version (ground truth):
public Object visitFreeFormItem(FreeFormItemDesign container,Object value){
  BaseQueryDefinition query=createQuery(container,value);
  for (int i=0; i < container.getItemCount(); i++)   build(query,container.getItem(i));
  finishVisit(container,query);
  return getResultQuery(query,value);
}
Program: 76300
Project: 76300
Buggy source:
public Object visitListItem(ListItemDesign list,Object value){
  BaseQueryDefinition query=createQuery(list,value);
  if (query == null) {
    handleListingBand(list.getHeader(),query,true,null);
    handleListingBand(list.getFooter(),query,true,null);
  }
 else {
    handleListingBand(list.getHeader(),query,true,null);
    SlotHandle groupsSlot=((ListHandle)list.getHandle()).getGroups();
    for (int i=0; i < list.getGroupCount(); i++) {
      handleListingGroup(list.getGroup(i),(GroupHandle)groupsSlot.get(i),query);
    }
    BandDesign detail=list.getDetail();
    if (detail == null || detail.getContentCount() == 0) {
      query.setUsesDetails(false);
    }
    handleListingBand(detail,query,false,null);
    handleListingBand(list.getFooter(),query,true,null);
  }
  finishVisit(list,query);
  if (query != value) {
    return new IBaseQueryDefinition[]{query};
  }
  return null;
}

Fixed version (ground truth):
public Object visitListItem(ListItemDesign list,Object value){
  BaseQueryDefinition query=createQuery(list,value);
  if (query == null) {
    handleListingBand(list.getHeader(),query,true,null);
    handleListingBand(list.getFooter(),query,true,null);
  }
 else {
    handleListingBand(list.getHeader(),query,true,null);
    SlotHandle groupsSlot=((ListHandle)list.getHandle()).getGroups();
    for (int i=0; i < list.getGroupCount(); i++) {
      handleListingGroup(list.getGroup(i),(GroupHandle)groupsSlot.get(i),query);
    }
    BandDesign detail=list.getDetail();
    if (detail == null || detail.getContentCount() == 0) {
      query.setUsesDetails(false);
    }
    handleListingBand(detail,query,false,null);
    handleListingBand(list.getFooter(),query,true,null);
  }
  finishVisit(list,query);
  return getResultQuery(query,value);
}
Program: 76301
Project: 76301
Buggy source:
/** 
 * @param band the list band
 */
public void handleListingBand(BandDesign band,IBaseQueryDefinition query,boolean onGroup,IGroupDefinition groupDefn){
  if (band != null) {
    ArrayList subQueries=(ArrayList)((ArrayList)query.getSubqueries()).clone();
    for (int i=0; i < band.getContentCount(); i++) {
      build(query,band.getContent(i));
    }
    ArrayList subQueriesChanged=(ArrayList)query.getSubqueries();
    if (subQueriesChanged != null) {
      for (int i=0; i < subQueriesChanged.size(); i++) {
        SubqueryDefinition subQuery=(SubqueryDefinition)subQueriesChanged.get(i);
        if (!subQueries.contains(subQuery) && subQuery instanceof SubqueryDefinition) {
          ((SubqueryDefinition)subQuery).setApplyOnGroupFlag(onGroup);
          if (groupDefn != null) {
            subQueriesChanged.remove(subQuery);
            groupDefn.getSubqueries().add(subQuery);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Set the onGroup to the query. Remove the added subQueries from the subQueries of BaseQueryDefinition to GroupDefinition. This is because DTE want to know subQueries is on group or detail. And the subQueries in group must be added to the GroupDefinition, but their parents all should be BaseQueryDefinition. TODO: the relation may be too complex and the arithmetic also be too ugly. Need to talk with DTE about the relations and change the arithmetic be simple.
 * @param band
 * @param query
 * @param onGroup
 * @param groupDefn
 */
public void handleListingBand(BandDesign band,IBaseQueryDefinition query,boolean onGroup,IGroupDefinition groupDefn){
  if (band != null) {
    ArrayList subQueries=(ArrayList)((ArrayList)query.getSubqueries()).clone();
    for (int i=0; i < band.getContentCount(); i++) {
      build(query,band.getContent(i));
    }
    ArrayList subQueriesChanged=(ArrayList)query.getSubqueries();
    if (subQueriesChanged != null) {
      for (int i=0; i < subQueriesChanged.size(); i++) {
        SubqueryDefinition subQuery=(SubqueryDefinition)subQueriesChanged.get(i);
        if (!subQueries.contains(subQuery) && subQuery instanceof SubqueryDefinition) {
          ((SubqueryDefinition)subQuery).setApplyOnGroupFlag(onGroup);
          if (groupDefn != null) {
            subQueriesChanged.remove(subQuery);
            groupDefn.getSubqueries().add(subQuery);
            i--;
          }
        }
      }
    }
  }
}
Program: 76302
Project: 76302
Buggy source:
public Object visitImageItem(ImageItemDesign image,Object value){
  BaseQueryDefinition query=createQuery(image,value);
  if (image.getImageSource() == ImageItemDesign.IMAGE_EXPRESSION) {
    String newImageExpression=transformExpression(image.getImageExpression(),query,null);
    String newImageFormat=transformExpression(image.getImageFormat(),query,null);
    image.setImageExpression(newImageExpression,newImageFormat);
  }
 else   if (image.getImageSource() == ImageItemDesign.IMAGE_URI) {
    String newImageUri=transformExpression(image.getImageUri(),query,null);
    image.setImageUri(newImageUri);
  }
 else   if (image.getImageSource() == ImageItemDesign.IMAGE_FILE) {
    String newImageUri=transformExpression(image.getImageUri(),query,null);
    image.setImageFile(newImageUri);
  }
  finishVisit(image,query);
  if (query != value) {
    return new IBaseQueryDefinition[]{query};
  }
  return null;
}

Fixed version (ground truth):
public Object visitImageItem(ImageItemDesign image,Object value){
  BaseQueryDefinition query=createQuery(image,value);
  if (image.getImageSource() == ImageItemDesign.IMAGE_EXPRESSION) {
    String newImageExpression=transformExpression(image.getImageExpression(),query,null);
    String newImageFormat=transformExpression(image.getImageFormat(),query,null);
    image.setImageExpression(newImageExpression,newImageFormat);
  }
 else   if (image.getImageSource() == ImageItemDesign.IMAGE_URI) {
    String newImageUri=transformExpression(image.getImageUri(),query,null);
    image.setImageUri(newImageUri);
  }
 else   if (image.getImageSource() == ImageItemDesign.IMAGE_FILE) {
    String newImageUri=transformExpression(image.getImageUri(),query,null);
    image.setImageFile(newImageUri);
  }
  finishVisit(image,query);
  return getResultQuery(query,value);
}
Program: 76303
Project: 76303
Buggy source:
public Object visitTableItem(TableItemDesign table,Object value){
  BaseQueryDefinition query=createQuery(table,value);
  if (query == null) {
    handleListingBand(table.getHeader(),query,true,null);
    handleListingBand(table.getFooter(),query,true,null);
  }
 else {
    for (int i=0; i < table.getColumnCount(); i++) {
      handleColumn(table.getColumn(i),query);
    }
    handleListingBand(table.getHeader(),query,true,null);
    SlotHandle groupsSlot=((TableHandle)table.getHandle()).getGroups();
    for (int i=0; i < table.getGroupCount(); i++) {
      handleListingGroup(table.getGroup(i),(GroupHandle)groupsSlot.get(i),query);
    }
    BandDesign detail=table.getDetail();
    if (detail == null || detail.getContentCount() == 0) {
      query.setUsesDetails(false);
    }
    handleListingBand(detail,query,false,null);
    handleListingBand(table.getFooter(),query,true,null);
  }
  finishVisit(table,query);
  return new IBaseQueryDefinition[]{query};
}

Fixed version (ground truth):
public Object visitTableItem(TableItemDesign table,Object value){
  BaseQueryDefinition query=createQuery(table,value);
  if (query == null) {
    handleListingBand(table.getHeader(),query,true,null);
    handleListingBand(table.getFooter(),query,true,null);
  }
 else {
    for (int i=0; i < table.getColumnCount(); i++) {
      handleColumn(table.getColumn(i),query);
    }
    handleListingBand(table.getHeader(),query,true,null);
    SlotHandle groupsSlot=((TableHandle)table.getHandle()).getGroups();
    for (int i=0; i < table.getGroupCount(); i++) {
      handleListingGroup(table.getGroup(i),(GroupHandle)groupsSlot.get(i),query);
    }
    BandDesign detail=table.getDetail();
    if (detail == null || detail.getContentCount() == 0) {
      query.setUsesDetails(false);
    }
    handleListingBand(detail,query,false,null);
    handleListingBand(table.getFooter(),query,true,null);
  }
  finishVisit(table,query);
  return getResultQuery(query,value);
}
Program: 76304
Project: 76304
Buggy source:
/** 
 * visit content of a row
 */
public Object visitRow(RowDesign row,Object value){
  BaseQueryDefinition query=createQuery(row,value);
  for (int i=0; i < row.getCellCount(); i++) {
    CellDesign cell=row.getCell(i);
    build(query,cell);
  }
  finishVisit(row,query);
  if (query != value) {
    return new IBaseQueryDefinition[]{query};
  }
  return null;
}

Fixed version (ground truth):
/** 
 * visit content of a row
 */
public Object visitRow(RowDesign row,Object value){
  BaseQueryDefinition query=createQuery(row,value);
  for (int i=0; i < row.getCellCount(); i++) {
    CellDesign cell=row.getCell(i);
    build(query,cell);
  }
  finishVisit(row,query);
  return getResultQuery(query,value);
}
Program: 76305
Project: 76305
Buggy source:
/** 
 */
private void placeComponents(){
  FillLayout flMain=new FillLayout();
  flMain.marginHeight=0;
  flMain.marginWidth=0;
  GridLayout glContent=new GridLayout();
  glContent.verticalSpacing=0;
  glContent.horizontalSpacing=2;
  glContent.marginHeight=0;
  glContent.marginWidth=0;
  glContent.numColumns=2;
  this.setLayout(flMain);
  cmpContent=new Composite(this,SWT.NONE);
  cmpContent.setLayout(glContent);
  cnvSelection=new FontCanvas(cmpContent,SWT.BORDER,fdCurrent,cdCurrent,false,true,false);
  GridData gdCNVSelection=new GridData(GridData.FILL_HORIZONTAL);
  gdCNVSelection.heightHint=iSize;
  cnvSelection.setLayoutData(gdCNVSelection);
  cnvSelection.setToolTipText(TOOLTIP);
  cnvSelection.addMouseListener(new MouseAdapter(){
    public void mouseUp(    MouseEvent e){
      openFontDialog();
    }
  }
);
  btnFont=new Button(cmpContent,SWT.NONE);
  GridData gdBEllipsis=new GridData();
  gdBEllipsis.widthHint=20;
  gdBEllipsis.heightHint=20;
  btnFont.setLayoutData(gdBEllipsis);
  btnFont.setImage(UIHelper.getImage("String_Node_Str"));
  btnFont.setToolTipText(TOOLTIP);
  btnFont.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      openFontDialog();
    }
  }
);
}

Fixed version (ground truth):
/** 
 */
private void placeComponents(){
  FillLayout flMain=new FillLayout();
  flMain.marginHeight=0;
  flMain.marginWidth=0;
  GridLayout glContent=new GridLayout();
  glContent.verticalSpacing=0;
  glContent.horizontalSpacing=2;
  glContent.marginHeight=0;
  glContent.marginWidth=0;
  glContent.numColumns=2;
  this.setLayout(flMain);
  cmpContent=new Composite(this,SWT.NONE);
  cmpContent.setLayout(glContent);
  cnvSelection=new FontCanvas(cmpContent,SWT.BORDER,fdCurrent,cdCurrent,false,true,false);
  GridData gdCNVSelection=new GridData(GridData.FILL_HORIZONTAL);
  gdCNVSelection.heightHint=iSize;
  cnvSelection.setLayoutData(gdCNVSelection);
  cnvSelection.setToolTipText(TOOLTIP);
  cnvSelection.addMouseListener(new MouseAdapter(){
    public void mouseUp(    MouseEvent e){
      openFontDialog();
    }
  }
);
  btnFont=new Button(cmpContent,SWT.NONE);
  GridData gdBEllipsis=new GridData();
  gdBEllipsis.widthHint=20;
  gdBEllipsis.heightHint=20;
  btnFont.setLayoutData(gdBEllipsis);
  btnFont.setText("String_Node_Str");
  btnFont.setFont(new Font(Display.getCurrent(),"String_Node_Str",14,SWT.BOLD));
  btnFont.setToolTipText(TOOLTIP);
  btnFont.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      openFontDialog();
    }
  }
);
}
Program: 76307
Project: 76307
Buggy source:
/** 
 * @param title popup title
 * @param context wizard context
 * @param axis axis model
 * @param angleType indicate axis type, value is AngleType.X or AngleType.Y or AngleType.Z
 */
public AxisGridLinesSheet(String title,ChartWizardContext context,Axis axis,int angleType){
  super(title,context,false);
  this.axis=axis;
  this.angleType=angleType;
}

Fixed version (ground truth):
/** 
 * @param title popup title
 * @param context wizard context
 * @param axis axis model
 * @param angleType indicate axis type, value is AngleType.X or AngleType.Y or AngleType.Z
 */
public AxisGridLinesSheet(String title,ChartWizardContext context,Axis axis,int angleType){
  super(title,context,true);
  this.axis=axis;
  this.angleType=angleType;
}
Program: 76308
Project: 76308
Buggy source:
public FontInfo(BaseFont bf,float fontSize,int fontStyle,boolean simulation){
  this.bf=bf;
  this.fontSize=fontSize;
  this.fontStyle=fontStyle;
  this.fontPadding=fontSize / 5f;
  this.lineWidth=fontSize / 20f;
  this.simulation=simulation;
}

Fixed version (ground truth):
public FontInfo(FontInfo fontInfo){
  this.bf=fontInfo.bf;
  this.fontSize=fontInfo.fontSize;
  this.fontStyle=fontInfo.fontStyle;
  this.fontPadding=fontInfo.fontSize / 5f;
  this.lineWidth=fontInfo.fontSize / 20f;
  this.simulation=fontInfo.simulation;
}
Program: 76309
Project: 76309
Buggy source:
/** 
 * Converts ODA <code>Properties</code> to ROM public properties.
 * @param sourceHandle the data source handle
 */
private void updateROMPublicProperties(Properties designProps,ReportElementHandle sourceHandle) throws SemanticException {
  if (designProps == null)   return;
  EList publicProps=designProps.getProperties();
  for (int i=0; i < publicProps.size(); i++) {
    Property prop=(Property)publicProps.get(i);
    String propName=prop.getName();
    String propValue=prop.getValue();
    PropertyValueValidationUtil.validateProperty(sourceHandle,propName,propValue);
    sourceHandle.getElement().setProperty(propName,propValue);
  }
}

Fixed version (ground truth):
/** 
 * Converts ODA <code>Properties</code> to ROM public properties.
 * @param sourceHandle the data source handle
 */
private void updateROMPublicProperties(Properties designProps,ReportElementHandle sourceHandle) throws SemanticException {
  if (designProps == null)   return;
  EList publicProps=designProps.getProperties();
  for (int i=0; i < publicProps.size(); i++) {
    Property prop=(Property)publicProps.get(i);
    String propName=prop.getName();
    String propValue=prop.getValue();
    PropertyValueValidationUtil.validateProperty(sourceHandle,propName,propValue);
    sourceHandle.setProperty(propName,propValue);
  }
}
Program: 76312
Project: 76312
Buggy source:
public void testInteger2() throws IOException {
  BlockRandomAccessObject documentObject=new BlockRandomAccessObject(new BufferedRandomAccessFile(new File("String_Node_Str"),"String_Node_Str",1024),"String_Node_Str",0,0,new DocumentObjectAllocatedTable());
  byte[] bytes=new byte[1024];
  bytes[0]=1;
  bytes[1]=2;
  documentObject.seek(0);
  documentObject.write(bytes,0,bytes.length);
  documentObject.write(bytes,0,bytes.length);
  documentObject.write(bytes,0,bytes.length);
  bytes=new byte[932];
  documentObject.write(bytes,0,bytes.length);
  bytes=new byte[1024];
  documentObject.seek(0);
  assertEquals(documentObject.read(bytes,0,bytes.length),1024);
  assertEquals(bytes[0],1);
  assertEquals(bytes[1],2);
  documentObject.close();
}

Fixed version (ground truth):
public void testInteger2() throws IOException {
  BlockRandomAccessObject documentObject=new BlockRandomAccessObject(new BufferedRandomAccessFile(new File(tmpPath + File.separatorChar + "String_Node_Str"),"String_Node_Str",1024),"String_Node_Str",0,0,new DocumentObjectAllocatedTable());
  byte[] bytes=new byte[1024];
  bytes[0]=1;
  bytes[1]=2;
  documentObject.seek(0);
  documentObject.write(bytes,0,bytes.length);
  documentObject.write(bytes,0,bytes.length);
  documentObject.write(bytes,0,bytes.length);
  bytes=new byte[932];
  documentObject.write(bytes,0,bytes.length);
  bytes=new byte[1024];
  documentObject.seek(0);
  assertEquals(documentObject.read(bytes,0,bytes.length),1024);
  assertEquals(bytes[0],1);
  assertEquals(bytes[1],2);
  documentObject.close();
}