nus-yam/ex-repair huggingface dataset:
Program: 66732
Project: 66732
Buggy source:
/** 
 * @throws FileNotFoundException
 */
private void initializeWriterAsTempWriter() throws FileNotFoundException {
  tempFilePath=context.getTempFileDir() + "String_Node_Str" + Thread.currentThread().getId();
  FileOutputStream out=new FileOutputStream(tempFilePath);
  tempWriter=new ExcelXmlWriter(out,context);
  writer=tempWriter;
}

Fixed version (ground truth):
/** 
 * @throws FileNotFoundException
 */
private void initializeWriterAsTempWriter() throws FileNotFoundException {
  String tempFolder=context.getTempFileDir();
  if (!(tempFolder.endsWith("String_Node_Str") || tempFolder.endsWith("String_Node_Str"))) {
    tempFolder=tempFolder.concat("String_Node_Str");
  }
  tempFilePath=tempFolder + "String_Node_Str" + UUID.randomUUID().toString();
  FileOutputStream out=new FileOutputStream(tempFilePath);
  tempWriter=new ExcelXmlWriter(out,context);
  writer=tempWriter;
}
Program: 66733
Project: 66733
Buggy source:
private IResultClass mergeResultHint(List modelResultHints,IResultClass meta){
  if (modelResultHints == null || modelResultHints.isEmpty())   return meta;
  IResultClass newResultClass;
  try {
    newResultClass=copyResultClass(meta);
  }
 catch (  Exception ex) {
    return meta;
  }
  int count=newResultClass.getFieldCount();
  try {
    for (int i=1; i <= count; i++) {
      String fieldName=newResultClass.getFieldName(i);
      Class odaType=newResultClass.getFieldMetaData(i).getDataType();
      for (int j=0; j < modelResultHints.size(); j++) {
        if (((IColumnDefinition)modelResultHints.get(j)).getColumnName().equals(fieldName)) {
          int apiType=((IColumnDefinition)modelResultHints.get(j)).getDataType();
          if (DataTypeUtil.toApiDataType(odaType) != apiType) {
            newResultClass.getFieldMetaData(i).setDataType(DataType.getClass(apiType));
          }
          break;
        }
      }
    }
  }
 catch (  Exception ex) {
  }
  return newResultClass;
}

Fixed version (ground truth):
private IResultClass mergeResultHint(List modelResultHints,IResultClass meta){
  if (modelResultHints == null || modelResultHints.isEmpty())   return meta;
  IResultClass newResultClass;
  try {
    newResultClass=copyResultClass(meta);
  }
 catch (  Exception ex) {
    return meta;
  }
  int count=newResultClass.getFieldCount();
  try {
    for (int i=1; i <= count; i++) {
      String fieldName=newResultClass.getFieldName(i);
      Class odaType=newResultClass.getFieldMetaData(i).getDataType();
      for (int j=0; j < modelResultHints.size(); j++) {
        if (((IColumnDefinition)modelResultHints.get(j)).getColumnName().equals(fieldName)) {
          int apiType=((IColumnDefinition)modelResultHints.get(j)).getDataType();
          if (apiType > 0 && DataTypeUtil.toApiDataType(odaType) != apiType) {
            newResultClass.getFieldMetaData(i).setDataType(DataType.getClass(apiType));
          }
          break;
        }
      }
    }
  }
 catch (  Exception ex) {
  }
  return newResultClass;
}
Program: 66734
Project: 66734
Buggy source:
public int getGlyphIndex(char c){
  int[] glyphIndexs=(int[])getCMap().get(c);
  return glyphIndexs[0];
}

Fixed version (ground truth):
public int getGlyphIndex(char c){
  int[] glyphIndexs=(int[])getCMap().get((int)c);
  return glyphIndexs[0];
}
Program: 66735
Project: 66735
Buggy source:
/** 
 * Look for the Driver from drivers directory if it not in plugin class path
 * @param className
 * @return Driver instance
 * @throws OdaException 
 */
private Driver findDriver(String className,Collection<String> driverClassPath,boolean refreshClassLoader) throws OdaException {
  Class driverClass=null;
  try {
    driverClass=Class.forName(className);
    logger.info("String_Node_Str" + className);
  }
 catch (  ClassNotFoundException e) {
    if (logger.isLoggable(Level.FINE)) {
      logger.info("String_Node_Str" + className + "String_Node_Str");
    }
    driverClass=loadExtraDriver(className,true,refreshClassLoader,driverClassPath);
    if (driverClass == null) {
      ClassLoader loader=Thread.currentThread().getContextClassLoader();
      if (loader != null) {
        try {
          driverClass=Class.forName(className,true,loader);
        }
 catch (        ClassNotFoundException e1) {
          driverClass=null;
        }
      }
    }
  }
  if (driverClass == null) {
    logger.warning("String_Node_Str" + className);
    throw new JDBCException(ResourceConstants.CANNOT_LOAD_DRIVER,null,className);
  }
  Driver driver=null;
  try {
    driver=this.getDriverInstance(driverClass);
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str" + className,e);
    throw new JDBCException(ResourceConstants.CANNOT_INSTANTIATE_DRIVER,null,className);
  }
  return driver;
}

Fixed version (ground truth):
/** 
 * Look for the Driver from drivers directory if it not in plugin class path
 * @param className
 * @return Driver instance
 * @throws OdaException 
 */
private Driver findDriver(String className,Collection<String> driverClassPath,boolean refreshClassLoader,boolean refreshDriver) throws OdaException {
  Class driverClass=null;
  try {
    driverClass=Class.forName(className);
    logger.info("String_Node_Str" + className);
  }
 catch (  ClassNotFoundException e) {
    if (logger.isLoggable(Level.FINE)) {
      logger.info("String_Node_Str" + className + "String_Node_Str");
    }
    driverClass=loadExtraDriver(className,true,refreshClassLoader,driverClassPath);
    if (driverClass == null) {
      ClassLoader loader=Thread.currentThread().getContextClassLoader();
      if (loader != null) {
        try {
          driverClass=Class.forName(className,true,loader);
        }
 catch (        ClassNotFoundException e1) {
          driverClass=null;
        }
      }
    }
  }
  if (driverClass == null) {
    logger.warning("String_Node_Str" + className);
    throw new JDBCException(ResourceConstants.CANNOT_LOAD_DRIVER,null,className);
  }
  Driver driver=null;
  try {
    driver=this.getDriverInstance(driverClass,refreshDriver);
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str" + className,e);
    throw new JDBCException(ResourceConstants.CANNOT_INSTANTIATE_DRIVER,null,className);
  }
  return driver;
}
Program: 66736
Project: 66736
Buggy source:
/** 
 * Deregister the driver by the given class name from DriverManager
 * @param className
 * @return true if deregister the driver successfully
 * @throws OdaException
 */
