nus-yam/ex-repair huggingface dataset:
Program: 65014
Project: 65014
Buggy source:
/** 
 * filter on group with nested query expression
 * @throws Exception
 */
public void test_NestedAggregation() throws Exception {
  String sqlStatement="String_Node_Str" + getTestTableName();
  ((OdaDataSetDesign)this.dataSet).setQueryText(sqlStatement);
  IBaseExpression[] expressions=new IBaseExpression[]{new ScriptExpression("String_Node_Str",0),new ScriptExpression("String_Node_Str",0),new ScriptExpression("String_Node_Str",0)};
  String names[]={"String_Node_Str","String_Node_Str","String_Node_Str"};
  FilterDefinition filterDefn=new FilterDefinition(new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_GT,"String_Node_Str"));
  GroupDefinition groupDefn=new GroupDefinition();
  groupDefn.setKeyExpression("String_Node_Str");
  groupDefn.addFilter(filterDefn);
  QueryDefinition queryDefn=new QueryDefinition();
  queryDefn.setDataSetName(this.dataSet.getName());
  for (int i=0; i < expressions.length; i++) {
    queryDefn.addResultSetExpression(names[i],expressions[i]);
  }
  IPreparedQuery preparedQuery=dataEngine.prepare(queryDefn);
  IQueryResults queryResult=preparedQuery.execute(null);
  IResultIterator resultIt=queryResult.getResultIterator();
  outputQueryResult(resultIt,names);
  checkOutputFile();
}

Fixed version (ground truth):
/** 
 * filter on group with nested query expression
 * @throws Exception
 */
public void test_NestedAggregation() throws Exception {
  String sqlStatement="String_Node_Str" + getTestTableName();
  ((OdaDataSetDesign)this.dataSet).setQueryText(sqlStatement);
  IBaseExpression[] expressions=new IBaseExpression[]{new ScriptExpression("String_Node_Str",0),new ScriptExpression("String_Node_Str",0),new ScriptExpression("String_Node_Str",0)};
  String names[]={"String_Node_Str","String_Node_Str","String_Node_Str"};
  FilterDefinition filterDefn=new FilterDefinition(new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_GT,"String_Node_Str"));
  GroupDefinition groupDefn=new GroupDefinition();
  groupDefn.setKeyExpression("String_Node_Str");
  groupDefn.addFilter(filterDefn);
  QueryDefinition queryDefn=new QueryDefinition();
  queryDefn.setDataSetName(this.dataSet.getName());
  for (int i=0; i < expressions.length; i++) {
    queryDefn.addResultSetExpression(names[i],expressions[i]);
  }
  queryDefn.addFilter(filterDefn);
  IPreparedQuery preparedQuery=dataEngine.prepare(queryDefn);
  IQueryResults queryResult=preparedQuery.execute(null);
  IResultIterator resultIt=queryResult.getResultIterator();
  outputQueryResult(resultIt,names);
  checkOutputFile();
}
Program: 65015
Project: 65015
Buggy source:
/** 
 * Disposes instance handles.
 */
public void dispose(){
  if (engineTask != null) {
    engineTask.close();
  }
 else   if (session != null) {
    session.shutdown();
  }
}

Fixed version (ground truth):
/** 
 * Disposes instance handles.
 */
public void dispose(){
  if (session != null) {
    try {
      DataService.getInstance().unRegisterSession(session);
    }
 catch (    BirtException e) {
      logger.log(e);
    }
  }
  if (engineTask != null) {
    engineTask.close();
  }
 else   if (session != null) {
    session.shutdown();
  }
}
Program: 65017
Project: 65017
Buggy source:
/** 
 * uses to clear the data cach.
 * @param dataSet the dataset handle
 * @throws BirtException
 */
public void clearCache(DataSetHandle dataSet) throws BirtException {
  DataSessionContext context;
  DataRequestSession requestSession=null;
  try {
    context=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,dataSet.getModuleHandle(),null);
    requestSession=DataRequestSession.newSession(context);
    IModelAdapter modelAdaptor=requestSession.getModelAdaptor();
    DataSourceHandle dataSource=dataSet.getDataSource();
    IBaseDataSourceDesign sourceDesign=modelAdaptor.adaptDataSource(dataSource);
    IBaseDataSetDesign dataSetDesign=modelAdaptor.adaptDataSet(dataSet);
    requestSession.clearCache(sourceDesign,dataSetDesign);
  }
 catch (  Exception e) {
    ExceptionUtil.handle(e);
  }
 finally {
    if (requestSession != null) {
      requestSession.shutdown();
    }
  }
}

Fixed version (ground truth):
/** 
 * uses to clear the data cach.
 * @param dataSet the dataset handle
 * @throws BirtException
 */
public void clearCache(DataSetHandle dataSet) throws BirtException {
  DataSessionContext context;
  DataRequestSession requestSession=null;
  try {
    context=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,dataSet.getModuleHandle(),null);
    requestSession=DataRequestSession.newSession(context);
    IModelAdapter modelAdaptor=requestSession.getModelAdaptor();
    DataSourceHandle dataSource=dataSet.getDataSource();
    IBaseDataSourceDesign sourceDesign=modelAdaptor.adaptDataSource(dataSource);
    IBaseDataSetDesign dataSetDesign=modelAdaptor.adaptDataSet(dataSet);
    requestSession.clearCache(sourceDesign,dataSetDesign);
  }
  finally {
    if (requestSession != null) {
      requestSession.shutdown();
    }
  }
}
Program: 65018
Project: 65018
Buggy source:
/** 
 * Returns the column number for the cell that has no "column" property defined.
 * @param module the report design
 * @param target the cell to find
 * @return the column position
 */
public int getCellPositionInColumn(Module module,Cell target){
  int pos=target.getColumn(module);
  if (pos > 0)   return pos;
  pos=1;
  TableRow row=(TableRow)target.getContainer();
  List<DesignElement> list=row.getContentsSlot();
  for (Iterator<DesignElement> iter=list.iterator(); iter.hasNext(); ) {
    Cell cell=(Cell)iter.next();
    int cellPos=cell.getColumn(module);
    if (cellPos > 0)     pos=cellPos;
    if (cell == target)     break;
    pos=pos + cell.getColSpan(module);
  }
  int cellRowNum=getRowNumber(row);
  ContainerSlot rows=getSlot(ROW_SLOT);
  for (int currRowNum=0; currRowNum < rows.getCount(); currRowNum++) {
    TableRow currRow=(TableRow)rows.getContent(currRowNum);
    if (row == currRow)     break;
    List<DesignElement> cells=currRow.getContentsSlot();
    for (int j=0; j < pos; j++) {
      Cell cell=(Cell)cells.get(j);
      if (cell.getRowSpan(module) + currRowNum >= cellRowNum)       pos++;
    }
  }
  return pos;
}

