nus-yam/ex-repair huggingface dataset:
Program: 78484
Project: 78484
Buggy source:
protected void accessHeader(ListingDesign list,IContentEmitter emitter,IResultIterator rsIterator){
  ITableContent tableContent=(ITableContent)context.getContent();
  TableBandDesign bandDesign=((TableItemDesign)list).getHeader();
  if (bandDesign != null) {
    ITableBandContent header=report.createTableHeader();
    context.pushContent(header);
    initializeContent(tableContent,bandDesign,header);
    if (emitter != null) {
      emitter.startTableHeader(header);
    }
    accessTableBand(bandDesign,emitter,rsIterator);
    if (emitter != null) {
      emitter.endTableHeader(header);
    }
    context.popContent();
  }
  ITableBandContent body=report.createTableBody();
  initializeContent(tableContent,null,body);
  context.pushContent(body);
  if (emitter != null) {
    emitter.startTableBody(body);
  }
}

Fixed version (ground truth):
protected void accessHeader(ListingDesign list,IContentEmitter emitter,IResultIterator rsIterator){
  ITableContent tableContent=(ITableContent)context.getContent();
  TableBandDesign bandDesign=((TableItemDesign)list).getHeader();
  if (bandDesign != null) {
    ITableBandContent header=report.createTableHeader();
    context.pushContent(header);
    initializeContent(tableContent,bandDesign,header);
    if (emitter != null) {
      emitter.startTableHeader(header);
    }
    bandDesign.setBandType(TableBandDesign.TABLE_HEADER);
    accessTableBand(bandDesign,emitter,rsIterator);
    if (emitter != null) {
      emitter.endTableHeader(header);
    }
    context.popContent();
  }
  ITableBandContent body=report.createTableBody();
  initializeContent(tableContent,null,body);
  context.pushContent(body);
  if (emitter != null) {
    emitter.startTableBody(body);
  }
}
Program: 78485
Project: 78485
Buggy source:
protected void accessTableBand(TableBandDesign band,IContentEmitter emitter,IResultIterator rsIterator){
  if (band != null) {
    for (int i=0; i < band.getRowCount(); i++) {
      accessRow(band.getRow(i),emitter,rsIterator);
    }
  }
}

Fixed version (ground truth):
protected void accessTableBand(TableBandDesign band,IContentEmitter emitter,IResultIterator rsIterator){
  if (band != null) {
    for (int i=0; i < band.getRowCount(); i++) {
      RowDesign rowDesign=band.getRow(i);
      rowDesign.setBandType(band.getBandType());
      rowDesign.setGroupLevel(band.getBandLevel());
      accessRow(rowDesign,emitter,rsIterator);
    }
  }
}
Program: 78486
Project: 78486
Buggy source:
protected void accessFooter(ListingDesign list,IContentEmitter emitter,IResultIterator rsIterator){
  if (layoutEmitter != null) {
    layoutEmitter.flush();
    outputEmitter=layoutEmitter.emitter;
    emitter=outputEmitter;
    layoutEmitter=null;
  }
  ITableBandContent body=(ITableBandContent)context.getContent();
  if (emitter != null) {
    emitter.endTableBody(body);
  }
  context.popContent();
  TableBandDesign bandDesign=((TableItemDesign)list).getFooter();
  if (bandDesign != null) {
    ITableBandContent footer=report.createTableFooter();
    IContent parent=context.getContent();
    context.pushContent(footer);
    initializeContent(parent,bandDesign,footer);
    if (emitter != null) {
      emitter.startTableFooter(footer);
    }
    accessTableBand(bandDesign,emitter,rsIterator);
    if (emitter != null) {
      emitter.endTableFooter(footer);
    }
    context.popContent();
  }
}

Fixed version (ground truth):
protected void accessFooter(ListingDesign list,IContentEmitter emitter,IResultIterator rsIterator){
  if (layoutEmitter != null) {
    layoutEmitter.flush();
    outputEmitter=layoutEmitter.emitter;
    emitter=outputEmitter;
    layoutEmitter=null;
  }
  ITableBandContent body=(ITableBandContent)context.getContent();
  if (emitter != null) {
    emitter.endTableBody(body);
  }
  context.popContent();
  TableBandDesign bandDesign=((TableItemDesign)list).getFooter();
  if (bandDesign != null) {
    ITableBandContent footer=report.createTableFooter();
    IContent parent=context.getContent();
    context.pushContent(footer);
    initializeContent(parent,bandDesign,footer);
    if (emitter != null) {
      emitter.startTableFooter(footer);
    }
    bandDesign.setBandType(TableBandDesign.TABLE_FOOTER);
    accessTableBand(bandDesign,emitter,rsIterator);
    if (emitter != null) {
      emitter.endTableFooter(footer);
    }
    context.popContent();
  }
}
Program: 78487
Project: 78487
Buggy source:
protected void accessGroupHeader(ListingDesign list,int index,IContentEmitter emitter){
  groupIndex=index;
  TableGroupDesign group=((TableItemDesign)list).getGroup(index);
  if (group != null) {
    TableBandDesign band=group.getHeader();
    if (layoutEmitter == null && tableInfo.hasDropCells(index)) {
      layoutEmitter=new TableLayoutEmitter((TableItemDesign)list,emitter);
      outputEmitter=layoutEmitter;
    }
    accessTableBand(band,outputEmitter,null);
  }
}

Fixed version (ground truth):
protected void accessGroupHeader(ListingDesign list,int index,IContentEmitter emitter){
  groupIndex=index;
  TableGroupDesign group=((TableItemDesign)list).getGroup(index);
  if (group != null) {
    TableBandDesign band=group.getHeader();
    if (layoutEmitter == null && tableInfo.hasDropCells(index)) {
      layoutEmitter=new TableLayoutEmitter((TableItemDesign)list,emitter);
      outputEmitter=layoutEmitter;
    }
    band.setBandType(TableBandDesign.GROUP_HEADER);
    band.setBandLevel(index);
    accessTableBand(band,outputEmitter,null);
  }
}
Program: 78488
Project: 78488
Buggy source:
public void endElement(){
  String tagName="String_Node_Str";
  if (elementStack.size() > 0)   tagName=(String)elementStack.get(elementStack.size() - 1);
  if (!tagName.equalsIgnoreCase(currentTagName)) {
    literal(getIndent(elementStack.size() - 1));
  }
  super.endElement();
}