public boolean deregisterDriver(String className) throws OdaException {
  if (className == null || className.length() == 0)   return false;
  if (isDeregistered(className)) {
    return true;
  }
  Driver driver=findDriver(className,null,false);
  if (driver != null) {
    try {
      if (logger.isLoggable(Level.FINER))       logger.finer("String_Node_Str" + className);
      if (registeredDrivers.containsKey(className)) {
        DriverManager.deregisterDriver(new WrappedDriver(driver,className));
        registeredDrivers.remove(className);
      }
      registeredDrivers.put(className,DRIVER_DEREGISTERED);
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,"String_Node_Str",e);
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Deregister the driver by the given class name from DriverManager
 * @param className
 * @return true if deregister the driver successfully
 * @throws OdaException
 */
public boolean deregisterDriver(String className) throws OdaException {
  if (className == null || className.length() == 0)   return false;
  if (isDeregistered(className)) {
    return true;
  }
  Driver driver=findDriver(className,null,false,false);
  if (driver != null) {
    try {
      if (logger.isLoggable(Level.FINER))       logger.finer("String_Node_Str" + className);
      if (registeredDrivers.containsKey(className)) {
        DriverManager.deregisterDriver(new WrappedDriver(driver,className));
        registeredDrivers.remove(className);
      }
      registeredDrivers.put(className,DRIVER_DEREGISTERED);
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,"String_Node_Str",e);
    }
  }
  return true;
}
Program: 66737
Project: 66737
Buggy source:
/** 
 * Implementation of getConnection() methods. Gets connection from either java.sql.DriverManager,  or from IConnectionFactory defined in the extension
 */
private synchronized Connection doConnect(String driverClass,String url,String jndiNameUrl,Properties connectionProperties,Collection<String> driverClassPath) throws SQLException, OdaException {
  Connection jndiDSConnection=getJndiDSConnection(driverClass,jndiNameUrl,connectionProperties);
  if (jndiDSConnection != null)   return jndiDSConnection;
  IConnectionFactory factory=getDriverConnectionFactory(driverClass);
  if (factory != null) {
    if (logger.isLoggable(Level.FINER))     logger.finer("String_Node_Str" + driverClass + "String_Node_Str"+ LogUtil.encryptURL(url));
    return factory.getConnection(driverClass,url,connectionProperties);
  }
  loadAndRegisterDriver(driverClass,driverClassPath);
  if (logger.isLoggable(Level.FINER))   logger.finer("String_Node_Str" + LogUtil.encryptURL(url));
  try {
    return DriverManager.getConnection(url,connectionProperties);
  }
 catch (  Exception e) {
    registerDriver(driverClass,null,true);
    try {
      return DriverManager.getConnection(url,connectionProperties);
    }
 catch (    Exception ex) {
      throw new JDBCException(ResourceConstants.CONN_GET_ERROR,null,truncate(ex.getLocalizedMessage()));
    }
  }
}

Fixed version (ground truth):
/** 
 * Implementation of getConnection() methods. Gets connection from either java.sql.DriverManager,  or from IConnectionFactory defined in the extension
 */
private synchronized Connection doConnect(String driverClass,String url,String jndiNameUrl,Properties connectionProperties,Collection<String> driverClassPath) throws SQLException, OdaException {
  Connection jndiDSConnection=getJndiDSConnection(driverClass,jndiNameUrl,connectionProperties);
  if (jndiDSConnection != null)   return jndiDSConnection;
  IConnectionFactory factory=getDriverConnectionFactory(driverClass);
  if (factory != null) {
    if (logger.isLoggable(Level.FINER))     logger.finer("String_Node_Str" + driverClass + "String_Node_Str"+ LogUtil.encryptURL(url));
    return factory.getConnection(driverClass,url,connectionProperties);
  }
  loadAndRegisterDriver(driverClass,driverClassPath);
  if (logger.isLoggable(Level.FINER))   logger.finer("String_Node_Str" + LogUtil.encryptURL(url));
  try {
    return DriverManager.getConnection(url,connectionProperties);
  }
 catch (  Exception e) {
    registerDriver(driverClass,null,true,true);
    try {
      return DriverManager.getConnection(url,connectionProperties);
    }
 catch (    Exception ex) {
      throw new JDBCException(ResourceConstants.CONN_GET_ERROR,null,truncate(ex.getLocalizedMessage()));
    }
  }
}
Program: 66738
Project: 66738
Buggy source:
public Driver getDriverInstance(Class driver) throws OdaException {
  String driverName=driver.getName();
  if (this.cachedJdbcDriver.containsKey(driverName)) {
    return this.cachedJdbcDriver.get(driverName);
  }
 else {
    Driver instance=null;
    try {
      instance=(Driver)driver.newInstance();
    }
 catch (    Exception e) {
      throw new OdaException(e);
    }
    this.cachedJdbcDriver.put(driverName,instance);
    return instance;
  }
}

Fixed version (ground truth):
public Driver getDriverInstance(Class driver,boolean refreshDriver) throws OdaException {
  String driverName=driver.getName();
  if (refreshDriver || !this.cachedJdbcDriver.containsKey(driverName)) {
    Driver instance=null;
    try {
      instance=(Driver)driver.newInstance();
    }
 catch (    Exception e) {
      throw new OdaException(e);
    }
    this.cachedJdbcDriver.put(driverName,instance);
    return instance;
  }
 else {
    return this.cachedJdbcDriver.get(driverName);
  }
}
Program: 66739
Project: 66739
Buggy source:
/** 
 * If driver is found in the drivers directory, its class is not accessible in this class's ClassLoader. DriverManager will not allow this class to create connections using such driver. To solve the problem, we create a wrapper Driver in  our class loader, and register it with DriverManager
 * @param className
 * @param driverClassPath
 * @param refreshClassLoader
 * @throws OdaException
 */
private void registerDriver(String className,Collection<String> driverClassPath,boolean refreshClassLoader) throws OdaException {
  Driver driver=findDriver(className,driverClassPath,refreshClassLoader);
  if (driver != null) {
    try {
      if (logger.isLoggable(Level.FINER))       logger.finer("String_Node_Str" + className);
      DriverManager.registerDriver(new WrappedDriver(driver,className));
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,"String_Node_Str",e);
    }
  }
  registeredDrivers.put(className,DRIVER_REGISTERED);
}