Fixed version (ground truth):
/** 
 * Returns the column number for the cell that has no "column" property defined.
 * @param module the report design
 * @param target the cell to find
 * @return the column position
 */
public int getCellPositionInColumn(Module module,Cell target){
  int pos=target.getColumn(module);
  if (pos > 0)   return pos;
  pos=1;
  TableRow row=(TableRow)target.getContainer();
  List<DesignElement> list=row.getContentsSlot();
  for (Iterator<DesignElement> iter=list.iterator(); iter.hasNext(); ) {
    Cell cell=(Cell)iter.next();
    int cellPos=cell.getColumn(module);
    if (cellPos > 0)     pos=cellPos;
    if (cell == target)     break;
    pos=pos + cell.getColSpan(module);
  }
  int cellRowNum=getRowNumber(row);
  ContainerSlot rows=getSlot(ROW_SLOT);
  for (int currRowNum=0; currRowNum < rows.getCount(); currRowNum++) {
    TableRow currRow=(TableRow)rows.getContent(currRowNum);
    if (row == currRow)     break;
    List<DesignElement> cells=currRow.getContentsSlot();
    int count=Math.min(pos,cells.size());
    for (int j=0; j < count; j++) {
      Cell cell=(Cell)cells.get(j);
      if (cell.getRowSpan(module) + currRowNum >= cellRowNum)       pos++;
    }
  }
  return pos;
}
Program: 65019
Project: 65019
Buggy source:
/** 
 * Tests 'hasLocalPropertiesForExtendedElements' method. <ul> <li>Label has 'name' properties, can't enable restore.</li> <li>Get label without any property inside grid element.</li> <li>Modify one property of label and 'restore' button should be enabled.</li> <li>Modify one property of label in grid and 'restore' button should be enabled.</li> </ul>
 * @throws Exception any exception
 */
public void testExtendsItemHasLocalProperties() throws Exception {
  openDesign("String_Node_Str");
  LabelHandle labelHandle=(LabelHandle)designHandle.findElement("String_Node_Str");
  List<DesignElementHandle> elements=new ArrayList<DesignElementHandle>();
  elements.add(labelHandle);
  GroupElementHandle groupElementHandle=new SimpleGroupElementHandle(designHandle,elements);
  assertFalse(groupElementHandle.hasLocalPropertiesForExtendedElements());
  labelHandle.setText("String_Node_Str");
  assertTrue(groupElementHandle.hasLocalPropertiesForExtendedElements());
  labelHandle=(LabelHandle)designHandle.getElementByID(20);
  elements.clear();
  elements.add(labelHandle);
  assertFalse(groupElementHandle.hasLocalPropertiesForExtendedElements());
  labelHandle.setStringProperty("String_Node_Str","String_Node_Str");
  assertTrue(groupElementHandle.hasLocalPropertiesForExtendedElements());
  CubeHandle cube=designHandle.findCube("String_Node_Str");
  elements.clear();
  elements.add(cube);
  groupElementHandle=new SimpleGroupElementHandle(designHandle,elements);
  assertFalse(groupElementHandle.hasLocalPropertiesForExtendedElements());
}

Fixed version (ground truth):
/** 
 * Tests 'hasLocalPropertiesForExtendedElements' method. <ul> <li>Label has 'name' properties, can't enable restore.</li> <li>Get label without any property inside grid element.</li> <li>Modify one property of label and 'restore' button should be enabled.</li> <li>Modify one property of label in grid and 'restore' button should be enabled.</li> </ul>
 * @throws Exception any exception
 */
public void testExtendsItemHasLocalProperties() throws Exception {
  openDesign("String_Node_Str");
  LabelHandle labelHandle=(LabelHandle)designHandle.findElement("String_Node_Str");
  List<DesignElementHandle> elements=new ArrayList<DesignElementHandle>();
  elements.add(labelHandle);
  GroupElementHandle groupElementHandle=new SimpleGroupElementHandle(designHandle,elements);
  assertFalse(groupElementHandle.hasLocalPropertiesForExtendedElements());
  labelHandle.setText("String_Node_Str");
  assertTrue(groupElementHandle.hasLocalPropertiesForExtendedElements());
  labelHandle=(LabelHandle)designHandle.getElementByID(20);
  elements.clear();
  elements.add(labelHandle);
  assertFalse(groupElementHandle.hasLocalPropertiesForExtendedElements());
  labelHandle.setStringProperty("String_Node_Str","String_Node_Str");
  assertTrue(groupElementHandle.hasLocalPropertiesForExtendedElements());
  CubeHandle cube=designHandle.findCube("String_Node_Str");
  elements.clear();
  elements.add(cube);
  groupElementHandle=new SimpleGroupElementHandle(designHandle,elements);
}
Program: 65020
Project: 65020
Buggy source:
/** 
 * Gets the referred OLAP measure handle of this measure view.
 * @return the referred OLAP measure handle
 */
public MeasureHandle getCubeMeasure(){
  MeasureHandle cubeMeasure=(MeasureHandle)handle.getElementProperty(MEASURE_PROP);
  if (cubeMeasure == null) {
    String measureName=this.getCubeMeasureName();
    CubeHandle cube=this.getCrosstab().getCube();
    if (measureName != null && cube != null) {
      cubeMeasure=cube.getMeasure(measureName);
    }
  }
  return cubeMeasure;
}

Fixed version (ground truth):
/** 
 * Gets the referred OLAP measure handle of this measure view.
 * @return the referred OLAP measure handle
 */
public MeasureHandle getCubeMeasure(){
  MeasureHandle cubeMeasure=(MeasureHandle)handle.getElementProperty(MEASURE_PROP);
  CubeHandle cube=this.getCrosstab().getCube();
  if (cubeMeasure != null) {
    if (cubeMeasure.getContainer() != null && cubeMeasure.getContainer().getContainer() != cube) {
      cubeMeasure=null;
    }
  }
  if (cubeMeasure == null) {
    String measureName=this.getCubeMeasureName();
    if (measureName != null && cube != null) {
      cubeMeasure=cube.getMeasure(measureName);
    }
  }
  return cubeMeasure;
}
Program: 65023
Project: 65023
Buggy source:
/** 
 * Returns the column number for the cell that has no "column" property defined.
 * @param module the report design
 * @param target the cell to find
 * @return the column position
 */