Fixed version (ground truth):
public void endElement(){
  String tagName="String_Node_Str";
  if (!elementStack.isEmpty())   tagName=(String)elementStack.get(elementStack.size() - 1);
  if (!elementStack.isEmpty() && !tagName.equalsIgnoreCase(currentTagName))   literal(getIndent(elementStack.size() - 1));
  currentTagName=tagName;
  super.endElement();
}
Program: 78489
Project: 78489
Buggy source:
public void startText(ITextContent text){
  IStyle mergedStyle=text.getStyle();
  if (peek(mergedStyle)) {
    return;
  }
  logger.log(Level.FINE,"String_Node_Str");
  StringBuffer styleBuffer=new StringBuffer();
  DimensionType x=text.getX();
  DimensionType y=text.getY();
  DimensionType width=text.getWidth();
  DimensionType height=text.getHeight();
  String textValue=text.getText();
  int display;
  if (textValue != null && textValue.indexOf('\n') >= 0) {
    display=checkElementType(x,y,width,height,mergedStyle,styleBuffer);
  }
 else {
    display=checkElementType(x,y,mergedStyle,styleBuffer);
  }
  String tagName;
  if (handleAction(text.getHyperlinkAction())) {
    tagName=HTMLTags.TAG_A;
    setDisplayProperty(display,DISPLAY_BLOCK | DISPLAY_INLINE_BLOCK,styleBuffer);
    AttributeBuilder.checkHyperlinkTextDecoration(mergedStyle,styleBuffer);
  }
 else {
    tagName=openTagByType(display,DISPLAY_FLAG_ALL);
    setDisplayProperty(display,DISPLAY_INLINE_BLOCK,styleBuffer);
  }
  setStyleName(text.getStyleClass());
  setBookmark(tagName,text.getBookmark());
  writer.attribute(HTMLTags.ATTR_TITLE,text.getHelpText());
  handleShrink(display,mergedStyle,height,width,styleBuffer);
  handleStyle(text,styleBuffer,false);
  writer.text(textValue);
  writer.closeTag(tagName);
}

Fixed version (ground truth):
public void startText(ITextContent text){
  IStyle mergedStyle=text.getStyle();
  if (peek(mergedStyle)) {
    return;
  }
  logger.log(Level.FINE,"String_Node_Str");
  StringBuffer styleBuffer=new StringBuffer();
  DimensionType x=text.getX();
  DimensionType y=text.getY();
  DimensionType width=text.getWidth();
  DimensionType height=text.getHeight();
  String textValue=text.getText();
  int display;
  if (textValue != null && textValue.indexOf('\n') >= 0) {
    display=checkElementType(x,y,width,height,mergedStyle,styleBuffer);
  }
 else {
    display=checkElementType(x,y,mergedStyle,styleBuffer);
  }
  String tagName;
  if (handleAction(text.getHyperlinkAction())) {
    tagName=HTMLTags.TAG_A;
    setDisplayProperty(display,DISPLAY_BLOCK | DISPLAY_INLINE_BLOCK,styleBuffer);
    AttributeBuilder.checkHyperlinkTextDecoration(mergedStyle,styleBuffer);
  }
 else {
    tagName=openTagByType(display,DISPLAY_FLAG_ALL);
    setDisplayProperty(display,DISPLAY_INLINE_BLOCK,styleBuffer);
  }
  setStyleName(text.getStyleClass());
  setBookmark(tagName,text.getBookmark());
  setLabelInstanceId(text);
  writer.attribute(HTMLTags.ATTR_TITLE,text.getHelpText());
  handleShrink(display,mergedStyle,height,width,styleBuffer);
  handleStyle(text,styleBuffer,false);
  writer.text(textValue);
  writer.closeTag(tagName);
}
Program: 78490
Project: 78490
Buggy source:
/** 
 * access list band, such as list header, group header, detail etc
 * @param band the list band
 * @param emitter the report emitter
 * @param expressionRow TODO
 * @param isDetail true if it is detail band
 */