Fixed version (ground truth):
/** 
 * If driver is found in the drivers directory, its class is not accessible in this class's ClassLoader. DriverManager will not allow this class to create connections using such driver. To solve the problem, we create a wrapper Driver in  our class loader, and register it with DriverManager
 * @param className
 * @param driverClassPath
 * @param refreshClassLoader
 * @throws OdaException
 */
private void registerDriver(String className,Collection<String> driverClassPath,boolean refreshClassLoader,boolean refreshDriver) throws OdaException {
  Driver driver=findDriver(className,driverClassPath,refreshClassLoader,refreshDriver);
  if (driver != null) {
    try {
      if (logger.isLoggable(Level.FINER))       logger.finer("String_Node_Str" + className);
      DriverManager.registerDriver(new WrappedDriver(driver,className));
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,"String_Node_Str",e);
    }
  }
  registeredDrivers.put(className,DRIVER_REGISTERED);
}
Program: 66740
Project: 66740
Buggy source:
public void loadAndRegisterDriver(String className,Collection<String> driverClassPath) throws OdaException {
  if (className == null || className.length() == 0)   return;
  if (isDeregistered(className)) {
    throw new JDBCException(ResourceConstants.CANNOT_LOAD_DRIVER,null,className);
  }
 else   if (this.registeredDrivers.containsKey(className)) {
    return;
  }
  if (logger.isLoggable(Level.FINE)) {
    logger.info("String_Node_Str" + className);
  }
  registerDriver(className,driverClassPath,false);
}

Fixed version (ground truth):
public void loadAndRegisterDriver(String className,Collection<String> driverClassPath) throws OdaException {
  if (className == null || className.length() == 0)   return;
  if (isDeregistered(className)) {
    throw new JDBCException(ResourceConstants.CANNOT_LOAD_DRIVER,null,className);
  }
 else   if (this.registeredDrivers.containsKey(className)) {
    return;
  }
  if (logger.isLoggable(Level.FINE)) {
    logger.info("String_Node_Str" + className);
  }
  registerDriver(className,driverClassPath,false,false);
}
Program: 66741
Project: 66741
Buggy source:
/** 
 * add several common use page for Birt data set editor
 * @param ds
 */
protected void addCommonPages(DataSetHandle ds){
  if (ds instanceof ScriptDataSetHandle) {
    addScriptOutputColumnDefnPage();
    addParametersPage();
    addFiltersPage();
    addDataSetSettingPage(ds);
    addResultSetPreviewPage();
  }
 else   if (ds instanceof OdaDataSetHandle) {
    addOutputColumnsPage();
    addComputedColumnsPage();
    if (includeInputParameterPage)     addParametersPage();
    addDataSetFilterPage();
    addPropertyBindingPage();
    addDataSetSettingPage(ds);
    if (includeOutputParameterPage)     addOutputParameterPreviewPage();
    addResultSetPreviewPage();
  }
 else   if (ds instanceof JointDataSetHandle) {
    addJointDataSetPage();
    addOutputColumnsPage();
    addComputedColumnsPage();
    addParametersPage();
    addFiltersPage();
    addResultSetPreviewPage();
  }
 else {
    IPropertyPage[] pages=ExternalUIUtil.getCommonPages(ds);
    if (pages != null && pages.length > 0) {
      for (int i=0; i < pages.length; i++) {
        addPageTo("String_Node_Str",pages[i].getClass().getName(),pages[i].getName(),null,pages[i]);
      }
      if (!needToFocusOnOutput && pages.length > 0) {
        setDefaultNode(pages[0].getClass().getName());
      }
      addOutputColumnsPage();
      if (ExternalUIUtil.needUtilityPages(ds)) {
        addComputedColumnsPage();
        addParametersPage();
        addFiltersPage();
      }
      addResultSetPreviewPage();
    }
  }
}

Fixed version (ground truth):
/** 
 * add several common use page for Birt data set editor
 * @param ds
 */
protected void addCommonPages(DataSetHandle ds){
  if (ds instanceof ScriptDataSetHandle) {
    addScriptOutputColumnDefnPage();
    addParametersPage();
    addFiltersPage();
    addDataSetSettingPage(ds);
    addResultSetPreviewPage();
  }
 else   if (ds instanceof OdaDataSetHandle) {
    addOutputColumnsPage();
    addComputedColumnsPage();
    if (includeInputParameterPage)     addParametersPage();
    addDataSetFilterPage();
    addPropertyBindingPage();
    addDataSetSettingPage(ds);
    if (includeOutputParameterPage)     addOutputParameterPreviewPage();
    addResultSetPreviewPage();
  }
 else   if (ds instanceof JointDataSetHandle) {
    addJointDataSetPage();
    addOutputColumnsPage();
    addComputedColumnsPage();
    addParametersPage();
    addFiltersPage();
    addResultSetPreviewPage();
  }
 else {
    IPropertyPage[] pages=ExternalUIUtil.getCommonPages(ds);
    if (pages != null && pages.length > 0) {
      for (int i=0; i < pages.length; i++) {
        addPageTo("String_Node_Str",pages[i].getClass().getName(),pages[i].getName(),null,pages[i]);
      }
      if (!needToFocusOnOutput && pages.length > 0) {
        setDefaultNode(pages[0].getClass().getName());
      }
      addOutputColumnsPage();
      addComputedColumnsPage();
      addParametersPage();
      addFiltersPage();
      addResultSetPreviewPage();
    }
  }
}
Program: 66742
Project: 66742
Buggy source:
public DataSetPreviewer(DataSetHandle dataSetHandle,int maxRow){
  this.dataSetHandle=dataSetHandle;
  this.maxRow=maxRow;
}