public int getCellPositionInColumn(Module module,Cell target){
  int pos=target.getColumn(module);
  if (pos > 0)   return pos;
  pos=1;
  TableRow row=(TableRow)target.getContainer();
  List<DesignElement> list=row.getContentsSlot();
  for (Iterator<DesignElement> iter=list.iterator(); iter.hasNext(); ) {
    Cell cell=(Cell)iter.next();
    int cellPos=cell.getColumn(module);
    if (cellPos > 0)     pos=cellPos;
    if (cell == target)     break;
    pos=pos + cell.getColSpan(module);
  }
  int cellRowNum=getRowNumber(row);
  ContainerSlot rows=getSlot(ROW_SLOT);
  for (int currRowNum=0; currRowNum < rows.getCount(); currRowNum++) {
    TableRow currRow=(TableRow)rows.getContent(currRowNum);
    if (row == currRow)     break;
    List<DesignElement> cells=currRow.getContentsSlot();
    for (int j=0; j < pos; j++) {
      Cell cell=(Cell)cells.get(j);
      if (cell.getRowSpan(module) + currRowNum >= cellRowNum)       pos++;
    }
  }
  return pos;
}

Fixed version (ground truth):
/** 
 * Returns the column number for the cell that has no "column" property defined.
 * @param module the report design
 * @param target the cell to find
 * @return the column position
 */
public int getCellPositionInColumn(Module module,Cell target){
  int pos=target.getColumn(module);
  if (pos > 0)   return pos;
  pos=1;
  TableRow row=(TableRow)target.getContainer();
  List<DesignElement> list=row.getContentsSlot();
  for (Iterator<DesignElement> iter=list.iterator(); iter.hasNext(); ) {
    Cell cell=(Cell)iter.next();
    int cellPos=cell.getColumn(module);
    if (cellPos > 0)     pos=cellPos;
    if (cell == target)     break;
    pos=pos + cell.getColSpan(module);
  }
  int cellRowNum=getRowNumber(row);
  ContainerSlot rows=getSlot(ROW_SLOT);
  for (int currRowNum=0; currRowNum < rows.getCount(); currRowNum++) {
    TableRow currRow=(TableRow)rows.getContent(currRowNum);
    if (row == currRow)     break;
    List<DesignElement> cells=currRow.getContentsSlot();
    if (cells == null)     continue;
    int maxSize=Math.min(pos,cells.size());
    for (int j=0; j < maxSize; j++) {
      Cell cell=(Cell)cells.get(j);
      if (cell.getRowSpan(module) + currRowNum >= cellRowNum)       pos++;
    }
  }
  return pos;
}
Program: 65025
Project: 65025
Buggy source:
/** 
 * Including next(), getRow(), getDATATYPE(index), wasNull(). Compare with the results got from JDBC ResultSet
 * @throws Exception
 */
public void testResultValuesByIndex() throws Exception {
  assertEquals(rs.getRow(),jdbcRs.getRow());
  String sqlState=null;
  try {
    rs.getString(1);
    fail("String_Node_Str");
  }
 catch (  JDBCException e) {
    sqlState=e.getSQLState();
  }
  try {
    jdbcRs.getString(1);
    fail();
  }
 catch (  SQLException e) {
    assertEquals(e.getSQLState(),sqlState);
  }
  while (rs.next()) {
    jdbcRs.next();
    assertEquals(rs.wasNull(),jdbcRs.wasNull());
    assertEquals(rs.getRow(),jdbcRs.getRow());
    assertEquals(rs.getBigDecimal(1),jdbcRs.getBigDecimal(1));
    assertEquals(rs.getDate(2),jdbcRs.getDate(2));
    assertEquals(rs.getDouble(3),jdbcRs.getDouble(3),Double.MIN_VALUE);
    assertEquals(rs.getInt(4),jdbcRs.getInt(4));
    assertEquals(rs.getString(5),jdbcRs.getString(5));
    assertEquals(rs.getTime(6),jdbcRs.getTime(6));
    assertEquals(rs.getTimestamp(7),jdbcRs.getTimestamp(7));
  }
}

Fixed version (ground truth):
/** 
 * Including next(), getRow(), getDATATYPE(index), wasNull(). Compare with the results got from JDBC ResultSet
 * @throws Exception
 */
public void testResultValuesByIndex() throws Exception {
  assertEquals(rs.getRow(),jdbcRs.getRow());
  while (rs.next()) {
    jdbcRs.next();
    assertEquals(rs.wasNull(),jdbcRs.wasNull());
    assertEquals(rs.getRow(),jdbcRs.getRow());
    assertEquals(rs.getBigDecimal(1),jdbcRs.getBigDecimal(1));
    assertEquals(rs.getDate(2),jdbcRs.getDate(2));
    assertEquals(rs.getDouble(3),jdbcRs.getDouble(3),Double.MIN_VALUE);
    assertEquals(rs.getInt(4),jdbcRs.getInt(4));
    assertEquals(rs.getString(5),jdbcRs.getString(5));
    assertEquals(rs.getTime(6),jdbcRs.getTime(6));
    assertEquals(rs.getTimestamp(7),jdbcRs.getTimestamp(7));
  }
}
Program: 65028
Project: 65028
Buggy source:
/** 
 * the user setup a thread logger. Those logs output in those thread should be output to the defined logger, the thread without logger should be output to the original logger.
 * @throws Exception
 */
public void testThreadLogger() throws Exception {
  setupRootLogger("String_Node_Str",Level.FINEST);
  try {
    EngineLogger.startEngineLogging(null,null,null,null,0,0);
    logThread("String_Node_Str",Level.WARNING);
    logThread("String_Node_Str",Level.FINE);
    log();
    EngineLogger.stopEngineLogging();
  }
  finally {
    removeRootLogger();
  }
  waitLogThreads();
  checkLogging("String_Node_Str",1,1,1);
  checkLogging("String_Node_Str",0,0,1);
  checkLogging("String_Node_Str",0,1,1);
}

Fixed version (ground truth):
/** 
 * the user setup a thread logger. Those logs output in those thread should be output to the defined logger, the thread without logger should be output to the original logger.
 * @throws Exception
 */
public void testThreadLogger() throws Exception {
  setupRootLogger("String_Node_Str",Level.FINEST);
  try {
    LoggerSetting setting=EngineLogger.createSetting(null,null,null,null,0,0);
    logThread("String_Node_Str",Level.WARNING);
    logThread("String_Node_Str",Level.FINE);
    log();
    EngineLogger.removeSetting(setting);
  }
  finally {
    removeRootLogger();
  }
  waitLogThreads();
  checkLogging("String_Node_Str",1,1,1);
  checkLogging("String_Node_Str",0,0,1);
  checkLogging("String_Node_Str",0,1,1);
}
Program: 65029
Project: 65029
Buggy source:
/** 
 * the user setup a file logger. All the logger should be outputted to the file. If the log level is OFF, no log file should be created.
 * @throws Exception
 */
public void testFileLogger() throws Exception {
  EngineLogger.startEngineLogging(null,"String_Node_Str","String_Node_Str",Level.OFF,0,0);
  log();
  assertFalse(new File("String_Node_Str").exists());
  EngineLogger.changeLogLevel(Level.WARNING);
  log();
  assertTrue(new File("String_Node_Str").exists());
  EngineLogger.stopEngineLogging();
  checkLogging("String_Node_Str",0,0,1);
}