private void accessListBand(ListBandDesign band,IContentEmitter emitter,IResultIterator rsIterator){
  if (band != null && band.getContentCount() > 0) {
    for (int i=0; i < band.getContentCount(); i++) {
      ReportItemDesign item=band.getContent(i);
      if (context.isInFactory()) {
      }
      if (needPageBreak) {
        needPageBreak=false;
      }
      if (item != null) {
        item.accept(this.visitor,emitter);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * access list band, such as list header, group header, detail etc
 * @param band the list band
 * @param emitter the report emitter
 * @param expressionRow TODO
 * @param isDetail true if it is detail band
 */
private void accessListBand(ListBandDesign band,IContentEmitter emitter,IResultIterator rsIterator){
  if (band != null && band.getContentCount() > 0) {
    IContainerContent bandContent=report.createContainerContent();
    assert(bandContent instanceof ContainerContent);
    IContent parent=context.getContent();
    context.pushContent(bandContent);
    initializeContent(parent,band,bandContent);
    for (int i=0; i < band.getContentCount(); i++) {
      ReportItemDesign item=band.getContent(i);
      if (context.isInFactory()) {
      }
      if (needPageBreak) {
        needPageBreak=false;
      }
      if (item != null) {
        item.accept(this.visitor,emitter);
      }
    }
    context.popContent();
  }
}
Program: 78491
Project: 78491
Buggy source:
/** 
 * execute a cell. the execution process is: <li> create a cell content <li> push the content into the stack <li> intialize the cell <li> process the action, bookmark, style, visibility <li> call onCreate if necessary <li> call emitter to start the cell <li> for each element in the cell, execute the element. <li> call emiter to close the cell <li> popup the cell.
 * @param rowContent row content
 * @param cell cell design
 * @param emitter output emitter
 */
private void executeCell(IRowContent rowContent,CellDesign cell,IContentEmitter emitter,IRowData rowData){
  ICellContent cellContent=report.createCellContent();
  assert(cellContent instanceof CellContent);
  context.pushContent(cellContent);
  initializeContent(rowContent,cell,cellContent);
  cellContent.setColumn(cell.getColumn());
  cellContent.setColSpan(cell.getColSpan());
  cellContent.setRowSpan(cell.getRowSpan());
  processAction(cell,cellContent);
  processBookmark(cell,cellContent);
  processStyle(cell,cellContent);
  processVisibility(cell,cellContent);
  if (context.isInFactory()) {
    CellScriptExecutor.handleOnCreate((CellContent)cellContent,rowData,context);
  }
  startTOCEntry(cellContent);
  if (emitter != null) {
    emitter.startCell(cellContent);
  }
  for (int m=0; m < cell.getContentCount(); m++) {
    ReportItemDesign ri=cell.getContent(m);
    if (ri != null) {
      ri.accept(this.visitor,emitter);
    }
  }
  if (emitter != null) {
    emitter.endCell(cellContent);
  }
  finishTOCEntry();
  context.popContent();
}

Fixed version (ground truth):
/** 
 * execute a cell. the execution process is: <li> create a cell content <li> push the content into the stack <li> intialize the cell <li> process the action, bookmark, style, visibility <li> call onCreate if necessary <li> call emitter to start the cell <li> for each element in the cell, execute the element. <li> call emiter to close the cell <li> popup the cell.
 * @param rowContent row content
 * @param cell cell design
 * @param emitter output emitter
 */
private void executeCell(IRowContent rowContent,CellDesign cell,IContentEmitter emitter,IRowData rowData){
  ICellContent cellContent=report.createCellContent();
  assert(cellContent instanceof CellContent);
  context.pushContent(cellContent);
  initializeContent(rowContent,cell,cellContent);
  cellContent.setColumn(cell.getColumn());
  cellContent.setColSpan(cell.getColSpan());
  cellContent.setRowSpan(cell.getRowSpan());
  processAction(cell,cellContent);
  processBookmark(cell,cellContent);
  processStyle(cell,cellContent);
  processVisibility(cell,cellContent);
  if (context.isInFactory()) {
    CellScriptExecutor.handleOnCreate((CellContent)cellContent,rowData,context,true);
  }
  startTOCEntry(cellContent);
  if (emitter != null) {
    emitter.startCell(cellContent);
  }
  for (int m=0; m < cell.getContentCount(); m++) {
    ReportItemDesign ri=cell.getContent(m);
    if (ri != null) {
      ri.accept(this.visitor,emitter);
    }
  }
  if (emitter != null) {
    emitter.endCell(cellContent);
  }
  finishTOCEntry();
  context.popContent();
}
Program: 78494
Project: 78494
Buggy source:
protected void accessFooter(ListingDesign list,IContentEmitter emitter,IRowData rowData){
  accessListBand(((ListItemDesign)list).getFooter(),emitter,rowData);
}

Fixed version (ground truth):
protected void accessFooter(ListingDesign list,IContentEmitter emitter,IResultIterator rsIterator){
  accessListBand(((ListItemDesign)list).getFooter(),emitter,rsIterator);
}
Program: 78495
Project: 78495
Buggy source:
/** 
 * access list band, such as list header, group header, detail etc
 * @param band the list band
 * @param emitter the report emitter
 * @param expressionRow TODO
 * @param isDetail true if it is detail band
 */
private void accessListBand(ListBandDesign band,IContentEmitter emitter,IRowData rowData){
  if (band != null && band.getContentCount() > 0) {
    for (int i=0; i < band.getContentCount(); i++) {
      ReportItemDesign item=band.getContent(i);
      if (context.isInFactory()) {
      }
      if (needPageBreak) {
        needPageBreak=false;
      }
      if (item != null) {
        item.accept(this.visitor,emitter);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * access list band, such as list header, group header, detail etc
 * @param band the list band
 * @param emitter the report emitter
 * @param expressionRow TODO
 * @param isDetail true if it is detail band
 */
private void accessListBand(ListBandDesign band,IContentEmitter emitter,IResultIterator rsIterator){
  if (band != null && band.getContentCount() > 0) {
    for (int i=0; i < band.getContentCount(); i++) {
      ReportItemDesign item=band.getContent(i);
      if (context.isInFactory()) {
      }
      if (needPageBreak) {
        needPageBreak=false;
      }
      if (item != null) {
        item.accept(this.visitor,emitter);
      }
    }
  }
}
Program: 78496
Project: 78496
Buggy source:
protected void accessHeader(ListingDesign list,IContentEmitter emitter,IRowData rowData){
  accessListBand(((ListItemDesign)list).getHeader(),emitter,rowData);
}

Fixed version (ground truth):
protected void accessHeader(ListingDesign list,IContentEmitter emitter,IResultIterator rsIterator){
  accessListBand(((ListItemDesign)list).getHeader(),emitter,rsIterator);
}
Program: 78497
Project: 78497
Buggy source:
protected void accessDetail(ListingDesign list,IContentEmitter emitter,IRowData rowData){
  accessListBand(((ListItemDesign)list).getDetail(),emitter,rowData);
}

Fixed version (ground truth):
protected void accessDetail(ListingDesign list,IContentEmitter emitter,IResultIterator rsIterator){
  accessListBand(((ListItemDesign)list).getDetail(),emitter,rsIterator);
}
Program: 78498
Project: 78498
Buggy source:
/** 
 * create the footer band.
 * @param list listing design.
 * @param emitter output emitter
 */
abstract protected void accessFooter(ListingDesign list,IContentEmitter emitter,IRowData rowData);

Fixed version (ground truth):
/** 
 * create the footer band.
 * @param list listing design.
 * @param emitter output emitter
 */
abstract protected void accessFooter(ListingDesign list,IContentEmitter emitter,IResultIterator rsIterator);
Program: 78499
Project: 78499
Buggy source:
/** 
 * create the header band
 * @param list listing design
 * @param emitter output emitter
 */
abstract protected void accessHeader(ListingDesign list,IContentEmitter emitter,IRowData rowData);

Fixed version (ground truth):
/** 
 * create the header band
 * @param list listing design
 * @param emitter output emitter
 */
abstract protected void accessHeader(ListingDesign list,IContentEmitter emitter,IResultIterator rsIterator);
Program: 78501
Project: 78501
Buggy source:
/** 
 * create detail band.
 * @param list listing design.
 * @param emitter output emitter
 */
abstract protected void accessDetail(ListingDesign list,IContentEmitter emitter,IRowData rowData);

Fixed version (ground truth):
/** 
 * create detail band.
 * @param list listing design.
 * @param emitter output emitter
 */
abstract protected void accessDetail(ListingDesign list,IContentEmitter emitter,IResultIterator rsIterator);
Program: 78502
Project: 78502
Buggy source:
/** 
 * Gets the design cheet sheet file path.
 * @return the design cheet sheet file path
 */
public String getCheetSheet(){
  return getStringProperty(ReportDesign.CHEET_SHEET_PROP);
}

Fixed version (ground truth):
/** 
 * Gets the design cheat sheet file path.
 * @return the design cheat sheet file path
 * @deprecated by {@link #getCheatSheet()}
 */
public String getCheetSheet(){
  return getCheatSheet();
}
Program: 78503
Project: 78503
Buggy source:
/** 
 * Sets the design cheet sheet file path.
 * @param cheetSheet the design cheet sheet file path to set
 * @throws SemanticException if the property is locked or not defined on this design.
 */
public void setCheetSheet(String cheetSheet) throws SemanticException {
  setStringProperty(ReportDesign.CHEET_SHEET_PROP,cheetSheet);
}

Fixed version (ground truth):
/** 
 * Sets the design cheat sheet file path.
 * @param cheatSheet the design cheat sheet file path to set
 * @throws SemanticException if the property is locked or not defined on this design.
 * @deprecated by {@link #setCheatSheet(String)}
 */
public void setCheetSheet(String cheatSheet) throws SemanticException {
  setCheatSheet(cheatSheet);
}
Program: 78505
Project: 78505
Buggy source:
/** 
 * access list band, such as list header, group header, detail etc
 * @param band the list band
 * @param emitter the report emitter
 * @param expressionRow TODO
 * @param isDetail true if it is detail band
 */
private void accessListBand(ListBandDesign band,IContentEmitter emitter,IResultIterator rsIterator){
  if (band != null && band.getContentCount() > 0) {
    IContainerContent bandContent=report.createContainerContent();
    assert(bandContent instanceof ContainerContent);
    IContent parent=context.getContent();
    context.pushContent(bandContent);
    initializeContent(parent,band,bandContent);
    for (int i=0; i < band.getContentCount(); i++) {
      ReportItemDesign item=band.getContent(i);
      if (context.isInFactory()) {
      }
      if (needPageBreak) {
        needPageBreak=false;
      }
      if (item != null) {
        item.accept(this.visitor,emitter);
      }
    }
    context.popContent();
  }
}

Fixed version (ground truth):
/** 
 * access list band, such as list header, group header, detail etc
 * @param band the list band
 * @param emitter the report emitter
 * @param expressionRow TODO
 * @param isDetail true if it is detail band
 */
private void accessListBand(ListBandDesign band,IContentEmitter emitter,IResultIterator rsIterator){
  if (band != null && band.getContentCount() > 0) {
    for (int i=0; i < band.getContentCount(); i++) {
      ReportItemDesign item=band.getContent(i);
      if (context.isInFactory()) {
      }
      if (needPageBreak) {
        needPageBreak=false;
      }
      if (item != null) {
        item.accept(this.visitor,emitter);
      }
    }
  }
}
Program: 78506
Project: 78506
Buggy source:
public DataID getDataID(){
  if (rset != null) {
    return new DataID(rset.getID(),rset.getCurrentPosition());
  }
  return null;
}

Fixed version (ground truth):
public DataID getDataID(){
  IResultSet curRset=rset;
  if (curRset == null) {
    curRset=context.getDataEngine().getCurrentRS();
  }
  if (curRset != null) {
    return new DataID(curRset.getID(),curRset.getCurrentPosition());
  }
  return null;
}
Program: 78507
Project: 78507
Buggy source:
/** 
 * Creates a new page in the pagebook for a particular part. This page will be made visible whenever the part is active, and will be destroyed with a call to <code>doDestroyPage</code>.
 * @param part the input part
 * @return the record describing a new page for this view
 * @see #doDestroyPage
 */
protected PageRec doCreatePage(IWorkbenchPart part){
  if (part instanceof AbstractMultiPageLayoutEditor) {
    IEditorPart editor=UIUtil.getActiveEditor(true);
    if (editor != null) {
      Object fileAdapter=editor.getEditorInput().getAdapter(IFile.class);
      if (fileAdapter != null) {
        LibraryExplorerTreeViewPage page=getPage(fileAdapter,editor);
        initPage(page);
        page.createControl(getPageBook());
        return new PageRec(part,page);
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Creates a new page in the pagebook for a particular part. This page will be made visible whenever the part is active, and will be destroyed with a call to <code>doDestroyPage</code>.
 * @param part the input part
 * @return the record describing a new page for this view
 * @see #doDestroyPage
 */
protected PageRec doCreatePage(IWorkbenchPart part){
  if (part instanceof AbstractMultiPageLayoutEditor) {
    IEditorPart editor=UIUtil.getActiveEditor(true);
    if (editor != null) {
      Object fileAdapter=editor.getEditorInput().getAdapter(IFile.class);
      LibraryExplorerTreeViewPage page=getPage(fileAdapter,editor);
      initPage(page);
      page.createControl(getPageBook());
      return new PageRec(part,page);
    }
  }
  return null;
}
Program: 78509
Project: 78509
Buggy source:
public boolean isEnabled(){
  if (getSelectedElement() == null) {
    return false;
  }
  return super.isEnabled() && getSelectedElement().isTemplateParameterValue() && !(getSelectedElement().getContainer() instanceof SimpleMasterPageHandle)&& !(getSelectedElement().getRoot() instanceof LibraryHandle);
}

Fixed version (ground truth):
public boolean isEnabled(){
  if (getSelectedElement() == null) {
    return false;
  }
  return super.isEnabled() && getSelectedElement().canTransformToTemplate() && getSelectedElement().isTemplateParameterValue()&& !(getSelectedElement().getContainer() instanceof SimpleMasterPageHandle)&& !(getSelectedElement().getRoot() instanceof LibraryHandle);
}
Program: 78510
Project: 78510
Buggy source:
public DataExtractionTask(ReportEngine engine,IReportRunnable runnable,ReportDocumentReader reader) throws EngineException {
  super(engine,runnable);
  this.reportDocReader=reader;
  executionContext.setReportDocument(reportDocReader);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
  report=new ReportParser().parse(((ReportRunnable)runnable).getReport());
  executionContext.setReport(report);
  setParameterValues(reportDocReader.getParameterValues());
  IDataEngine dataEngine=executionContext.getDataEngine();
  dataEngine.prepare(report,appContext);
}

Fixed version (ground truth):
public DataExtractionTask(ReportEngine engine,IReportRunnable runnable,ReportDocumentReader reader) throws EngineException {
  super(engine,runnable);
  this.reportDocReader=reader;
  executionContext.setReportDocument(reportDocReader);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
  try {
    ReportParser parser=new ReportParser();
    ReportDesignHandle reportDesign=parser.getDesignHandle(reader.getDesignName(),reader.getDesignStream());
    report=parser.parse(reportDesign);
  }
 catch (  DesignFileException e) {
    e.printStackTrace();
  }
  executionContext.setReport(report);
  setParameterValues(reportDocReader.getParameterValues());
  IDataEngine dataEngine=executionContext.getDataEngine();
  dataEngine.prepare(report,appContext);
}
Program: 78511
Project: 78511
Buggy source:
/** 
 * execute the report
 */
public void execute(Report report,IContentEmitter emitter){
  BirtTimer timer=new BirtTimer();
  context.setReport(report);
  IReportContent reportContent=ContentFactory.createReportContent(report);
  context.setReportContent(reportContent);
  TOCBuilder tocBuilder=new TOCBuilder(reportContent.getTOC());
  context.setTOCBuilder(tocBuilder);
  timer.restart();
  context.getDataEngine().prepare(report,context.getAppContext());
  timer.stop();
  timer.logTimeTaken(logger,Level.FINE,context.getTaskIDString(),"String_Node_Str");
  timer.restart();
  if (emitter != null) {
    emitter.start(reportContent);
  }
  if (report.getContentCount() > 0) {
    for (int i=0; i < report.getContentCount(); i++) {
      report.getContent(i).accept(builder,emitter);
    }
  }
  if (emitter != null) {
    emitter.end(reportContent);
  }
  timer.stop();
  timer.logTimeTaken(logger,Level.FINE,context.getTaskIDString(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * execute the report
 */
public void execute(Report report,IContentEmitter emitter){
  BirtTimer timer=new BirtTimer();
  context.setReport(report);
  IReportContent reportContent=ContentFactory.createReportContent(report);
  context.setReportContent(reportContent);
  TOCBuilder tocBuilder=new TOCBuilder(reportContent.getTOC());
  context.setTOCBuilder(tocBuilder);
  timer.restart();
  context.getDataEngine().prepare(report,context.getAppContext());
  timer.stop();
  timer.logTimeTaken(logger,Level.FINE,context.getTaskIDString(),"String_Node_Str");
  timer.restart();
  if (emitter != null) {
    emitter.start(reportContent);
  }
  IContent dummyReportContent=new LabelContent((ReportContent)reportContent);
  dummyReportContent.setStyleClass(report.getRootStyleName());
  context.pushContent(dummyReportContent);
  if (report.getContentCount() > 0) {
    for (int i=0; i < report.getContentCount(); i++) {
      report.getContent(i).accept(builder,emitter);
    }
  }
  context.popContent();
  if (emitter != null) {
    emitter.end(reportContent);
  }
  timer.stop();
  timer.logTimeTaken(logger,Level.FINE,context.getTaskIDString(),"String_Node_Str");
}
Program: 78512
Project: 78512
Buggy source:
private ArrayList getAncestors(IContent content){
  ArrayList list=new ArrayList();
  while (content != null) {
    list.add(content);
    content=(IContent)content.getParent();
  }
  return list;
}

Fixed version (ground truth):
private ArrayList getAncestors(IContent content){
  ArrayList list=new ArrayList();
  while (content.getParent() != null) {
    list.add(content);
    content=(IContent)content.getParent();
  }
  return list;
}
Program: 78514
Project: 78514
Buggy source:
private Object eval(String expression) throws ScriptException {
  if (valueExpressions == null)   return null;
  Iterator exprIt=valueExpressions.iterator();
  while (exprIt.hasNext()) {
    IBaseExpression expr=(IBaseExpression)exprIt.next();
    if (!(expr instanceof IScriptExpression))     continue;
    String rowExpr=((IScriptExpression)expr).getText();
    if (expression.equals(rowExpr)) {
      try {
        return rsIterator.getValue(expr);
      }
 catch (      BirtException e) {
        throw new ScriptException(e.getLocalizedMessage());
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private Object eval(String expression) throws ScriptException {
  if (valueExpressions == null || rsIterator == null)   return null;
  Iterator exprIt=valueExpressions.iterator();
  while (exprIt.hasNext()) {
    IBaseExpression expr=(IBaseExpression)exprIt.next();
    if (!(expr instanceof IScriptExpression))     continue;
    String rowExpr=((IScriptExpression)expr).getText();
    if (expression.equals(rowExpr)) {
      try {
        return rsIterator.getValue(expr);
      }
 catch (      BirtException e) {
        throw new ScriptException(e.getLocalizedMessage());
      }
    }
  }
  return null;
}
Program: 78515
Project: 78515
Buggy source:
public Object getExpressionValue(int index) throws ScriptException {
  if (index <= valueExpressions.size()) {
    IBaseExpression expr=(IBaseExpression)valueExpressions.get(index - 1);
    if (expr == null)     return null;
    try {
      return rsIterator.getValue(expr);
    }
 catch (    BirtException e) {
      throw new ScriptException(e.getLocalizedMessage());
    }
  }
  return null;
}

Fixed version (ground truth):
public Object getExpressionValue(int index) throws ScriptException {
  if (valueExpressions == null || rsIterator == null)   return null;
  if (index <= valueExpressions.size()) {
    IBaseExpression expr=(IBaseExpression)valueExpressions.get(index - 1);
    if (expr == null)     return null;
    try {
      return rsIterator.getValue(expr);
    }
 catch (    BirtException e) {
      throw new ScriptException(e.getLocalizedMessage());
    }
  }
  return null;
}
Program: 78516
Project: 78516
Buggy source:
/** 
 * @param rowIndex
 * @throws IOException
 */
private void saveExprOfCurrRow(int lastRowIndex,int currIndex) throws IOException {
  saveNullRowsBetween(lastRowIndex,currIndex);
  Set keySet=exprValueMap.keySet();
  String[] exprIDs=(String[])keySet.toArray(new String[0]);
  int size=exprIDs.length;
  IOUtil.writeInt(dos,size);
  for (int i=0; i < size; i++) {
    String exprID=exprIDs[i];
    Object exprValue=exprValueMap.get(exprID);
    IOUtil.writeString(dos,exprID);
    IOUtil.writeObject(dos,exprValue);
  }
}

Fixed version (ground truth):
/** 
 * @param rowIndex
 * @throws IOException
 */
private void saveExprOfCurrRow(int lastRowIndex,int currIndex) throws IOException {
  Set keySet=exprValueMap.keySet();
  String[] exprIDs=(String[])keySet.toArray(new String[0]);
  int size=exprIDs.length;
  IOUtil.writeInt(dos,size);
  for (int i=0; i < size; i++) {
    String exprID=exprIDs[i];
    Object exprValue=exprValueMap.get(exprID);
    IOUtil.writeString(dos,exprID);
    IOUtil.writeObject(dos,exprValue);
  }
  saveNullRowsBetween(lastRowIndex,currIndex);
}
Program: 78517
Project: 78517
Buggy source:
/** 
 * Do the second pass
 * @param N
 * @return
 */
private boolean doSecondPass(){
  secondPassRowNumberCounter++;
  if (qualifiedRowCounter < N) {
    for (int i=0; i < N; i++) {
      if (rowIdList[i] == secondPassRowNumberCounter) {
        qualifiedRowCounter++;
        reset();
        return true;
      }
    }
    return false;
  }
 else {
    reset();
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Do the second pass
 * @param N
 * @return
 */
private boolean doSecondPass(){
  secondPassRowNumberCounter++;
  if (secondPassRowNumberCounter > this.filterPassController.getSecondPassRowCount())   this.filterPassController.setSecondPassRowCount(secondPassRowNumberCounter);
 else   this.secondPassRowNumberCounter=this.filterPassController.getSecondPassRowCount();
  if (qualifiedRowCounter < N) {
    for (int i=0; i < N; i++) {
      if (rowIdList[i] == secondPassRowNumberCounter) {
        qualifiedRowCounter++;
        reset();
        return true;
      }
    }
    return false;
  }
 else {
    reset();
    return false;
  }
}
Program: 78518
Project: 78518
Buggy source:
/** 
 * Do the first pass. In the first pass we maintain a value list and a row id list that will host all top/bottom N values/rowIds so that in pass 2 we can use them to filter rows out.
 * @param value
 * @return
 * @throws DataException
 */
private boolean doFirstPass(Object value) throws DataException {
  firstPassRowNumberCounter++;
  if (valueList == null) {
    valueList=new Object[N];
    rowIdList=new int[N];
  }
  populateValueListAndRowIdList(value,N);
  return false;
}

Fixed version (ground truth):
/** 
 * Do the first pass. In the first pass we maintain a value list and a row id list that will host all top/bottom N values/rowIds so that in pass 2 we can use them to filter rows out.
 * @param value
 * @return
 * @throws DataException
 */
private boolean doFirstPass(Object value) throws DataException {
  firstPassRowNumberCounter++;
  if (valueList == null) {
    valueList=new Object[N];
    rowIdList=new int[N];
  }
  populateValueListAndRowIdList(value,N);
  return true;
}
Program: 78521
Project: 78521
Buggy source:
/** 
 * processes a table/list group
 */
protected IGroupDefinition handleGroup(GroupDesign group,GroupHandle handle){
  GroupDefinition groupDefn=new GroupDefinition(group.getName());
  groupDefn.setKeyExpression(handle.getKeyExpr());
  String interval=handle.getInterval();
  if (interval != null) {
    groupDefn.setInterval(parseInterval(interval));
  }
  groupDefn.setIntervalRange(handle.getIntervalRange());
  String direction=handle.getSortDirection();
  if (direction != null) {
    groupDefn.setSortDirection(parseSortDirection(direction));
  }
  groupDefn.getSorts().addAll(createSorts(handle));
  groupDefn.getFilters().addAll(createFilters(handle));
  getParentQuery().getGroups().add(groupDefn);
  return groupDefn;
}

Fixed version (ground truth):
/** 
 * processes a table/list group
 */
protected IGroupDefinition handleGroup(GroupDesign group,GroupHandle handle){
  GroupDefinition groupDefn=new GroupDefinition(group.getName());
  groupDefn.setKeyExpression(handle.getKeyExpr());
  String interval=handle.getInterval();
  if (interval != null) {
    groupDefn.setInterval(parseInterval(interval));
  }
  groupDefn.setIntervalRange(handle.getIntervalRange());
  groupDefn.setIntervalStart(handle.getIntervalBase());
  String direction=handle.getSortDirection();
  if (direction != null) {
    groupDefn.setSortDirection(parseSortDirection(direction));
  }
  groupDefn.getSorts().addAll(createSorts(handle));
  groupDefn.getFilters().addAll(createFilters(handle));
  getParentQuery().getGroups().add(groupDefn);
  return groupDefn;
}
Program: 78522
Project: 78522
Buggy source:
/** 
 * @return
 */
public IContent popContent(){
  exitScope();
  return (IContent)reportContents.pop();
}

Fixed version (ground truth):
/** 
 * @return
 */
public IContent popContent(){
  return (IContent)reportContents.pop();
}
Program: 78523
Project: 78523
Buggy source:
/** 
 * @param obj
 */
public void pushContent(IContent obj){
  reportContents.push(obj);
  newScope(obj);
}

Fixed version (ground truth):
/** 
 * @param obj
 */
public void pushContent(IContent obj){
  reportContents.push(obj);
}
Program: 78524
Project: 78524
Buggy source:
public int getFieldIndex(String fieldName){
  Integer i=(Integer)m_nameToIdMapping.get(fieldName.toUpperCase());
  return (i == null) ? -1 : i.intValue();
}

Fixed version (ground truth):
public int getFieldIndex(String fieldName){
  Integer i=(Integer)m_nameToIdMapping.get(fieldName);
  return (i == null) ? -1 : i.intValue();
}
Program: 78525
Project: 78525
Buggy source:
/** 
 * @param projectedColumns
 */
private void initColumnsInfo(List projectedColumns){
  m_projectedColumns=new ArrayList();
  m_projectedColumns.addAll(projectedColumns);
  m_nameToIdMapping=new HashMap();
  for (int i=0, n=projectedColumns.size(); i < n; i++) {
    ResultFieldMetadata column=(ResultFieldMetadata)projectedColumns.get(i);
    String upperCaseName=column.getName();
    if (upperCaseName != null)     upperCaseName=upperCaseName.toUpperCase();
    Integer index=new Integer(i + 1);
    if (!m_nameToIdMapping.containsKey(upperCaseName)) {
      m_nameToIdMapping.put(upperCaseName,index);
    }
    String upperCaseAlias=column.getAlias();
    if (upperCaseAlias != null)     upperCaseAlias=upperCaseAlias.toUpperCase();
    if (upperCaseAlias != null && upperCaseAlias.length() > 0 && !m_nameToIdMapping.containsKey(upperCaseAlias)) {
      m_nameToIdMapping.put(upperCaseAlias,index);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param projectedColumns
 */
private void initColumnsInfo(List projectedColumns){
  m_projectedColumns=new ArrayList();
  m_projectedColumns.addAll(projectedColumns);
  m_nameToIdMapping=new HashMap();
  for (int i=0, n=projectedColumns.size(); i < n; i++) {
    ResultFieldMetadata column=(ResultFieldMetadata)projectedColumns.get(i);
    String upperCaseName=column.getName();
    Integer index=new Integer(i + 1);
    if (!m_nameToIdMapping.containsKey(upperCaseName)) {
      m_nameToIdMapping.put(upperCaseName,index);
    }
    String upperCaseAlias=column.getAlias();
    if (upperCaseAlias != null && upperCaseAlias.length() > 0 && !m_nameToIdMapping.containsKey(upperCaseAlias)) {
      m_nameToIdMapping.put(upperCaseAlias,index);
    }
  }
}
Program: 78526
Project: 78526
Buggy source:
/** 
 * The method which extracts column name from group definition.
 * @param group
 * @return
 */
private String getGroupKeyColumnName(GroupDefinition group){
  String columnName;
  if (group.getKeyColumn() != null) {
    columnName=group.getKeyColumn();
  }
 else {
    columnName=group.getKeyExpression();
    if (columnName.toUpperCase().startsWith("String_Node_Str"))     columnName=columnName.toUpperCase().replaceFirst("String_Node_Str","String_Node_Str");
 else     if (columnName.toUpperCase().startsWith("String_Node_Str")) {
      columnName=columnName.toUpperCase().replaceFirst("String_Node_Str","String_Node_Str");
      columnName=columnName.trim().substring(0,columnName.length() - 1).trim();
    }
    if (columnName != null && columnName.matches("String_Node_Str"))     columnName=columnName.substring(1,columnName.length() - 1);
  }
  if (columnName.startsWith("String_Node_Str") && columnName.endsWith("String_Node_Str")) {
    columnName="String_Node_Str" + columnName.substring(2,columnName.length() - 2) + "String_Node_Str";
  }
  return columnName;
}

Fixed version (ground truth):
/** 
 * The method which extracts column name from group definition.
 * @param group
 * @return
 */
private String getGroupKeyColumnName(GroupDefinition group){
  String columnName;
  if (group.getKeyColumn() != null) {
    columnName=group.getKeyColumn();
  }
 else {
    columnName=group.getKeyExpression();
    if (columnName.trim().toUpperCase().startsWith("String_Node_Str")) {
      String temp=columnName.trim().substring(3).trim();
      if (temp.startsWith("String_Node_Str"))       columnName=temp.replaceFirst("String_Node_Str","String_Node_Str");
 else       if (temp.startsWith("String_Node_Str")) {
        columnName=temp.replaceFirst("String_Node_Str","String_Node_Str");
        columnName=columnName.trim().substring(0,columnName.length() - 1).trim();
      }
    }
    if (columnName != null && columnName.matches("String_Node_Str"))     columnName=columnName.substring(1,columnName.length() - 1);
  }
  if (columnName.startsWith("String_Node_Str") && columnName.endsWith("String_Node_Str")) {
    columnName="String_Node_Str" + columnName.substring(2,columnName.length() - 2) + "String_Node_Str";
  }
  return columnName;
}
Program: 78529
Project: 78529
Buggy source:
/** 
 * create a PdfAction
 * @param hyperlink			
 * @param bookmark
 * @param target			if target equals "_blank", the target will be opened in a new window,else the target will be opened in the current window.
 * @return					the created PdfAction.
 */
private PdfAction createPdfAction(String hyperlink,String bookmark,String target){
  if ("String_Node_Str".equalsIgnoreCase(target)) {
    return new PdfAction(hyperlink);
  }
 else {
    if (null == hyperlink) {
      return PdfAction.gotoLocalPage(bookmark,false);
    }
 else {
      return PdfAction.gotoRemotePage(hyperlink,bookmark,false,false);
    }
  }
}

Fixed version (ground truth):
/** 
 * create a PdfAction
 * @param hyperlink			
 * @param bookmark
 * @param target			if target equals "_blank", the target will be opened in a new window,else the target will be opened in the current window.
 * @return					the created PdfAction.
 */
private PdfAction createPdfAction(String hyperlink,String bookmark,String target,int type){
  if ("String_Node_Str".equalsIgnoreCase(target)) {
    return new PdfAction(hyperlink);
  }
 else {
    if (type == IHyperlinkAction.ACTION_BOOKMARK) {
      return PdfAction.gotoLocalPage(bookmark,false);
    }
 else {
      if (type == IHyperlinkAction.ACTION_HYPERLINK) {
        return PdfAction.gotoRemotePage(hyperlink,bookmark,false,false);
      }
 else {
        return new PdfAction(hyperlink);
      }
    }
  }
}
Program: 78531
Project: 78531
Buggy source:
public Page(IContentEmitter emitter,IPageContent pageContent){
  this.emitter=emitter;
  this.pageContent=pageContent;
  this.rootRegion=new PageRegion(this,null);
}

Fixed version (ground truth):
public Page(IContentEmitter emitter,IPageContent pageContent){
  this.emitter=emitter;
  this.pageContent=pageContent;
  this.rootRegion=new PageRegion(this);
}
Program: 78532
Project: 78532
Buggy source:
public PageRegion createRegion(IContent content){
  return new PageRegion(this,content);
}

Fixed version (ground truth):
public PageRegion createRegion(){
  return new PageRegion(this);
}
Program: 78533
Project: 78533
Buggy source:
private ArrayList getAncestors(){
  ArrayList list=new ArrayList();
  IContent content=rootContent;
  while (content != null) {
    list.add(content);
    content=(IContent)content.getParent();
  }
  return list;
}

Fixed version (ground truth):
private ArrayList getAncestors(IContent content){
  ArrayList list=new ArrayList();
  while (content != null) {
    list.add(content);
    content=(IContent)content.getParent();
  }
  return list;
}
Program: 78534
Project: 78534
Buggy source:
public void close(){
  if (rootContent != null) {
    ArrayList contents=getAncestors();
    int size=contents.size();
    for (int i=0; i < size; i++) {
      closeContent((IContent)contents.get(i));
    }
  }
}

Fixed version (ground truth):
public void close(IContent content){
  if (content != null) {
    ArrayList contents=getAncestors(content);
    int size=contents.size();
    for (int i=0; i < size; i++) {
      closeContent((IContent)contents.get(i));
    }
  }
}
Program: 78535
Project: 78535
Buggy source:
public void open(){
  if (rootContent != null) {
    ArrayList contents=getAncestors();
    int size=contents.size() - 1;
    for (int i=size; i >= 0; i--) {
      openContent((IContent)contents.get(i));
    }
  }
}

Fixed version (ground truth):
public void open(IContent content){
  if (content != null) {
    ArrayList contents=getAncestors(content);
    int size=contents.size() - 1;
    for (int i=size; i >= 0; i--) {
      openContent((IContent)contents.get(i));
    }
  }
}
Program: 78536
Project: 78536
Buggy source:
public PageRegion(Page page,IContent content){
  super(page.getEmitter());
  this.rootContent=content;
  startEmitterVisitor=new StartEmitterVisitor(emitter);
  endEmitterVisitor=new EndEmitterVisitor(emitter);
}

Fixed version (ground truth):
public PageRegion(Page page){
  super(page.getEmitter());
  startEmitterVisitor=new StartEmitterVisitor(emitter);
  endEmitterVisitor=new EndEmitterVisitor(emitter);
}
Program: 78537
Project: 78537
Buggy source:
/** 
 * Reset all the member data to their default value.
 */
private void reset(){
  if (firstPassRowNumberCounter == secondPassRowNumberCounter) {
    firstPassRowNumberCounter=0;
    secondPassRowNumberCounter=0;
    qualifiedRowCounter=0;
    rowIdList=null;
    valueList=null;
    N=-1;
  }
}

Fixed version (ground truth):
/** 
 * Reset all the member data to their default value.
 */
private void reset(){
  if (firstPassRowNumberCounter == secondPassRowNumberCounter) {
    doReset();
  }
}
Program: 78538
Project: 78538
Buggy source:
/** 
 * Evaluate the given value
 * @param value
 * @param n
 * @return
 * @throws DataException
 */
public boolean evaluate(Object value,Object n,boolean calculatePercent) throws DataException {
  if (N == -1) {
    try {
      if (calculatePercent) {
        double temp=Double.valueOf(n.toString()).doubleValue() / 100;
        if (temp > 1 || temp < 0)         throw new DataException(ResourceConstants.INVALID_TOP_BOTTOM_PERCENT_ARGUMENT);
        N=(int)Math.round(temp * getRowCount());
      }
 else       N=Double.valueOf(n.toString()).intValue();
    }
 catch (    NumberFormatException e) {
    }
    if (N < 0)     throw new DataException(ResourceConstants.INVALID_TOP_BOTTOM_N_ARGUMENT);
  }
  if (getPassLevel() == FIRST_PASS) {
    return doFirstPass(value);
  }
 else   if (getPassLevel() == SECOND_PASS) {
    return doSecondPass();
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Evaluate the given value
 * @param value
 * @param n
 * @return
 * @throws DataException
 */
public boolean evaluate(Object value,Object n,boolean calculatePercent) throws DataException {
  if (FilterPassController.getForceReset()) {
    doReset();
    FilterPassController.setForceReset(false);
  }
  if (N == -1) {
    try {
      if (calculatePercent) {
        double temp=Double.valueOf(n.toString()).doubleValue() / 100;
        if (temp > 1 || temp < 0)         throw new DataException(ResourceConstants.INVALID_TOP_BOTTOM_PERCENT_ARGUMENT);
        N=(int)Math.round(temp * getRowCount());
      }
 else       N=Double.valueOf(n.toString()).intValue();
    }
 catch (    NumberFormatException e) {
    }
    if (N < 0)     throw new DataException(ResourceConstants.INVALID_TOP_BOTTOM_N_ARGUMENT);
  }
  if (getPassLevel() == FIRST_PASS) {
    return doFirstPass(value);
  }
 else   if (getPassLevel() == SECOND_PASS) {
    return doSecondPass();
  }
  return false;
}
Program: 78539
Project: 78539
Buggy source:
public void testDefineThemes() throws Exception {
  sessionHandle=DesignEngine.newSession(null);
  libraryHandle=sessionHandle.createLibrary();
  library=(Library)libraryHandle.getModule();
  factory=new ElementFactory(library);
  theme=factory.newTheme(null);
  assertEquals("String_Node_Str",theme.getName());
  libraryHandle.getThemes().add(theme);
  try {
    libraryHandle.getThemes().add(theme);
    fail();
  }
 catch (  NameException e) {
    assertNotNull(e);
  }
  style1=factory.newStyle("String_Node_Str");
  style2=factory.newStyle("String_Node_Str");
  theme.getStyles().add(style1);
  theme.getStyles().add(style2);
  assertEquals(2,theme.getStyles().getCount());
}

Fixed version (ground truth):
public void testDefineThemes() throws Exception {
  sessionHandle=DesignEngine.newSession(null);
  libraryHandle=sessionHandle.createLibrary();
  library=(Library)libraryHandle.getModule();
  factory=new ElementFactory(library);
  theme=factory.newTheme(null);
  theme1=factory.newTheme(null);
  assertEquals("String_Node_Str",theme.getName());
  libraryHandle.getThemes().add(theme);
  libraryHandle.getThemes().add(theme1);
  assertEquals("String_Node_Str",theme1.getName());
  style1=factory.newStyle("String_Node_Str");
  style2=factory.newStyle("String_Node_Str");
  theme.getStyles().add(style1);
  theme.getStyles().add(style2);
  assertEquals(2,theme.getStyles().getCount());
}