Fixed version (ground truth):
public DataSetPreviewer(DataSetHandle dataSetHandle,int maxRow,DataSetEditor container){
  this.dataSetHandle=dataSetHandle;
  this.maxRow=maxRow;
}
Program: 66744
Project: 66744
Buggy source:
protected final void clearResultSetTable(){
  if (recordList == null)   recordList=new ArrayList();
 else   recordList.clear();
  resultSetTable.removeAll();
  TableColumn[] columns=resultSetTable.getColumns();
  for (int n=0; n < columns.length; n++) {
    columns[n].dispose();
  }
}

Fixed version (ground truth):
protected final void clearResultSetTable(){
  if (recordList == null)   recordList=new ArrayList();
 else   recordList.clear();
  resultSetTable.removeAll();
  if (this.errorList != null) {
    this.errorList.clear();
  }
  TableColumn[] columns=resultSetTable.getColumns();
  for (int n=0; n < columns.length; n++) {
    columns[n].dispose();
  }
}
Program: 66747
Project: 66747
Buggy source:
public void doSave(DataOutputStream outputStream,DataOutputStream rowLensStream,Map<String,StringTable> stringTable,Map<String,IIndexSerializer> index,List<IBinding> cacheRequestMap) throws DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=this.resultObjects.length;
    int colCount=this.rsMeta.getFieldCount();
    IOUtil.writeInt(dos,rowCount);
    long offset=4;
    for (int i=0; i < rowCount; i++) {
      IOUtil.writeLong(rowLensStream,offset);
      offset+=ResultSetUtil.writeResultObject(dos,resultObjects[i],colCount,resultSetNameSet,stringTable,index,i);
    }
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}

Fixed version (ground truth):
public void doSave(DataOutputStream outputStream,DataOutputStream rowLensStream,Map<String,StringTable> stringTable,Map<String,IIndexSerializer> index,List<IBinding> cacheRequestMap) throws DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=this.resultObjects.length;
    int colCount=getColumnCount(this.rsMeta);
    IOUtil.writeInt(dos,rowCount);
    long offset=4;
    for (int i=0; i < rowCount; i++) {
      IOUtil.writeLong(rowLensStream,offset);
      offset+=ResultSetUtil.writeResultObject(dos,resultObjects[i],colCount,resultSetNameSet,stringTable,index,i);
    }
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}
Program: 66748
Project: 66748
Buggy source:
public CellArea cloneArea(){
  CellArea cloneCell=cell.cloneArea();
  cell.setRowSpan(cell.getRowSpan() - cell.getUsedRowSpan() + 1);
  return cloneCell;
}

Fixed version (ground truth):
public CellArea cloneArea(){
  CellArea cloneCell=cell.cloneArea();
  return cloneCell;
}
Program: 66749
Project: 66749
Buggy source:
public void relayoutChildren() throws BirtException {
  String nextRowId=null;
  if (layout.unresolvedRow != null) {
    nextRowId=this.getNextRowId(layout.unresolvedRow);
  }
  layout.clear();
  addRows(this,layout,nextRowId);
  layout.mergeUnresolvedRowHint();
}

Fixed version (ground truth):
public void relayoutChildren() throws BirtException {
  String nextRowId=null;
  if (unresolvedRow != null) {
    nextRowId=this.getNextRowId(unresolvedRow);
  }
  layout.clear();
  setUnresolvedRow=false;
  addRows(this,layout,nextRowId);
  setUnresolvedRow();
}
Program: 66750
Project: 66750
Buggy source:
public SplitResult split(int height,boolean force) throws BirtException {
  SplitResult result=super.split(height,force);
  if (result.getResult() != null) {
    TableArea tableResult=(TableArea)result.getResult();
    unresolvedRow=tableResult.getLastRow();
    int h=tableResult.layout.resolveAll(unresolvedRow);
    if (h > 0) {
      tableResult.setHeight(tableResult.getHeight() + h);
    }
    tableResult.resolveBottomBorder();
    layout.setUnresolvedRow(unresolvedRow);
    if (context.isFixedLayout()) {
      FixedLayoutPageHintGenerator pageHintGenerator=context.getPageHintGenerator();
      if (pageHintGenerator != null && unresolvedRow != null) {
        InstanceID unresolvedTableIID=unresolvedRow.getTableArea().getContent().getInstanceID();
        if (unresolvedTableIID != null) {
          pageHintGenerator.addUnresolvedRowHint(unresolvedTableIID.toUniqueString(),convertRowToHint(unresolvedRow));
        }
      }
    }
  }
  relayoutChildren();
  return result;
}

Fixed version (ground truth):
public SplitResult split(int height,boolean force) throws BirtException {
  SplitResult result=super.split(height,force);
  if (result.getResult() != null) {
    TableArea tableResult=(TableArea)result.getResult();
    unresolvedRow=tableResult.getLastRow();
    int h=tableResult.layout.resolveAll(unresolvedRow);
    if (h > 0) {
      tableResult.setHeight(tableResult.getHeight() + h);
    }
    tableResult.resolveBottomBorder();
    if (context.isFixedLayout()) {
      FixedLayoutPageHintGenerator pageHintGenerator=context.getPageHintGenerator();
      if (pageHintGenerator != null && unresolvedRow != null) {
        InstanceID unresolvedTableIID=unresolvedRow.getTableArea().getContent().getInstanceID();
        if (unresolvedTableIID != null) {
          pageHintGenerator.addUnresolvedRowHint(unresolvedTableIID.toUniqueString(),convertRowToHint(unresolvedRow));
        }
      }
    }
  }
  relayoutChildren();
  return result;
}
Program: 66751
Project: 66751
Buggy source:
protected void addRows(ContainerArea container,TableLayout layout,String rowId) throws BirtException {
  if (container instanceof RowArea) {
    RowArea row=(RowArea)container;
    InstanceID id=row.getContent().getInstanceID();
    if (rowId != null && id != null && rowId.equals(id.toUniqueString())) {
      layout.mergeUnresolvedRowHint();
    }
    if (row.needResolveBorder) {
      int size=row.getChildrenCount();
      for (int i=0; i < size; i++) {
        CellArea cell=(CellArea)row.getChild(i);
        int ch=cell.getContentHeight();
        cell.boxStyle.clearBorder();
        layout.resolveBorderConflict(cell,true);
        cell.setContentHeight(ch);
      }
      row.needResolveBorder=false;
    }
    if (row.finished) {
      if (row.getChildrenCount() != row.cells.length) {
        for (int i=0; i < row.cells.length; i++) {
          if (row.cells[i] instanceof DummyCell) {
            row.cells[i]=null;
          }
        }
      }
      layout.addRow(row,context.isFixedLayout());
    }
  }
 else {
    int size=container.getChildrenCount();
    for (int i=0; i < size; i++) {
      ContainerArea child=(ContainerArea)container.getChild(i);
      addRows(child,layout,rowId);
      child.updateChildrenPosition();
    }
    container.updateChildrenPosition();
  }
}