Fixed version (ground truth):
/** 
 * the user setup a file logger. All the logger should be outputted to the file. If the log level is OFF, no log file should be created.
 * @throws Exception
 */
public void testFileLogger() throws Exception {
  LoggerSetting setting=EngineLogger.createSetting(null,"String_Node_Str","String_Node_Str",Level.OFF,0,0);
  log();
  assertFalse(new File("String_Node_Str").exists());
  EngineLogger.changeLogLevel(setting,Level.WARNING);
  log();
  assertTrue(new File("String_Node_Str").exists());
  EngineLogger.removeSetting(setting);
  checkLogging("String_Node_Str",0,0,1);
}
Program: 65030
Project: 65030
Buggy source:
/** 
 * the user uses the user defined log. All log should be outputted to the user defined logger.
 * @throws Exception
 */
public void testUserLogger() throws Exception {
  FileHandler fileHandle=new FileHandler("String_Node_Str");
  try {
    Logger logger=Logger.getAnonymousLogger();
    logger.addHandler(fileHandle);
    logger.setLevel(Level.ALL);
    logger.setUseParentHandlers(false);
    try {
      EngineLogger.startEngineLogging(logger,null,null,Level.FINE,0,0);
      log();
      EngineLogger.setLogger(null);
      log();
      EngineLogger.stopEngineLogging();
    }
  finally {
      logger.removeHandler(fileHandle);
    }
  }
  finally {
    fileHandle.close();
  }
  checkLogging("String_Node_Str",0,1,1);
}

Fixed version (ground truth):
/** 
 * the user uses the user defined log. All log should be outputted to the user defined logger.
 * @throws Exception
 */
public void testUserLogger() throws Exception {
  FileHandler fileHandle=new FileHandler("String_Node_Str");
  try {
    Logger logger=Logger.getAnonymousLogger();
    logger.addHandler(fileHandle);
    logger.setLevel(Level.ALL);
    logger.setUseParentHandlers(false);
    try {
      LoggerSetting setting=EngineLogger.createSetting(logger,null,null,Level.FINE,0,0);
      log();
      EngineLogger.setLogger(setting,null);
      log();
      EngineLogger.removeSetting(setting);
    }
  finally {
      logger.removeHandler(fileHandle);
    }
  }
  finally {
    fileHandle.close();
  }
  checkLogging("String_Node_Str",0,1,1);
}
Program: 65031
Project: 65031
Buggy source:
/** 
 * if the user doesn't setup any ENGINE logger, ENGINE should use the system logger as all other components
 * @throws Exception
 */
public void testDefaultLogger() throws Exception {
  setupRootLogger("String_Node_Str",Level.FINE);
  try {
    EngineLogger.startEngineLogging(null,null,null,null,0,0);
    log();
    EngineLogger.stopEngineLogging();
  }
  finally {
    removeRootLogger();
  }
  checkLogging("String_Node_Str",0,1,1);
}

Fixed version (ground truth):
/** 
 * if the user doesn't setup any ENGINE logger, ENGINE should use the system logger as all other components
 * @throws Exception
 */
public void testDefaultLogger() throws Exception {
  setupRootLogger("String_Node_Str",Level.FINE);
  try {
    LoggerSetting setting=EngineLogger.createSetting(null,null,null,null,0,0);
    log();
    EngineLogger.removeSetting(setting);
  }
  finally {
    removeRootLogger();
  }
  checkLogging("String_Node_Str",0,1,1);
}
Program: 65032
Project: 65032
Buggy source:
public void testFormat(){
  Calendar calendar=Calendar.getInstance();
  calendar.set(Calendar.YEAR,2013);
  calendar.set(Calendar.MONTH,5);
  calendar.set(Calendar.DATE,8);
  Date date=calendar.getTime();
  Hashtable<ULocale,String> locales=new Hashtable<ULocale,String>();
  locales.put(ULocale.CANADA,"String_Node_Str");
  locales.put(ULocale.CHINA,"String_Node_Str");
  locales.put(ULocale.ENGLISH,"String_Node_Str");
  locales.put(ULocale.FRANCE,"String_Node_Str");
  locales.put(ULocale.GERMAN,"String_Node_Str");
  locales.put(ULocale.ITALY,"String_Node_Str");
  locales.put(ULocale.JAPAN,"String_Node_Str");
  locales.put(ULocale.KOREA,"String_Node_Str");
  locales.put(ULocale.SIMPLIFIED_CHINESE,"String_Node_Str");
  locales.put(ULocale.TAIWAN,"String_Node_Str");
  locales.put(ULocale.TRADITIONAL_CHINESE,"String_Node_Str");
  locales.put(ULocale.UK,"String_Node_Str");
  for (Iterator<ULocale> itr=locales.keySet().iterator(); itr.hasNext(); ) {
    ULocale locale=itr.next();
    IDateFormatWrapper formatter=DateFormatWrapperFactory.getPreferredDateFormat(Calendar.MONTH,locale,true);
    assertTrue(locales.get(locale).equals(formatter.format(date)));
  }
}

Fixed version (ground truth):
public void testFormat(){
  Calendar calendar=Calendar.getInstance();
  calendar.set(Calendar.YEAR,2013);
  calendar.set(Calendar.MONTH,5);
  calendar.set(Calendar.DATE,8);
  Date date=calendar.getTime();
  Hashtable<ULocale,String> locales=new Hashtable<ULocale,String>();
  locales.put(ULocale.CANADA,"String_Node_Str");
  locales.put(ULocale.CHINA,"String_Node_Str");
  locales.put(ULocale.ENGLISH,"String_Node_Str");
  locales.put(ULocale.FRANCE,"String_Node_Str");
  locales.put(ULocale.GERMAN,"String_Node_Str");
  locales.put(ULocale.ITALY,"String_Node_Str");
  locales.put(ULocale.JAPAN,"String_Node_Str");
  locales.put(ULocale.KOREA,"String_Node_Str");
  locales.put(ULocale.SIMPLIFIED_CHINESE,"String_Node_Str");
  locales.put(ULocale.TAIWAN,"String_Node_Str");
  locales.put(ULocale.TRADITIONAL_CHINESE,"String_Node_Str");
  locales.put(ULocale.UK,"String_Node_Str");
  for (Iterator<ULocale> itr=locales.keySet().iterator(); itr.hasNext(); ) {
    ULocale locale=itr.next();
    IDateFormatWrapper formatter=DateFormatWrapperFactory.getPreferredDateFormat(Calendar.MONTH,locale,true);
    assertEquals(locales.get(locale),formatter.format(date));
  }
}
Program: 65033
Project: 65033
Buggy source:
public void testMin(){
  IScale scale=getValueAxisScale();
  assertTrue(scale instanceof ITimeScale);
  ITimeScale ls=(ITimeScale)scale;
  assertEquals(ls.getMin().getYear(),2002 - 1900);
  assertEquals(ls.getMin().getDate(),19);
  ls.setMin(null);
  assertNull(ls.getMin());
}