Fixed version (ground truth):
protected void addRows(ContainerArea container,TableLayout layout,String rowId) throws BirtException {
  if (container instanceof RowArea) {
    RowArea row=(RowArea)container;
    InstanceID id=row.getContent().getInstanceID();
    if (rowId != null && id != null && rowId.equals(id.toUniqueString())) {
      setUnresolvedRow();
    }
    if (row.needResolveBorder) {
      int size=row.getChildrenCount();
      for (int i=0; i < size; i++) {
        CellArea cell=(CellArea)row.getChild(i);
        int ch=cell.getContentHeight();
        cell.boxStyle.clearBorder();
        layout.resolveBorderConflict(cell,true);
        cell.setContentHeight(ch);
      }
      row.needResolveBorder=false;
    }
    if (row.finished) {
      if (row.getChildrenCount() != row.cells.length) {
        for (int i=0; i < row.cells.length; i++) {
          if (row.cells[i] instanceof DummyCell) {
            row.cells[i]=null;
          }
        }
      }
      layout.addRow(row,context.isFixedLayout());
    }
  }
 else {
    int size=container.getChildrenCount();
    for (int i=0; i < size; i++) {
      ContainerArea child=(ContainerArea)container.getChild(i);
      addRows(child,layout,rowId);
      child.updateChildrenPosition();
    }
    container.updateChildrenPosition();
  }
}
Program: 66754
Project: 66754
Buggy source:
/** 
 * Populate the dimension.
 * @param cubeMaterializer
 * @param dim
 * @param stopSign
 * @return
 * @throws AdapterException 
 * @throws IOException
 * @throws BirtException
 * @throws DataException
 */
private IDimension populateTempPKDimension(CubeMaterializer cubeMaterializer,TabularCubeHandle cubeHandle,Map appContext) throws AdapterException {
  QueryDefinition q=null;
  ILevelDefn[] tempLevels=new ILevelDefn[]{CubeElementFactory.createLevelDefinition(getCubeTempPKFieldName(cubeHandle),new String[]{getCubeTempPKFieldName(cubeHandle)},new String[]{})};
  IHierarchy h=null;
  try {
    q=createQueryForTempPKDimension(cubeHandle);
    h=cubeMaterializer.createHierarchy(getCubeTempPKDimensionName(cubeHandle),getCubeTempPKHierarchyName(cubeHandle),new DataSetIteratorForTempPK(this,q,appContext),tempLevels,dataEngine.getSession().getStopSign());
  }
 catch (  Exception e) {
    throw new AdapterException(ResourceConstants.CUBE_HIERARCHY_CREATION_ERROR,e,getCubeTempPKDimensionName(cubeHandle) + "String_Node_Str" + getCubeTempPKHierarchyName(cubeHandle));
  }
  try {
    return cubeMaterializer.createDimension(getCubeTempPKDimensionName(cubeHandle),h);
  }
 catch (  Exception e) {
    throw new AdapterException(ResourceConstants.CUBE_DIMENSION_CREATION_ERROR,e,getCubeTempPKDimensionName(cubeHandle));
  }
}

Fixed version (ground truth):
/** 
 * Populate the dimension.
 * @param cubeMaterializer
 * @param dim
 * @param stopSign
 * @return
 * @throws AdapterException 
 * @throws IOException
 * @throws BirtException
 * @throws DataException
 */
private IDimension populateTempPKDimension(CubeMaterializer cubeMaterializer,TabularCubeHandle cubeHandle,DataSetIteratorForTempPK dataForTempPK,Map appContext) throws AdapterException {
  QueryDefinition q=null;
  ILevelDefn[] tempLevels=new ILevelDefn[]{CubeElementFactory.createLevelDefinition(getCubeTempPKFieldName(cubeHandle),new String[]{getCubeTempPKFieldName(cubeHandle)},new String[]{})};
  IHierarchy h=null;
  try {
    h=cubeMaterializer.createHierarchy(getCubeTempPKDimensionName(cubeHandle),getCubeTempPKHierarchyName(cubeHandle),dataForTempPK,tempLevels,dataEngine.getSession().getStopSign());
  }
 catch (  Exception e) {
    throw new AdapterException(ResourceConstants.CUBE_HIERARCHY_CREATION_ERROR,e,getCubeTempPKDimensionName(cubeHandle) + "String_Node_Str" + getCubeTempPKHierarchyName(cubeHandle));
  }
  try {
    return cubeMaterializer.createDimension(getCubeTempPKDimensionName(cubeHandle),h);
  }
 catch (  Exception e) {
    throw new AdapterException(ResourceConstants.CUBE_DIMENSION_CREATION_ERROR,e,getCubeTempPKDimensionName(cubeHandle));
  }
}
Program: 66755
Project: 66755
Buggy source:
@SuppressWarnings("String_Node_Str") DataSetIteratorForTempPK(DataRequestSessionImpl session,IQueryDefinition query,Map appContext) throws BirtException {
  IBinding b=new Binding(COUNT_BINDING_NAME);
  b.setAggrFunction(IBuildInAggregation.TOTAL_COUNT_FUNC);
  query.addBinding(b);
  executeQuery(session,query,appContext);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") DataSetIteratorForTempPK(int rowCount) throws BirtException {
  this.rowCount=rowCount;
}
Program: 66756
Project: 66756
Buggy source:
private int[] calculateColumnCoordinates(ColumnsInfo table,int startCoordinate,int endCoordinate,boolean autoExtend){
  int columnCount=table != null ? table.getColumnCount() : 0;
  int[] columnStartCoordinates=new int[columnCount + 1];
  columnStartCoordinates[0]=startCoordinate;
  for (int i=1; i <= columnCount; i++) {
    if (!autoExtend && (columnStartCoordinates[i - 1] + table.getColumnWidth(i - 1)) > endCoordinate) {
      columnStartCoordinates[i]=endCoordinate;
    }
 else     columnStartCoordinates[i]=columnStartCoordinates[i - 1] + table.getColumnWidth(i - 1);
  }
  return columnStartCoordinates;
}

Fixed version (ground truth):
private int[] calculateColumnCoordinates(ColumnsInfo table,int startCoordinate,int endCoordinate,boolean autoExtend){
  XlsContainer currentContainer=getCurrentContainer();
  if (table == null) {
    return new int[0];
  }
  int columnCount=table.getColumnCount();
  int totalWidth=0;
  for (int i=0; i < columnCount; i++) {
    totalWidth+=table.getColumnWidth(i);
  }
  boolean overflow=totalWidth > endCoordinate - startCoordinate;
  int[] columnStartCoordinates=new int[columnCount + 1];
  if (isRightAligned(currentContainer) && !(overflow && autoExtend)) {
    columnStartCoordinates[columnCount]=endCoordinate;
    for (int i=columnCount - 1; i >= 0; i--) {
      columnStartCoordinates[i]=Math.max(startCoordinate,columnStartCoordinates[i + 1] - table.getColumnWidth(i));
    }
  }
 else {
    columnStartCoordinates[0]=startCoordinate;
    for (int i=1; i <= columnCount; i++) {
      if (!autoExtend && (columnStartCoordinates[i - 1] + table.getColumnWidth(i - 1)) > endCoordinate) {
        columnStartCoordinates[i]=endCoordinate;
      }
 else       columnStartCoordinates[i]=columnStartCoordinates[i - 1] + table.getColumnWidth(i - 1);
    }
  }
  return columnStartCoordinates;
}
Program: 66757
Project: 66757
Buggy source:
void preDefineCube(Map appContext,CubeHandle handle) throws BirtException ;

Fixed version (ground truth):
void preDefineCube(DataSessionContext appContext,CubeHandle handle) throws BirtException ;
Program: 66758
Project: 66758
Buggy source:
/** 
 * @param appContext
 * @param dsource
 * @param dset
 * @param moduleHandle
 * @throws BirtException
 */
void preDefineDataSet(Map appContext,IBaseDataSourceDesign dsource,IBaseDataSetDesign dset,ModuleHandle moduleHandle) throws BirtException ;

Fixed version (ground truth):
/** 
 * @param appContext
 * @param dsource
 * @param dset
 * @param moduleHandle
 * @throws BirtException
 */
void preDefineDataSet(DataSessionContext appContext,IBaseDataSourceDesign dsource,IBaseDataSetDesign dset,ModuleHandle moduleHandle) throws BirtException ;
Program: 66759
Project: 66759
Buggy source:
public void defineCube(CubeHandle cubeHandle) throws BirtException {
  CubeHandleUtil.defineCube(dataEngine,cubeHandle,this.sessionContext.getAppContext());
  ICubeInterceptor cubeInterceptor=CubeInterceptorFinder.find(cubeHandle);
  if (cubeInterceptor != null) {
    cubeInterceptor.preDefineCube(this.sessionContext.getAppContext(),cubeHandle);
    if (this.cubeInterceptorList == null) {
      this.cubeInterceptorList=new ArrayList<ICubeInterceptor>();
    }
    this.cubeInterceptorList.add(cubeInterceptor);
  }
  if (cubeInterceptor == null || cubeInterceptor.needDefineCube()) {
    Set involvedDataSets=getInvolvedDataSets((TabularCubeHandle)cubeHandle);
    Iterator itr=involvedDataSets.iterator();
    while (itr.hasNext()) {
      DataSetHandle dsHandle=(DataSetHandle)itr.next();
      BaseDataSourceDesign baseDataSource=this.modelAdaptor.adaptDataSource(dsHandle.getDataSource());
      BaseDataSetDesign baseDataSet=this.modelAdaptor.adaptDataSet(dsHandle);
      if (baseDataSource != null && this.dataEngine.getDataSourceRuntime(baseDataSource.getName()) == null)       this.defineDataSource(baseDataSource);
      if (this.dataEngine.getDataSetDesign(baseDataSet.getName()) == null) {
        DefineDataSourceSetUtil.defineDataSourceAndDataSet(dsHandle,this);
      }
    }
    if (!cubeHandleMap.containsKey(cubeHandle.getQualifiedName())) {
      this.cubeHandleMap.put(cubeHandle.getQualifiedName(),cubeHandle);
    }
    prepareForCubeGeneration((TabularCubeHandle)cubeHandle);
  }
}

Fixed version (ground truth):
public void defineCube(CubeHandle cubeHandle) throws BirtException {
  CubeHandleUtil.defineCube(dataEngine,cubeHandle,this.sessionContext.getAppContext());
  ICubeInterceptor cubeInterceptor=CubeInterceptorFinder.find(cubeHandle);
  if (cubeInterceptor != null) {
    cubeInterceptor.preDefineCube(this.sessionContext,cubeHandle);
    if (this.cubeInterceptorList == null) {
      this.cubeInterceptorList=new ArrayList<ICubeInterceptor>();
    }
    this.cubeInterceptorList.add(cubeInterceptor);
  }
  if (cubeInterceptor == null || cubeInterceptor.needDefineCube()) {
    Set involvedDataSets=getInvolvedDataSets((TabularCubeHandle)cubeHandle);
    Iterator itr=involvedDataSets.iterator();
    while (itr.hasNext()) {
      DataSetHandle dsHandle=(DataSetHandle)itr.next();
      BaseDataSourceDesign baseDataSource=this.modelAdaptor.adaptDataSource(dsHandle.getDataSource());
      BaseDataSetDesign baseDataSet=this.modelAdaptor.adaptDataSet(dsHandle);
      if (baseDataSource != null && this.dataEngine.getDataSourceRuntime(baseDataSource.getName()) == null)       this.defineDataSource(baseDataSource);
      if (this.dataEngine.getDataSetDesign(baseDataSet.getName()) == null) {
        DefineDataSourceSetUtil.defineDataSourceAndDataSet(dsHandle,this);
      }
    }
    if (!cubeHandleMap.containsKey(cubeHandle.getQualifiedName())) {
      this.cubeHandleMap.put(cubeHandle.getQualifiedName(),cubeHandle);
    }
    prepareForCubeGeneration((TabularCubeHandle)cubeHandle);
  }
}
Program: 66760
Project: 66760
Buggy source:
public void defineDataSet(IBaseDataSetDesign design) throws BirtException {
  IDataSetInterceptor dataSetInterceptor=DataSetInterceptorFinder.find(design);
  if (dataSetInterceptor != null) {
    dataSetInterceptor.preDefineDataSet(sessionContext.getAppContext(),dataEngine.getDataSourceDesign(design.getDataSourceName()),design,getDataSessionContext().getModuleHandle());
    if (this.dataSetInterceptorList == null) {
      this.dataSetInterceptorList=new ArrayList<IDataSetInterceptor>();
    }
    this.dataSetInterceptorList.add(dataSetInterceptor);
  }
  dataEngine.defineDataSet(design);
}