Fixed version (ground truth):
public void testMin(){
  IScale scale=getValueAxisScale();
  assertTrue(scale instanceof ITimeScale);
  ITimeScale ls=(ITimeScale)scale;
  assertEquals(1037635200984L,ls.getMin().getTime());
  ls.setMin(null);
  assertNull(ls.getMin());
}
Program: 65034
Project: 65034
Buggy source:
public void widgetDefaultSelected(SelectionEvent e){
  if (getSelection() instanceof StructuredSelection) {
    List list=new ArrayList();
    Object selectedObject=((StructuredSelection)getSelection()).getFirstElement();
    list.add(selectedObject);
    ReportRequest r=new ReportRequest();
    r.setType(ReportRequest.OPEN_EDITOR);
    r.setRequestConverter(new IRequestConverter(){
      public List convertSelectionToModelLisr(      List list){
        List lst=new ArrayList();
        for (Iterator itr=list.iterator(); itr.hasNext(); ) {
          Object obj=itr.next();
          lst.add(obj);
        }
        return lst;
      }
    }
);
    r.setSelectionObject(list);
    SessionHandleAdapter.getInstance().getMediator(model).notifyRequest(r);
    try {
      Tree tree=(Tree)e.getSource();
      TreeItem[] selectedItems=tree.getSelection();
      if (selectedItems.length > 0) {
        if (selectedItems[0].getExpanded()) {
          selectedItems[0].setExpanded(false);
        }
 else {
          getTreeViewer().expandToLevel(selectedObject,selectedItems[0].getExpanded() ? 0 : 1);
        }
      }
    }
 catch (    Exception e2) {
    }
  }
}

Fixed version (ground truth):
public void widgetDefaultSelected(SelectionEvent e){
  if (getSelection() instanceof StructuredSelection) {
    List list=new ArrayList();
    Object selectedObject=((StructuredSelection)getSelection()).getFirstElement();
    list.add(selectedObject);
    ReportRequest r=new ReportRequest();
    r.setType(ReportRequest.OPEN_EDITOR);
    r.setRequestConverter(new IRequestConverter(){
      public List convertSelectionToModelLisr(      List list){
        List lst=new ArrayList();
        for (Iterator itr=list.iterator(); itr.hasNext(); ) {
          Object obj=itr.next();
          lst.add(obj);
        }
        return lst;
      }
    }
);
    r.setSelectionObject(list);
    SessionHandleAdapter.getInstance().getMediator(model).notifyRequest(r);
    if (selectedObject instanceof LibraryHandle && selectedObject != getRoot()) {
      try {
        final File file=EditorUtil.convertToFile(new URL(((LibraryHandle)selectedObject).getFileName()));
        if (file != null && file.exists() && file.isFile()) {
          Display.getCurrent().asyncExec(new Runnable(){
            @Override public void run(){
              try {
                EditorUtil.openEditor(DesignerOutlinePage.this,file,IReportEditorContants.LIBRARY_EDITOR_ID);
              }
 catch (              PartInitException e) {
                ExceptionUtil.handle(e);
              }
            }
          }
);
        }
      }
 catch (      IOException e1) {
      }
    }
    try {
      Tree tree=(Tree)e.getSource();
      TreeItem[] selectedItems=tree.getSelection();
      if (selectedItems.length > 0) {
        if (selectedItems[0].getExpanded()) {
          selectedItems[0].setExpanded(false);
        }
 else {
          getTreeViewer().expandToLevel(selectedObject,selectedItems[0].getExpanded() ? 0 : 1);
        }
      }
    }
 catch (    Exception e2) {
    }
  }
}
Program: 65036
Project: 65036
Buggy source:
/** 
 * Returns the column number for the cell that has no "column" property defined.
 * @param module the report design
 * @param target the cell to find
 * @return the column position
 */
public int getCellPositionInColumn(Module module,Cell target){
  int pos=target.getColumn(module);
  if (pos > 0)   return pos;
  pos=1;
  TableRow row=(TableRow)target.getContainer();
  List<DesignElement> list=row.getContentsSlot();
  for (Iterator<DesignElement> iter=list.iterator(); iter.hasNext(); ) {
    Cell cell=(Cell)iter.next();
    int cellPos=cell.getColumn(module);
    if (cellPos > 0)     pos=cellPos;
    if (cell == target)     return pos;
    pos=pos + cell.getColSpan(module);
  }
  return pos;
}

Fixed version (ground truth):
/** 
 * Returns the column number for the cell that has no "column" property defined.
 * @param module the report design
 * @param target the cell to find
 * @return the column position
 */
public int getCellPositionInColumn(Module module,Cell target){
  int pos=target.getColumn(module);
  if (pos > 0)   return pos;
  pos=1;
  TableRow row=(TableRow)target.getContainer();
  List<DesignElement> list=row.getContentsSlot();
  for (Iterator<DesignElement> iter=list.iterator(); iter.hasNext(); ) {
    Cell cell=(Cell)iter.next();
    int cellPos=cell.getColumn(module);
    if (cellPos > 0)     pos=cellPos;
    if (cell == target)     break;
    pos=pos + cell.getColSpan(module);
  }
  int cellRowNum=getRowNumber(row);
  ContainerSlot rows=getSlot(ROW_SLOT);
  for (int currRowNum=0; currRowNum < rows.getCount(); currRowNum++) {
    TableRow currRow=(TableRow)rows.getContent(currRowNum);
    if (row == currRow)     break;
    List<DesignElement> cells=currRow.getContentsSlot();
    for (int j=0; j < pos; j++) {
      Cell cell=(Cell)cells.get(j);
      if (cell.getRowSpan(module) + currRowNum >= cellRowNum)       pos++;
    }
  }
  return pos;
}
Program: 65037
Project: 65037
Buggy source:
/** 
 * Gets the children element of the given model using visitor.
 * @param object the handle
 */
public Object[] getChildren(Object object){
  DataSetHandle handle=(DataSetHandle)object;
  ArrayList params=new ArrayList(10);
  CachedMetaDataHandle cmdh=null;
  try {
    cmdh=DataSetUIUtil.getCachedMetaDataHandle(handle);
  }
 catch (  SemanticException e) {
  }
  ArrayList columns=new ArrayList(10);
  if (cmdh != null) {
    for (Iterator iterator=cmdh.getResultSet().iterator(); iterator.hasNext(); ) {
      ResultSetColumnHandle element=(ResultSetColumnHandle)iterator.next();
      columns.add(element);
    }
  }
  PropertyHandle parameters=handle.getPropertyHandle(DataSetHandle.PARAMETERS_PROP);
  Iterator iter=parameters.iterator();
  if (iter != null) {
    while (iter.hasNext()) {
      Object dataSetParameter=iter.next();
      if (((DataSetParameterHandle)dataSetParameter).isOutput() == true) {
        params.add(dataSetParameter);
      }
    }
  }
  Object[] parametersArray=params.toArray();
  Object[] both=new Object[columns.toArray().length + parametersArray.length];
  System.arraycopy(columns.toArray(),0,both,0,columns.toArray().length);
  System.arraycopy(parametersArray,0,both,columns.toArray().length,parametersArray.length);
  return both;
}