Fixed version (ground truth):
public void defineDataSet(IBaseDataSetDesign design) throws BirtException {
  IDataSetInterceptor dataSetInterceptor=DataSetInterceptorFinder.find(design);
  if (dataSetInterceptor != null) {
    dataSetInterceptor.preDefineDataSet(sessionContext,dataEngine.getDataSourceDesign(design.getDataSourceName()),design,getDataSessionContext().getModuleHandle());
    if (this.dataSetInterceptorList == null) {
      this.dataSetInterceptorList=new ArrayList<IDataSetInterceptor>();
    }
    this.dataSetInterceptorList.add(dataSetInterceptor);
  }
  dataEngine.defineDataSet(design);
}
Program: 66761
Project: 66761
Buggy source:
public void setReportContent(ReportContent content){
  this.reportContent=content;
  content.setReportContext(reportContext);
}

Fixed version (ground truth):
public void setReportContent(ReportContent content){
  this.reportContent=content;
  if (contentErrors.size() > 0) {
    reportContent.getErrors().addAll(contentErrors);
    contentErrors.clear();
  }
  content.setReportContext(reportContext);
}
Program: 66763
Project: 66763
Buggy source:
/** 
 * The alias name is unique or not
 * @param newValue
 * @return
 */
protected boolean isUnique(String newValue){
  DataSetViewData[] items=null;
  if (viewer == null || viewer.getViewer() == null) {
    items=DataSetProvider.getCurrentInstance().getColumns(((DataSetEditor)getContainer()).getHandle(),false,true,true);
  }
 else {
    items=(DataSetViewData[])viewer.getViewer().getInput();
  }
  for (int i=0; i < items.length; i++) {
    if ((items[i].getAlias() != null && items[i].getAlias().equals(newValue)) || (items[i].getName() != null && items[i].getName().equals(newValue))) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * The alias name is unique or not
 * @param newValue
 * @return
 */
protected boolean isUnique(String newValue,DataSetViewData currentItem){
  DataSetViewData[] items=null;
  if (viewer == null || viewer.getViewer() == null) {
    items=DataSetProvider.getCurrentInstance().getColumns(((DataSetEditor)getContainer()).getHandle(),false,true,true);
  }
 else {
    items=(DataSetViewData[])viewer.getViewer().getInput();
  }
  for (int i=0; i < items.length; i++) {
    if (items[i].getName() != null && items[i].getName().equals(currentItem.getName())) {
      continue;
    }
    if ((items[i].getAlias() != null && items[i].getAlias().equals(newValue)) || (items[i].getName() != null && items[i].getName().equals(newValue))) {
      return false;
    }
  }
  return true;
}
Program: 66764
Project: 66764
Buggy source:
private void createTextCell(Composite parent,final int index) throws IllegalArgumentException, IntrospectionException, IllegalAccessException, InvocationTargetException {
  final Text tx=ControlProvider.createText(parent,(String)Utility.getProperty(data,cellProperties[index]));
  tx.setLayoutData(ControlProvider.getGridDataWithHSpan(2));
  if (index < 2) {
    tx.setEditable(false);
  }
 else {
    tx.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent e){
        try {
          if (index == 2) {
            boolean isUniqueName=isUnique(tx.getText());
            if (!isUniqueName)             updateStatus(getMiscStatus(IStatus.ERROR,Messages.getString("String_Node_Str")));
 else             updateStatus(getOKStatus());
          }
          Object txText=tx.getText();
          if (tx.getText().trim().length() == 0)           txText=null;
          Utility.setProperty(data,cellProperties[index],txText);
        }
 catch (        Exception e1) {
          ExceptionHandler.handle(e1);
        }
      }
    }
);
  }
  if (index == 2) {
    tx.setFocus();
  }
}

Fixed version (ground truth):
private void createTextCell(Composite parent,final int index) throws IllegalArgumentException, IntrospectionException, IllegalAccessException, InvocationTargetException {
  final Text tx=ControlProvider.createText(parent,(String)Utility.getProperty(data,cellProperties[index]));
  tx.setLayoutData(ControlProvider.getGridDataWithHSpan(2));
  if (index < 2) {
    tx.setEditable(false);
  }
 else {
    tx.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent e){
        try {
          if (index == 2) {
            boolean isUniqueName=isUnique(tx.getText(),data);
            if (!isUniqueName)             updateStatus(getMiscStatus(IStatus.ERROR,Messages.getString("String_Node_Str")));
 else             updateStatus(getOKStatus());
          }
          Object txText=tx.getText();
          if (tx.getText().trim().length() == 0)           txText=null;
          Utility.setProperty(data,cellProperties[index],txText);
        }
 catch (        Exception e1) {
          ExceptionHandler.handle(e1);
        }
      }
    }
);
  }
  if (index == 2) {
    tx.setFocus();
  }
}
Program: 66765
Project: 66765
Buggy source:
private void processTextStyle(StringBuffer buffer,IStyle style){
  outputStyleInQuote(style.getFontFamily(),style.getFontWeight(),style.getFontStyle(),buffer);
  String underLine=style.getTextUnderline();
  if (underLine != null && underLine.equalsIgnoreCase("String_Node_Str")) {
    buffer.append("String_Node_Str");
  }
  String lineTrough=style.getTextLineThrough();
  if (lineTrough != null && "String_Node_Str".equalsIgnoreCase(lineTrough)) {
    buffer.append("String_Node_Str");
  }
  if (style.getProperty(IStyle.STYLE_FONT_SIZE) != null) {
    buffer.append("String_Node_Str" + StyleBuilder.convertFontSize(style.getProperty(IStyle.STYLE_FONT_SIZE)));
  }
}