Fixed version (ground truth):
/** 
 * Gets the children element of the given model using visitor.
 * @param object the handle
 */
public Object[] getChildren(Object object){
  DataSetHandle handle=(DataSetHandle)object;
  ArrayList params=new ArrayList(10);
  CachedMetaDataHandle cmdh=null;
  try {
    cmdh=DataSetUIUtil.getCachedMetaDataHandle(handle);
  }
 catch (  SemanticException e) {
  }
  ArrayList columns=new ArrayList(10);
  if (cmdh != null) {
    for (Iterator iterator=cmdh.getResultSet().iterator(); iterator.hasNext(); ) {
      ResultSetColumnHandle element=(ResultSetColumnHandle)iterator.next();
      columns.add(element);
    }
  }
  Collections.sort(columns,comp);
  PropertyHandle parameters=handle.getPropertyHandle(DataSetHandle.PARAMETERS_PROP);
  Iterator iter=parameters.iterator();
  if (iter != null) {
    while (iter.hasNext()) {
      Object dataSetParameter=iter.next();
      if (((DataSetParameterHandle)dataSetParameter).isOutput() == true) {
        params.add(dataSetParameter);
      }
    }
  }
  Object[] parametersArray=params.toArray();
  Object[] both=new Object[columns.toArray().length + parametersArray.length];
  System.arraycopy(columns.toArray(),0,both,0,columns.toArray().length);
  System.arraycopy(parametersArray,0,both,columns.toArray().length,parametersArray.length);
  return both;
}
Program: 65039
Project: 65039
Buggy source:
/** 
 * Compare the list with the golden file line by line.
 * @param list The list to be compared.
 * @param goldenFile the golden file name.
 * @return true is every element in the list is identical the correspondingline of the golden file.
 * @throws Exception
 */
private boolean compareListWithGoldenFile(List list,String goldenFile) throws Exception {
  boolean isIdentical=true;
  goldenFile=GOLDEN_FOLDER + goldenFile;
  InputStream is=getResourceAStream(goldenFile);
  BufferedReader reader=new BufferedReader(new InputStreamReader(is));
  for (int i=0; i < list.size(); i++) {
    String item=((PropertyDefn)list.get(i)).getName();
    String line=reader.readLine();
    if (!item.equals(line)) {
      System.out.print("String_Node_Str" + i);
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str" + item + "String_Node_Str"+ line+ "String_Node_Str");
      isIdentical=false;
      break;
    }
  }
  String line=reader.readLine();
  if (line != null)   return false;
  return isIdentical;
}

Fixed version (ground truth):
/** 
 * Compare the list with the golden file line by line.
 * @param list The list to be compared.
 * @param goldenFile the golden file name.
 * @return true is every element in the list is identical the correspondingline of the golden file.
 * @throws Exception
 */
private boolean compareListWithGoldenFile(List<PropertyDefn> list,String goldenFile) throws Exception {
  boolean isIdentical=true;
  String fullGoldenFile=GOLDEN_FOLDER + goldenFile;
  InputStream is=getResourceAStream(fullGoldenFile);
  BufferedReader reader=new BufferedReader(new InputStreamReader(is));
  for (int i=0; i < list.size(); i++) {
    String item=((PropertyDefn)list.get(i)).getName();
    String line=reader.readLine();
    if (!item.equals(line)) {
      System.out.print("String_Node_Str" + i);
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str" + item + "String_Node_Str"+ line+ "String_Node_Str");
      isIdentical=false;
      break;
    }
  }
  if (!isIdentical) {
    StringBuilder sb=new StringBuilder();
    for (    PropertyDefn one : list)     sb.append(one.getName() + "String_Node_Str");
    saveOutputFile(goldenFile,sb.toString());
  }
  String line=reader.readLine();
  if (line != null)   return false;
  return isIdentical;
}
Program: 65041
Project: 65041
Buggy source:
/** 
 * Test setProperty method. especially for compatible with set toc string value.
 * @throws SemanticException
 */
public void testBackwardTOCSetProperty() throws SemanticException {
  LabelHandle labelHandle=designHandle.getElementFactory().newLabel("String_Node_Str");
  labelHandle.setStringProperty(IReportItemModel.TOC_PROP,"String_Node_Str");
  assertEquals("String_Node_Str",labelHandle.getTOC().getExpression());
  labelHandle.setStringProperty(IReportItemModel.TOC_PROP,"String_Node_Str");
  assertEquals("String_Node_Str",labelHandle.getTOC().getExpression());
  designHandle.getModule().getActivityStack().undo();
  assertEquals("String_Node_Str",labelHandle.getTOC().getExpression());
}

Fixed version (ground truth):
/** 
 * Test setProperty method. especially for compatible with set toc string value.
 * @throws SemanticException
 */
public void testBackwardTOCSetProperty() throws SemanticException {
  LabelHandle labelHandle=designHandle.getElementFactory().newLabel("String_Node_Str");
  designHandle.getBody().add(labelHandle);
  labelHandle.setStringProperty(IReportItemModel.TOC_PROP,"String_Node_Str");
  assertEquals("String_Node_Str",labelHandle.getTOC().getExpression());
  labelHandle.setStringProperty(IReportItemModel.TOC_PROP,"String_Node_Str");
  assertEquals("String_Node_Str",labelHandle.getTOC().getExpression());
  designHandle.getModule().getActivityStack().undo();
  assertEquals("String_Node_Str",labelHandle.getTOC().getExpression());
}
Program: 65042
Project: 65042
Buggy source:
/** 
 * Convert String without specified locale to java.util.Date Try to format the given String for JRE default Locale, if it fails, try to format the String for Locale.US 
 * @param source the String to be convert
 * @param locate the locate of the string
 * @return result Date
 */
private static Date toDate(String source) throws BirtException {
  try {
    return toDateISO8601(source,null);
  }
 catch (  BirtException e) {
    try {
      return toDate(source,JRE_DEFAULT_LOCALE);
    }
 catch (    BirtException use) {
      try {
        return toDate(source,DEFAULT_LOCALE);
      }
 catch (      BirtException de) {
        return toDateForSpecialFormat(source);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Convert String without specified locale to java.util.Date Try to format the given String for JRE default Locale, if it fails, try to format the String for Locale.US 
 * @param source the String to be convert
 * @param locate the locate of the string
 * @return result Date
 */
private static Date toDate(String source) throws BirtException {
  source=source.trim();
  try {
    return toDateISO8601(source,null);
  }
 catch (  BirtException e) {
    try {
      return toDate(source,JRE_DEFAULT_LOCALE);
    }
 catch (    BirtException use) {
      try {
        return toDate(source,DEFAULT_LOCALE);
      }
 catch (      BirtException de) {
        return toDateForSpecialFormat(source);
      }
    }
  }
}
Program: 65043
Project: 65043
Buggy source:
/** 
 * @param s
 * @return
 */
private static String cleanDate(String s){
  s=s.trim();
  if (s.indexOf('T') < 12) {
    s=T_PATTERN.matcher(s).replaceFirst("String_Node_Str");
  }
  int zoneIndex=s.indexOf('Z');
  if (zoneIndex == s.length() - 1) {
    return s.substring(0,zoneIndex).trim();
  }
  return s;
}

Fixed version (ground truth):
/** 
 * @param s
 * @return
 */
private static String cleanDate(String s){
  s=s.trim();
  if (s.indexOf('T') < 12) {
    s=T_PATTERN.matcher(s).replaceFirst("String_Node_Str");
  }
  int zoneIndex=s.indexOf('Z');
  if (zoneIndex == -1) {
    zoneIndex=s.indexOf('z');
  }
  if (zoneIndex == s.length() - 1) {
    return s.substring(0,zoneIndex).trim();
  }
  Matcher m=TIME_PART_PATTERN.matcher(s);
  if (m.find()) {
    String timePart=m.group();
    if (timePart.length() > 12) {
      s=m.replaceFirst(timePart.substring(0,12));
    }
  }
  return s;
}
Program: 65045
Project: 65045
Buggy source:
/** 
 * Returns a handle to the next structure in the list. The handle is of type <code>StructureHandle</code>
 * @return a handle to the next structure in the list
 * @see StructureHandle
 */
public Object next(){
  if (!hasNext())   return null;
  Structure struct=list.get(index);
  return struct.getHandle(valueHandle,index++);
}

Fixed version (ground truth):
/** 
 * Returns a handle to the next structure in the list. The handle is of type <code>StructureHandle</code>
 * @return a handle to the next structure in the list
 * @see StructureHandle
 */
public Object next(){
  if (!hasNext())   return null;
  Structure struct=list.get(++index);
  return struct.getHandle(valueHandle,index);
}
Program: 65046
Project: 65046
Buggy source:
/** 
 * Constructs an structure iterator for the property or member that has the list of structures over which to iterate.
 * @param handle handle to the property or member that has the list of structures over which to iterate
 */
public StructureIterator(SimpleValueHandle handle){
  valueHandle=handle;
  list=valueHandle.getListValue();
  index=0;
}

Fixed version (ground truth):
/** 
 * Constructs an structure iterator for the property or member that has the list of structures over which to iterate.
 * @param handle handle to the property or member that has the list of structures over which to iterate
 */
public StructureIterator(SimpleValueHandle handle){
  valueHandle=handle;
  list=valueHandle.getListValue();
  index=-1;
}
Program: 65047
Project: 65047
Buggy source:
public boolean hasNext(){
  return list != null && index < list.size();
}

Fixed version (ground truth):
public boolean hasNext(){
  return list != null && index + 1 < list.size();
}
Program: 65048
Project: 65048
Buggy source:
/** 
 * Removes the structure at the current position.
 */
public void remove(){
  if (!hasNext())   return;
  try {
    valueHandle.removeItem(index);
  }
 catch (  PropertyValueException e) {
  }
}

Fixed version (ground truth):
/** 
 * Removes the structure at the current position.
 */
public void remove(){
  if (index < 0 || index >= list.size())   return;
  try {
    valueHandle.removeItem(index);
    list.remove(index--);
  }
 catch (  PropertyValueException e) {
  }
}
Program: 65049
Project: 65049
Buggy source:
/** 
 * Gets the children element of the given model using visitor.
 * @param object the handle
 */
public Object[] getChildren(Object object){
  DataSetHandle handle=(DataSetHandle)object;
  ArrayList params=new ArrayList(10);
  CachedMetaDataHandle cmdh=null;
  try {
    cmdh=DataSetUIUtil.getCachedMetaDataHandle(handle);
  }
 catch (  SemanticException e) {
  }
  ArrayList columns=new ArrayList(10);
  if (cmdh != null) {
    for (Iterator iterator=cmdh.getResultSet().iterator(); iterator.hasNext(); ) {
      ResultSetColumnHandle element=(ResultSetColumnHandle)iterator.next();
      columns.add(element);
    }
  }
  PropertyHandle parameters=handle.getPropertyHandle(DataSetHandle.PARAMETERS_PROP);
  Iterator iter=parameters.iterator();
  if (iter != null) {
    while (iter.hasNext()) {
      Object dataSetParameter=iter.next();
      if (((DataSetParameterHandle)dataSetParameter).isOutput() == true) {
        params.add(dataSetParameter);
      }
    }
  }
  Object[] parametersArray=params.toArray();
  Object[] both=new Object[columns.toArray().length + parametersArray.length];
  System.arraycopy(columns.toArray(),0,both,0,columns.toArray().length);
  System.arraycopy(parametersArray,0,both,columns.toArray().length,parametersArray.length);
  return both;
}

Fixed version (ground truth):
/** 
 * Gets the children element of the given model using visitor.
 * @param object the handle
 */
public Object[] getChildren(Object object){
  DataSetHandle handle=(DataSetHandle)object;
  ArrayList params=new ArrayList(10);
  CachedMetaDataHandle cmdh=null;
  try {
    cmdh=DataSetUIUtil.getCachedMetaDataHandle(handle);
  }
 catch (  SemanticException e) {
  }
  ArrayList columns=new ArrayList(10);
  if (cmdh != null) {
    for (Iterator iterator=cmdh.getResultSet().iterator(); iterator.hasNext(); ) {
      ResultSetColumnHandle element=(ResultSetColumnHandle)iterator.next();
      columns.add(element);
    }
  }
  Collections.sort(columns,comp);
  PropertyHandle parameters=handle.getPropertyHandle(DataSetHandle.PARAMETERS_PROP);
  Iterator iter=parameters.iterator();
  if (iter != null) {
    while (iter.hasNext()) {
      Object dataSetParameter=iter.next();
      if (((DataSetParameterHandle)dataSetParameter).isOutput() == true) {
        params.add(dataSetParameter);
      }
    }
  }
  Object[] parametersArray=params.toArray();
  Object[] both=new Object[columns.toArray().length + parametersArray.length];
  System.arraycopy(columns.toArray(),0,both,0,columns.toArray().length);
  System.arraycopy(parametersArray,0,both,columns.toArray().length,parametersArray.length);
  return both;
}
Program: 65050
Project: 65050
Buggy source:
public PPTXCanvas(PPTXCanvas canvas,OOXmlWriter writer){
  this.presentation=canvas.presentation;
  this.part=canvas.part;
  this.imageManager=canvas.imageManager;
  this.writer=writer;
}

Fixed version (ground truth):
public PPTXCanvas(PPTXCanvas canvas,OOXmlWriter writer){
  this.presentation=canvas.presentation;
  this.part=canvas.part;
  this.imageManager=canvas.imageManager;
  this.writer=writer;
  this.clipStack=canvas.clipStack;
}
Program: 65052
Project: 65052
Buggy source:
public TableWriter(PPTXRender render){
  this.render=render;
  this.graphics=render.getGraphic();
  this.canvas=render.getCanvas();
  this.writer=canvas.getWriter();
  currentX=render.getCurrentX();
  currentY=render.getCurrentY();
}

Fixed version (ground truth):
public TableWriter(PPTXRender render){
  this.render=render;
  this.canvas=render.getCanvas();
  this.writer=canvas.getWriter();
  currentX=render.getCurrentX();
  currentY=render.getCurrentY();
}
Program: 65053
Project: 65053
Buggy source:
private void writeColumnsWidth(TableArea tablearea){
  numOfColumns=tablearea.getColumnCount();
  int columnWidth=0;
  int cellwidth=0;
  writer.openTag("String_Node_Str");
  for (int i=0; i < numOfColumns; i++) {
    cellwidth=tablearea.getCellWidth(i,i + 1);
    if (cellwidth > 0) {
      if (cellwidth < MINIMUM_COLUMN_WIDTH) {
        cellwidth=MINIMUM_COLUMN_WIDTH;
      }
      columnWidth=canvas.getScaledValue(PPTXUtil.convertToEnums(cellwidth));
      writer.openTag("String_Node_Str");
      writer.attribute("String_Node_Str",columnWidth);
      writer.closeTag("String_Node_Str");
    }
  }
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
private void writeColumnsWidth(TableArea tablearea){
  numOfColumns=tablearea.getColumnCount();
  int columnWidth=0;
  int cellwidth=0;
  writer.openTag("String_Node_Str");
  for (int i=0; i < numOfColumns; i++) {
    cellwidth=tablearea.getCellWidth(i,i + 1);
    if (cellwidth > 0) {
      if (cellwidth < MINIMUM_COLUMN_WIDTH) {
        cellwidth=MINIMUM_COLUMN_WIDTH;
      }
      columnWidth=canvas.getScaledValue(PPTXUtil.convertToEnums(cellwidth));
      writer.openTag("String_Node_Str");
      writer.attribute("String_Node_Str",columnWidth);
      writer.closeTag("String_Node_Str");
    }
 else {
      zeroColumnList.add(i);
    }
  }
  writer.closeTag("String_Node_Str");
}
Program: 65054
Project: 65054
Buggy source:
protected void drawCell(CellArea cell){
  if (cell.getWidth() == 0) {
    currentCol++;
    return;
  }
  currentX+=getX(cell);
  currentY+=getY(cell);
  updateRenderXY();
  startCell(cell);
  visitChildren(cell);
  endCell(cell);
  currentX-=getX(cell);
  currentY-=getY(cell);
  updateRenderXY();
}

Fixed version (ground truth):
protected void drawCell(CellArea cell){
  if (cell.getWidth() == 0) {
    currentCol++;
    return;
  }
  if (cell.needClip()) {
    render.startClip(cell);
  }
  currentX+=getX(cell);
  currentY+=getY(cell);
  updateRenderXY();
  startCell(cell);
  visitChildren(cell);
  endCell(cell);
  currentX-=getX(cell);
  currentY-=getY(cell);
  updateRenderXY();
  if (cell.needClip()) {
    render.endclip();
  }
}
Program: 65055
Project: 65055
Buggy source:
protected void drawTable(TableArea table){
  if (table.needClip()) {
    render.startClip(table);
  }
  currentX+=getX(table);
  currentY+=getY(table);
  updateRenderXY();
  parseTableExtraSpanRows(table);
  startTable(table);
  iterateOnRows(table);
  if (table.needClip()) {
    graphics.endClip();
  }
  currentX-=getX(table);
  currentY-=getY(table);
  updateRenderXY();
  endTable();
}

Fixed version (ground truth):
protected void drawTable(TableArea table){
  if (table.needClip()) {
    render.startClip(table);
  }
  currentX+=getX(table);
  currentY+=getY(table);
  updateRenderXY();
  startTable(table);
  parseTableExtraSpanRows(table);
  iterateOnRows(table);
  if (table.needClip()) {
    render.endclip();
  }
  currentX-=getX(table);
  currentY-=getY(table);
  updateRenderXY();
  endTable();
}
Program: 65056
Project: 65056
Buggy source:
protected void drawRow(RowArea row){
  row.setRowID(currentRow);
  if (row.getChildrenCount() == 0) {
    return;
  }
  currentX+=getX(row);
  currentY+=getY(row);
  updateRenderXY();
  BoxStyle style=row.getBoxStyle();
  if (style.getBackgroundColor() == null && style.getBackgroundImage() == null) {
    style=row.getParent().getBoxStyle();
  }
  rowStyleStack.push(style);
  startRow(row);
  Iterator<IArea> iter=row.getChildren();
  currentCol=0;
  fillEmptyMergeCells(0,0,0);
  while (iter.hasNext()) {
    IArea child=iter.next();
    drawCell((CellArea)child);
  }
  endRow();
  rowStyleStack.pop();
  currentX-=getX(row);
  currentY-=getY(row);
  updateRenderXY();
}

Fixed version (ground truth):
protected void drawRow(RowArea row){
  row.setRowID(currentRow);
  if (row.getChildrenCount() == 0) {
    return;
  }
  if (row.needClip()) {
    render.startClip(row);
  }
  currentX+=getX(row);
  currentY+=getY(row);
  updateRenderXY();
  BoxStyle style=row.getBoxStyle();
  if (style.getBackgroundColor() == null && style.getBackgroundImage() == null) {
    style=row.getParent().getBoxStyle();
  }
  rowStyleStack.push(style);
  startRow(row);
  Iterator<IArea> iter=row.getChildren();
  currentCol=0;
  fillEmptyMergeCells(0,0,0);
  while (iter.hasNext()) {
    IArea child=iter.next();
    drawCell((CellArea)child);
  }
  endRow();
  rowStyleStack.pop();
  currentX-=getX(row);
  currentY-=getY(row);
  updateRenderXY();
  if (row.needClip()) {
    render.endclip();
  }
}