Fixed version (ground truth):
private void processTextStyle(StringBuffer buffer,IStyle style){
  outputStyleInQuote(style.getFontFamily(),style.getFontWeight(),style.getFontStyle(),buffer);
  String underLine=style.getTextUnderline();
  if (underLine != null && underLine.equalsIgnoreCase("String_Node_Str")) {
    buffer.append("String_Node_Str");
  }
  String lineTrough=style.getTextLineThrough();
  if (lineTrough != null && "String_Node_Str".equalsIgnoreCase(lineTrough)) {
    buffer.append("String_Node_Str");
  }
  if (style.getProperty(IStyle.STYLE_FONT_SIZE) != null) {
    buffer.append("String_Node_Str" + StyleBuilder.convertFontSize(style.getProperty(IStyle.STYLE_FONT_SIZE)));
  }
  String color=style.getColor();
  if (color != null) {
    int value=ColorUtil.parseColor(color);
    if (value >= 0) {
      buffer.append("String_Node_Str");
      buffer.append(Integer.toHexString(value));
    }
  }
}
Program: 66766
Project: 66766
Buggy source:
private boolean canSpan(SheetData data,XlsContainer rowContainer,int currentColumn,int lastColumn){
  SheetData realData=ExcelUtil.getRealData(data);
  if (realData == null)   return false;
  if (!isInContainer(realData,rowContainer) && realData.getRowSpanInDesign() <= 0) {
    return false;
  }
  for (int i=currentColumn + 1; i < lastColumn; i++) {
    SheetData lastData=getColumnLastData(i);
    SheetData lastRealData=ExcelUtil.getRealData(lastData);
    if (lastRealData == null || lastRealData.getRowIndex() <= realData.getRowIndex()) {
      continue;
    }
    if (realData.getStartX() > lastRealData.getStartX()) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean canSpan(SheetData data,XlsContainer rowContainer,int currentColumn,int lastColumn){
  SheetData realData=ExcelUtil.getRealData(data);
  if (realData == null)   return false;
  if (!isInContainer(realData,rowContainer) && realData.getRowSpanInDesign() <= 0) {
    return false;
  }
  for (int i=currentColumn + 1; i < lastColumn; i++) {
    SheetData lastData=getColumnLastData(i);
    SheetData lastRealData=ExcelUtil.getRealData(lastData);
    if (lastRealData == null || lastRealData.getRowIndex() <= realData.getRowIndex()) {
      continue;
    }
    if (realData.getEndX() > lastRealData.getStartX()) {
      return false;
    }
  }
  return true;
}
Program: 66767
Project: 66767
Buggy source:
public CellArea deepClone(){
  CellArea cell=(CellArea)super.deepClone();
  cell.setRowSpan(rowSpan - usedRowSpan);
  cell.setColSpan(colSpan);
  cell.setBoxStyle(new BoxStyle(cell.getBoxStyle()));
  if (getRowSpan() > 1) {
    cell.setHeight(currentBP + getOffsetY() + localProperties.getPaddingBottom());
  }
  return cell;
}

Fixed version (ground truth):
public CellArea deepClone(){
  CellArea cell=(CellArea)super.deepClone();
  cell.setRowSpan(rowSpan);
  cell.setColSpan(colSpan);
  cell.setBoxStyle(new BoxStyle(cell.getBoxStyle()));
  if (getRowSpan() > 1) {
    cell.setHeight(currentBP + getOffsetY() + localProperties.getPaddingBottom());
  }
  return cell;
}
Program: 66768
Project: 66768
Buggy source:
public void relayoutChildren() throws BirtException {
  layout.clear();
  addRows(this,layout);
}

Fixed version (ground truth):
public void relayoutChildren() throws BirtException {
  String nextRowId=null;
  if (layout.unresolvedRow != null) {
    nextRowId=this.getNextRowId(layout.unresolvedRow);
  }
  layout.clear();
  addRows(this,layout,nextRowId);
  layout.mergeUnresolvedRowHint();
}
Program: 66769
Project: 66769
Buggy source:
protected void addRows(ContainerArea container,TableLayout layout) throws BirtException {
  if (container instanceof RowArea) {
    RowArea row=(RowArea)container;
    if (row.needResolveBorder) {
      int size=row.getChildrenCount();
      for (int i=0; i < size; i++) {
        CellArea cell=(CellArea)row.getChild(i);
        int ch=cell.getContentHeight();
        cell.boxStyle.clearBorder();
        layout.resolveBorderConflict(cell,true);
        cell.setContentHeight(ch);
      }
      row.needResolveBorder=false;
    }
    if (row.finished) {
      if (row.getChildrenCount() != row.cells.length) {
        for (int i=0; i < row.cells.length; i++) {
          if (row.cells[i] instanceof DummyCell) {
            row.cells[i]=null;
          }
        }
      }
      layout.addRow(row,context.isFixedLayout());
    }
  }
 else {
    int size=container.getChildrenCount();
    for (int i=0; i < size; i++) {
      ContainerArea child=(ContainerArea)container.getChild(i);
      addRows(child,layout);
      child.updateChildrenPosition();
    }
    container.updateChildrenPosition();
  }
}

Fixed version (ground truth):
protected void addRows(ContainerArea container,TableLayout layout,String rowId) throws BirtException {
  if (container instanceof RowArea) {
    RowArea row=(RowArea)container;
    InstanceID id=row.getContent().getInstanceID();
    if (rowId != null && id != null && rowId.equals(id.toUniqueString())) {
      layout.mergeUnresolvedRowHint();
    }
    if (row.needResolveBorder) {
      int size=row.getChildrenCount();
      for (int i=0; i < size; i++) {
        CellArea cell=(CellArea)row.getChild(i);
        int ch=cell.getContentHeight();
        cell.boxStyle.clearBorder();
        layout.resolveBorderConflict(cell,true);
        cell.setContentHeight(ch);
      }
      row.needResolveBorder=false;
    }
    if (row.finished) {
      if (row.getChildrenCount() != row.cells.length) {
        for (int i=0; i < row.cells.length; i++) {
          if (row.cells[i] instanceof DummyCell) {
            row.cells[i]=null;
          }
        }
      }
      layout.addRow(row,context.isFixedLayout());
    }
  }
 else {
    int size=container.getChildrenCount();
    for (int i=0; i < size; i++) {
      ContainerArea child=(ContainerArea)container.getChild(i);
      addRows(child,layout,rowId);
      child.updateChildrenPosition();
    }
    container.updateChildrenPosition();
  }
}