nus-yam/ex-repair huggingface dataset:
Program: 72347
Project: 72347
Buggy source:
private int outputImageSource(ArrayImageSource imageSource,String prefix,String suffix){
  int originalWidth=imageSource.getWidth();
  int originalHeight=imageSource.getHeight();
  StringBuffer buffer=new StringBuffer();
  int count=0;
  for (int i=0; i < originalHeight; i++) {
    for (int j=0; j < originalWidth; j++) {
      int pixel=imageSource.getRGB(j,i);
      int alpha=(pixel >> 24) & 0xff;
      int red=(pixel >> 16) & 0xff;
      int green=(pixel >> 8) & 0xff;
      int blue=pixel & 0xff;
      red=transferColor(alpha,red);
      green=transferColor(alpha,green);
      blue=transferColor(alpha,blue);
      toBytes(buffer,red);
      toBytes(buffer,green);
      toBytes(buffer,blue);
      if (buffer.length() >= 250) {
        outputBuffer(buffer,prefix,suffix);
        ++count;
      }
    }
  }
  if (buffer.length() > 0) {
    outputBuffer(buffer,prefix,suffix);
    ++count;
  }
  return count;
}

Fixed version (ground truth):
private void outputImageSource(ArrayImageSource imageSource){
  int originalWidth=imageSource.getWidth();
  int originalHeight=imageSource.getHeight();
  try {
    ByteArrayOutputStream byteOut=new ByteArrayOutputStream();
    DeflaterOutputStream deflateOut=new DeflaterOutputStream(byteOut,new Deflater(Deflater.DEFAULT_COMPRESSION));
    for (int i=0; i < originalHeight; i++) {
      for (int j=0; j < originalWidth; j++) {
        int pixel=imageSource.getRGB(j,i);
        int alpha=(pixel >> 24) & 0xff;
        int red=(pixel >> 16) & 0xff;
        int green=(pixel >> 8) & 0xff;
        int blue=pixel & 0xff;
        deflateOut.write(transferColor(alpha,red));
        deflateOut.write(transferColor(alpha,green));
        deflateOut.write(transferColor(alpha,blue));
      }
    }
    deflateOut.finish();
    deflateOut.close();
    byte[] byteArray=byteOut.toByteArray();
    byteOut.close();
    out.print(Util.toHexString(byteArray) + "String_Node_Str");
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 72348
Project: 72348
Buggy source:
public String getDirection(){
  return null;
}

Fixed version (ground truth):
public String getDirection(){
  return getCssText(STYLE_DIRECTION);
}
Program: 72349
Project: 72349
Buggy source:
public void setDirection(String direction) throws DOMException {
}

Fixed version (ground truth):
public void setDirection(String direction) throws DOMException {
  setCssText(STYLE_DIRECTION,direction);
}
Program: 72351
Project: 72351
Buggy source:
public static int hash(String str){
  int hashValue=str.length();
switch (hashValue) {
default :
    hashValue+=asso_values[str.charAt(11)];
case 11:
case 10:
case 9:
case 8:
case 7:
  hashValue+=asso_values[str.charAt(6)];
case 6:
case 5:
case 4:
case 3:
case 2:
case 1:
hashValue+=asso_values[str.charAt(0)];
break;
}
return hashValue + asso_values[str.charAt(str.length() - 1)];
}

Fixed version (ground truth):
public static int hash(String str){
  int hashValue=str.length();
switch (hashValue) {
default :
    hashValue+=asso_values[str.charAt(11)];
case 11:
case 10:
case 9:
case 8:
case 7:
case 6:
  hashValue+=asso_values[str.charAt(5)];
case 5:
case 4:
case 3:
hashValue+=asso_values[str.charAt(2)];
break;
}
return hashValue + asso_values[str.charAt(str.length() - 1)];
}
Program: 72352
Project: 72352
Buggy source:
public static String parse(String dateTime){
  if (dateTime == null) {
    return "String_Node_Str";
  }
  if (dateTime.indexOf("String_Node_Str") != -1) {
    return dateTime;
  }
  StringBuffer buffer=new StringBuffer();
  boolean inQuto=false;
  for (int count=0; count < dateTime.length(); count++) {
    char tempChar=dateTime.charAt(count);
    if (inQuto) {
      if (tempChar == '\'' && nextIsQuto(dateTime,count)) {
        buffer.append(tempChar);
        count++;
      }
 else {
        if (tempChar == '\'') {
          inQuto=false;
        }
 else {
          buffer.append(tempChar);
        }
      }
    }
 else {
      if (tempChar == '\'') {
        if (nextIsQuto(dateTime,count)) {
          buffer.append(tempChar);
          count++;
        }
 else {
          inQuto=true;
        }
      }
 else {
        if (tempChar == 'a') {
          buffer.append("String_Node_Str");
          continue;
        }
        if ("String_Node_Str".indexOf(tempChar) != -1) {
          continue;
        }
        buffer.append(tempChar);
      }
    }
  }
  return buffer.toString();
}

Fixed version (ground truth):
public static String parse(String dateTime){
  if (dateTime == null) {
    return "String_Node_Str";
  }
  if (dateTime.indexOf("String_Node_Str") != -1) {
    String dateFormat=null;
    DateFormatter dateFormatter=new DateFormatter(dateTime);
    return dateFormatter.getFormatCode();
  }
  StringBuffer buffer=new StringBuffer();
  boolean inQuto=false;
  for (int count=0; count < dateTime.length(); count++) {
    char tempChar=dateTime.charAt(count);
    if (inQuto) {
      if (tempChar == '\'' && nextIsQuto(dateTime,count)) {
        buffer.append(tempChar);
        count++;
      }
 else {
        if (tempChar == '\'') {
          inQuto=false;
        }
 else {
          buffer.append(tempChar);
        }
      }
    }
 else {
      if (tempChar == '\'') {
        if (nextIsQuto(dateTime,count)) {
          buffer.append(tempChar);
          count++;
        }
 else {
          inQuto=true;
        }
      }
 else {
        if (tempChar == 'a') {
          buffer.append("String_Node_Str");
          continue;
        }
        if ("String_Node_Str".indexOf(tempChar) != -1) {
          continue;
        }
        buffer.append(tempChar);
      }
    }
  }
  return buffer.toString();
}
Program: 72354
Project: 72354
Buggy source:
/** 
 * Refreshes all resources.
 */
protected void refreshAll(){
  Display display=getShell().getDisplay();
  display.asyncExec(new Runnable(){
    public void run(){
      viewerPage.refreshRoot();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Refreshes all resources.
 */
protected void refreshAll(){
  Display display=getShell().getDisplay();
  display.asyncExec(new Runnable(){
    public void run(){
      if (viewerPage != null) {
        viewerPage.refreshRoot();
      }
    }
  }
);
}
Program: 72355
Project: 72355
Buggy source:
public boolean equals(Object object){
  if (object == null)   return false;
  if (!(object instanceof ResourceEntryWrapper || object instanceof String))   return false;
  if (object == this)   return true;
 else {
    if (object instanceof PathResourceEntry) {
      ResourceEntryWrapper temp=(ResourceEntryWrapper)object;
      if (temp.proxy.equals(this.proxy) && temp.type == this.type)       return true;
    }
 else     if (object instanceof String) {
      try {
        if (object.equals(ResourceAction.convertToFile(getURL()).getAbsolutePath())) {
          return true;
        }
      }
 catch (      IOException e) {
        return false;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean equals(Object object){
  if (object == null)   return false;
  if (!(object instanceof ResourceEntryWrapper || object instanceof String))   return false;
  if (object == this)   return true;
 else {
    if (object instanceof ResourceEntryWrapper) {
      ResourceEntryWrapper temp=(ResourceEntryWrapper)object;
      if (temp.proxy.equals(this.proxy) && temp.type == this.type)       return true;
    }
 else     if (object instanceof String) {
      try {
        if (object.equals(ResourceAction.convertToFile(getURL()).getAbsolutePath())) {
          return true;
        }
      }
 catch (      IOException e) {
        return false;
      }
    }
  }
  return false;
}
Program: 72356
Project: 72356
Buggy source:
public boolean equals(Object object){
  if (object == null)   return false;
  if (!(object instanceof FragmentResourceEntry))   return false;
  if (object == this)   return true;
 else {
    FragmentResourceEntry temp=(FragmentResourceEntry)object;
    if (temp.path.equals(this.path))     return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object object){
  if (object == null)   return false;
  if (!(object instanceof FragmentResourceEntry || object instanceof String))   return false;
  if (object == this)   return true;
 else {
    if (object instanceof FragmentResourceEntry) {
      FragmentResourceEntry temp=(FragmentResourceEntry)object;
      if (temp.path.equals(this.path)) {
        return true;
      }
    }
 else     if (object instanceof String) {
      if (object.equals(this.path)) {
        return true;
      }
    }
  }
  return false;
}
Program: 72358
Project: 72358
Buggy source:
public IStyle getComputedStyle(){
  if (computedStyle == null) {
    if (inlineStyle == null || inlineStyle.isEmpty()) {
      String cacheKey=styleClass;
      ITableContent table=((IRowContent)parent).getTable();
      int column=getColumn();
      if (column >= 0 && column < table.getColumnCount()) {
        IColumn tblColumn=table.getColumn(column);
        if (tblColumn != null) {
          String columnStyleClass=tblColumn.getStyleClass();
          if (columnStyleClass != null) {
            cacheKey=cacheKey + columnStyleClass;
          }
        }
      }
      ComputedStyle pcs=(ComputedStyle)((IContent)parent).getComputedStyle();
      ComputedStyle cs=pcs.getCachedStyle(cacheKey);
      if (cs == null) {
        cs=new CellComputedStyle(this);
        pcs.addCachedStyle(styleClass,cs);
      }
      computedStyle=cs;
    }
 else {
      computedStyle=new CellComputedStyle(this);
    }
  }
  return computedStyle;
}

Fixed version (ground truth):
public IStyle getComputedStyle(){
  if (computedStyle == null) {
    if (inlineStyle == null || inlineStyle.isEmpty()) {
      String cacheKey=getStyleClass();
      ITableContent table=((IRowContent)parent).getTable();
      int column=getColumn();
      if (column >= 0 && column < table.getColumnCount()) {
        IColumn tblColumn=table.getColumn(column);
        if (tblColumn != null) {
          String columnStyleClass=tblColumn.getStyleClass();
          if (columnStyleClass != null) {
            cacheKey=cacheKey + columnStyleClass;
          }
        }
      }
      ComputedStyle pcs=(ComputedStyle)((IContent)parent).getComputedStyle();
      ComputedStyle cs=pcs.getCachedStyle(cacheKey);
      if (cs == null) {
        cs=new CellComputedStyle(this);
        pcs.addCachedStyle(cacheKey,cs);
      }
      computedStyle=cs;
    }
 else {
      computedStyle=new CellComputedStyle(this);
    }
  }
  return computedStyle;
}
Program: 72360
Project: 72360
Buggy source:
/** 
 * @param dataSourceQuery
 * @param resultSet
 * @param resultClass
 * @param stopSign
 * @throws DataException
 */
public SimpleResultSet(DataSourceQuery dataSourceQuery,ResultSet resultSet,IResultClass resultClass,StopSign stopSign) throws DataException {
  this.rowResultSet=new RowResultSet(new SmartCacheRequest(dataSourceQuery.getMaxRows(),dataSourceQuery.getFetchEvents(),new OdiAdapter(resultSet),resultClass,false));
  this.currResultObj=this.rowResultSet.next(stopSign);
  this.resultSet=resultSet;
  this.stopSign=stopSign;
}

Fixed version (ground truth):
/** 
 * @param dataSourceQuery
 * @param resultSet
 * @param resultClass
 * @param stopSign
 * @throws DataException
 */
public SimpleResultSet(DataSourceQuery dataSourceQuery,ResultSet resultSet,IResultClass resultClass,IEventHandler handler,StopSign stopSign) throws DataException {
  this.rowResultSet=new RowResultSet(new SmartCacheRequest(dataSourceQuery.getMaxRows(),dataSourceQuery.getFetchEvents(),new OdiAdapter(resultSet),resultClass,false));
  this.currResultObj=this.rowResultSet.next(stopSign);
  this.resultSet=resultSet;
  this.stopSign=stopSign;
  this.handler=handler;
}
Program: 72361
Project: 72361
Buggy source:
public IExecutorHelper getExecutorHelper(){
  return null;
}

Fixed version (ground truth):
public IExecutorHelper getExecutorHelper(){
  return this.handler.getExecutorHelper();
}
Program: 72362
Project: 72362
Buggy source:
public void close() throws DataException {
  this.resultSet.close();
}

Fixed version (ground truth):
public void close() throws DataException {
  if (this.resultSet != null) {
    this.resultSet.close();
    this.resultSet=null;
  }
}
Program: 72363
Project: 72363
Buggy source:
/** 
 * constructor
 * @param page the viewer
 * @param registry the registry
 */
public LibraryExplorerContextMenuProvider(LibraryExplorerTreeViewPage page){
  super(page.getTreeViewer());
  this.page=page;
  clipboard=new Clipboard(page.getSite().getShell().getDisplay());
  refreshExplorerAction=new RefreshResourceExplorerAction(page);
  useLibraryAction=new AddSelectedLibToCurrentReportDesignAction(page.getTreeViewer());
  deleteLibraryandCssAction=new DeleteResourceAction(page);
  addResourceAction=new AddResourceAction(page);
  renameLibraryandCssAction=new RenameResourceAction(page);
  newFolderAction=new NewFolderAction(page);
  moveLibraryandCssAction=new MoveResourceAction(page);
  newLibraryAction=new NewLibraryAction(page);
  copyLibraryandCssAction=new CopyResourceAction(page,clipboard);
  pasteLibraryandCssAction=new PasteResourceAction(page,clipboard);
  newMenuGroup.add(newFolderAction);
  newMenuGroup.add(newLibraryAction);
}

Fixed version (ground truth):
/** 
 * constructor
 * @param page the viewer
 * @param registry the registry
 */
public LibraryExplorerContextMenuProvider(LibraryExplorerTreeViewPage page){
  super(page.getTreeViewer());
  this.page=page;
  clipboard=new Clipboard(page.getSite().getShell().getDisplay());
  filterAction=new FilterResourceAction(page);
  refreshExplorerAction=new RefreshResourceExplorerAction(page);
  useLibraryAction=new AddSelectedLibToCurrentReportDesignAction(page.getTreeViewer());
  deleteResourceAction=new DeleteResourceAction(page);
  addResourceAction=new AddResourceAction(page);
  renameResourceAction=new RenameResourceAction(page);
  newFolderAction=new NewFolderAction(page);
  moveResourceAction=new MoveResourceAction(page);
  newLibraryAction=new NewLibraryAction(page);
  copyResourceAction=new CopyResourceAction(page,clipboard);
  pasteResourceAction=new PasteResourceAction(page,clipboard);
  newMenuGroup.add(newFolderAction);
  newMenuGroup.add(newLibraryAction);
  handleGlobalAction();
  page.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      resetActionStatus();
      updateActionBars();
    }
  }
);
}
Program: 72365
Project: 72365
Buggy source:
/** 
 * Resets all action status.
 */
private void resetActionStatus(){
  refreshExplorerAction.setEnabled(refreshExplorerAction.isEnabled());
  useLibraryAction.setEnabled(useLibraryAction.isEnabled());
  deleteLibraryandCssAction.setEnabled(deleteLibraryandCssAction.isEnabled());
  addResourceAction.setEnabled(addResourceAction.isEnabled());
  renameLibraryandCssAction.setEnabled(renameLibraryandCssAction.isEnabled());
  newFolderAction.setEnabled(newFolderAction.isEnabled());
  moveLibraryandCssAction.setEnabled(moveLibraryandCssAction.isEnabled());
  newLibraryAction.setEnabled(newLibraryAction.isEnabled());
  copyLibraryandCssAction.setEnabled(copyLibraryandCssAction.isEnabled());
  pasteLibraryandCssAction.setEnabled(pasteLibraryandCssAction.isEnabled());
}

Fixed version (ground truth):
/** 
 * Resets all action status.
 */
private void resetActionStatus(){
  filterAction.setEnabled(isEnabled());
  refreshExplorerAction.setEnabled(refreshExplorerAction.isEnabled());
  useLibraryAction.setEnabled(useLibraryAction.isEnabled());
  deleteResourceAction.setEnabled(deleteResourceAction.isEnabled());
  addResourceAction.setEnabled(addResourceAction.isEnabled());
  renameResourceAction.setEnabled(renameResourceAction.isEnabled());
  newFolderAction.setEnabled(newFolderAction.isEnabled());
  moveResourceAction.setEnabled(moveResourceAction.isEnabled());
  newLibraryAction.setEnabled(newLibraryAction.isEnabled());
  copyResourceAction.setEnabled(copyResourceAction.isEnabled());
  pasteResourceAction.setEnabled(pasteResourceAction.isEnabled());
}
Program: 72366
Project: 72366
Buggy source:
/** 
 * Fires a selection changed event.
 * @param selection the new selection
 */
protected void fireSelectionChanged(ISelection selection){
  final SelectionChangedEvent event=new SelectionChangedEvent(this,selection);
  ReportRequest request=new ReportRequest(this);
  List list=new ArrayList();
  if (selection instanceof IStructuredSelection) {
    list=((IStructuredSelection)selection).toList();
  }
  request.setSelectionObject(list);
  request.setType(ReportRequest.SELECTION);
  SessionHandleAdapter.getInstance().getMediator().notifyRequest(request);
  Object[] listeners=selectionChangedListeners.getListeners();
  for (int i=0; i < listeners.length; ++i) {
    final ISelectionChangedListener l=(ISelectionChangedListener)listeners[i];
    SafeRunner.run(new SafeRunnable(){
      public void run(){
        l.selectionChanged(event);
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * Fires a selection changed event.
 * @param selection the new selection
 */
private void fireSelectionChanged(ISelection selection){
  final SelectionChangedEvent event=new SelectionChangedEvent(this,selection);
  ReportRequest request=new ReportRequest(this);
  List<?> list=new ArrayList();
  if (selection instanceof IStructuredSelection) {
    list=((IStructuredSelection)selection).toList();
  }
  request.setSelectionObject(list);
  request.setType(ReportRequest.SELECTION);
  SessionHandleAdapter.getInstance().getMediator().notifyRequest(request);
  Object[] listeners=selectionChangedListeners.getListeners();
  for (int i=0; i < listeners.length; ++i) {
    final ISelectionChangedListener l=(ISelectionChangedListener)listeners[i];
    SafeRunner.run(new SafeRunnable(){
      public void run(){
        l.selectionChanged(event);
      }
    }
);
  }
}
Program: 72367
Project: 72367
Buggy source:
/** 
 * @param schemaName
 * @return
 */
private boolean containsTableInSchema(String schemaName,boolean showSystemTable){
  String[] tableTypes=showSystemTable ? new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"} : new String[]{"String_Node_Str","String_Node_Str"};
  ResultSet rs=metaDataProvider.getAlltables(metaDataProvider.getCatalog(),schemaName,"String_Node_Str",tableTypes);
  if (rs != null) {
    try {
      while (rs.next()) {
        return true;
      }
    }
 catch (    SQLException e) {
      logger.log(Level.FINE,e.getMessage(),e);
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param schemaName
 * @return
 */
private boolean containsTableInSchema(String schemaName,boolean showSystemTable){
  String dbType=getSelectedDbType();
  String namePattern=SQLUtility.getTailoredSearchText(searchTxt.getText());
  if (dbType.equalsIgnoreCase(DbType.PROCEDURE_STRING)) {
    return containsProcedure(schemaName,namePattern);
  }
 else   if (dbType.equalsIgnoreCase(DbType.TABLE_STRING)) {
    return containsTableOfTableType(schemaName,showSystemTable);
  }
 else   if (dbType.equalsIgnoreCase(DbType.VIEW_STRING)) {
    return containsTableOfViewType(schemaName);
  }
  return containsTableOfAllType(schemaName,namePattern,showSystemTable);
}
Program: 72368
Project: 72368
Buggy source:
/** 
 * Test the function that whether an element/structure can be exported.
 * @throws Exception
 */
public void testCanExport() throws Exception {
  openDesign("String_Node_Str");
  openLibrary("String_Node_Str");
  DataSetHandle ds=designHandle.findDataSet("String_Node_Str");
  assertTrue(ElementExportUtil.canExport(ds,libraryHandle,false));
  DataSetHandle tmpDs=libraryHandle.getElementFactory().newScriptDataSet("String_Node_Str");
  libraryHandle.getDataSets().add(tmpDs);
  assertFalse(ElementExportUtil.canExport(ds,libraryHandle,false));
  assertTrue(ElementExportUtil.canExport(ds,libraryHandle,true));
  StyleHandle style1=designHandle.findStyle("String_Node_Str");
  assertFalse(ElementExportUtil.canExport(style1,libraryHandle,false));
  CustomColorHandle color1=(CustomColorHandle)designHandle.customColorsIterator().next();
  assertTrue(ElementExportUtil.canExport(color1,libraryHandle,false));
  CustomColor tmpColor1=StructureFactory.createCustomColor();
  tmpColor1.setName("String_Node_Str");
  libraryHandle.getPropertyHandle(IModuleModel.COLOR_PALETTE_PROP).addItem(tmpColor1);
  assertFalse(ElementExportUtil.canExport(color1,libraryHandle,false));
  assertTrue(ElementExportUtil.canExport(color1,libraryHandle,true));
}

Fixed version (ground truth):
/** 
 * Test the function that whether an element/structure can be exported.
 * @throws Exception
 */
public void testCanExport() throws Exception {
  openDesign("String_Node_Str");
  openLibrary("String_Node_Str");
  DataSetHandle ds=designHandle.findDataSet("String_Node_Str");
  assertTrue(ElementExportUtil.canExport(ds,libraryHandle,false));
  DataSetHandle tmpDs=libraryHandle.getElementFactory().newScriptDataSet("String_Node_Str");
  libraryHandle.getDataSets().add(tmpDs);
  assertFalse(ElementExportUtil.canExport(ds,libraryHandle,false));
  assertTrue(ElementExportUtil.canExport(ds,libraryHandle,true));
  StyleHandle style1=designHandle.findStyle("String_Node_Str");
  assertFalse(ElementExportUtil.canExport(style1,libraryHandle,false));
  TableHandle table=(TableHandle)designHandle.findElement("String_Node_Str");
  GroupHandle group=(GroupHandle)table.getGroups().get(0);
  assertFalse(ElementExportUtil.canExport(group,libraryHandle,false));
  CustomColorHandle color1=(CustomColorHandle)designHandle.customColorsIterator().next();
  assertTrue(ElementExportUtil.canExport(color1,libraryHandle,false));
  CustomColor tmpColor1=StructureFactory.createCustomColor();
  tmpColor1.setName("String_Node_Str");
  libraryHandle.getPropertyHandle(IModuleModel.COLOR_PALETTE_PROP).addItem(tmpColor1);
  assertFalse(ElementExportUtil.canExport(color1,libraryHandle,false));
  assertTrue(ElementExportUtil.canExport(color1,libraryHandle,true));
}
Program: 72370
Project: 72370
Buggy source:
public void end(IReportContent report){
  engine.complete();
  ExcelWriter writer=new ExcelWriter(out,context);
  writer.writeDeclarations();
  writer.writeDocumentProperties(report);
  writer.declareStyles(engine.getStyleMap());
  writer.defineNames(engine.getNamesRefer());
  startSheet(writer);
  int count=0;
  while (count < engine.getRowCount()) {
    if ((count % (engine.MAX_ROW + 1)) == 0 && count != 0) {
      endSheet(writer);
      startSheet(writer);
    }
    outputData(engine.getRow(count),writer);
    count++;
  }
  endSheet(writer);
  writer.close(true);
  sheetIndex=1;
}

Fixed version (ground truth):
public void end(IReportContent report){
  engine.complete();
  boolean isRTLSheet=false;
  String reportOrientation=report.getDesign().getReportDesign().getBidiOrientation();
  if ("String_Node_Str".equalsIgnoreCase(reportOrientation))   isRTLSheet=true;
  ExcelWriter writer=new ExcelWriter(out,context,isRTLSheet);
  writer.writeDeclarations();
  writer.writeDocumentProperties(report);
  writer.declareStyles(engine.getStyleMap());
  writer.defineNames(engine.getNamesRefer());
  startSheet(writer);
  int count=0;
  while (count < engine.getRowCount()) {
    if ((count % (engine.MAX_ROW + 1)) == 0 && count != 0) {
      endSheet(writer);
      startSheet(writer);
    }
    outputData(engine.getRow(count),writer);
    count++;
  }
  endSheet(writer);
  writer.close(true);
  sheetIndex=1;
}
Program: 72371
Project: 72371
Buggy source:
public ExcelWriter(OutputStream out,String encoding,ExcelContext context){
  this.context=context;
  writer.open(out,encoding);
}

Fixed version (ground truth):
/** 
 * @author bidi_acgc
 * @param isRTLSheet:represents the direction of the excel sheet.
 */
public ExcelWriter(OutputStream out,String encoding,ExcelContext context,boolean isRTLSheet){
  this.context=context;
  this.isRTLSheet=isRTLSheet;
  writer.open(out,encoding);
}
Program: 72372
Project: 72372
Buggy source:
public IStyle getComputedStyle(){
  if (computedStyle == null) {
    if (parent == null) {
      computedStyle=new ComputedStyle(this);
    }
 else {
      if (inlineStyle == null || inlineStyle.isEmpty()) {
        ComputedStyle pcs=(ComputedStyle)((IContent)parent).getComputedStyle();
        ComputedStyle cs=pcs.getCachedStyle(styleClass);
        if (cs == null) {
          cs=new ComputedStyle(this);
          pcs.addCachedStyle(styleClass,cs);
        }
        computedStyle=cs;
      }
 else {
        computedStyle=new ComputedStyle(this);
      }
    }
  }
  return computedStyle;
}

Fixed version (ground truth):
public IStyle getComputedStyle(){
  if (computedStyle == null) {
    if (parent == null) {
      computedStyle=new ComputedStyle(this);
    }
 else {
      if (inlineStyle == null || inlineStyle.isEmpty()) {
        String styleClass=getStyleClass();
        ComputedStyle pcs=(ComputedStyle)((IContent)parent).getComputedStyle();
        ComputedStyle cs=pcs.getCachedStyle(styleClass);
        if (cs == null) {
          cs=new ComputedStyle(this);
          pcs.addCachedStyle(styleClass,cs);
        }
        computedStyle=cs;
      }
 else {
        computedStyle=new ComputedStyle(this);
      }
    }
  }
  return computedStyle;
}
Program: 72373
Project: 72373
Buggy source:
public static IArea createTextArea(ITextContent textContent,int offset,int baseLevel,int runDirection,FontInfo fontInfo){
  return new TextArea(textContent,offset,baseLevel,runDirection,fontInfo);
}

Fixed version (ground truth):
public static IArea createTextArea(ITextContent textContent,int offset,int baseLevel,int runLevel,FontInfo fontInfo){
  return new TextArea(textContent,offset,baseLevel,runLevel,fontInfo);
}
Program: 72374
Project: 72374
Buggy source:
public TextArea(ITextContent textContent,int offset,int baseLevel,int runDirection,FontInfo fontInfo){
  super(textContent);
  this.textContent=textContent;
  this.fi=fontInfo;
  height=(int)(fi.getWordHeight() * PDFConstants.LAYOUT_TO_PDF_RATIO);
  baseLine=this.fi.getBaseline();
  this.offset=offset;
  this.runDirection=runDirection;
  this.lineBreak=false;
  removePadding();
  removeBorder();
  removeMargin();
}

Fixed version (ground truth):
public TextArea(ITextContent textContent,int offset,int baseLevel,int runLevel,FontInfo fontInfo){
  super(textContent);
  this.textContent=textContent;
  this.fi=fontInfo;
  height=(int)(fi.getWordHeight() * PDFConstants.LAYOUT_TO_PDF_RATIO);
  baseLine=this.fi.getBaseline();
  this.offset=offset;
  this.runLevel=runLevel;
  this.lineBreak=false;
  removePadding();
  removeBorder();
  removeMargin();
}
Program: 72375
Project: 72375
Buggy source:
/** 
 * Gets the text in visual order.
 * @param text the original text.
 * @return the text in visual order.
 */
public String getText(){
  calculateText();
  if (runDirection == Bidi.DIRECTION_LEFT_TO_RIGHT) {
    return text;
  }
 else {
    return flip(text);
  }
}

Fixed version (ground truth):
/** 
 * Gets the text in visual order.
 * @param text the original text.
 * @return the text in visual order.
 */
public String getText(){
  calculateText();
  if ((runLevel & 1) == 0) {
    return text;
  }
 else {
    return flip(text);
  }
}
Program: 72376
Project: 72376
Buggy source:
/** 
 * Reverse text
 * @param text
 * @return
 */
private String flip(String text){
  char[] indexChars=text.toCharArray();
  int start=0;
  int end=indexChars.length;
  int mid=(start + end) / 2;
  --end;
  for (; start < mid; ++start, --end) {
    char temp=indexChars[start];
    indexChars[start]=indexChars[end];
    indexChars[end]=temp;
  }
  return new String(indexChars);
}

Fixed version (ground truth):
private String flip(String text){
  return Bidi.writeReverse(text,Bidi.OUTPUT_REVERSE | Bidi.DO_MIRRORING);
}
Program: 72377
Project: 72377
Buggy source:
/** 
 * Gets the reverse text if the run direction is RtL, If the run direction is LtR, the text keeps the same.
 * @param text						the original text.
 * @return							the reverse text.
 */
private String getReverseText(String text){
  if (chunk.getRunDirection() == Bidi.DIRECTION_LEFT_TO_RIGHT) {
    return text;
  }
 else {
    return flip(text);
  }
}

Fixed version (ground truth):
/** 
 * Gets the reverse text if the run direction is RtL, If the run direction is LtR, the text keeps the same.
 * @param text						the original text.
 * @return							the reverse text.
 */
private String getReverseText(String text){
  if ((chunk.getRunLevel() & 1) == 0) {
    return text;
  }
 else {
    return flip(text);
  }
}
Program: 72378
Project: 72378
Buggy source:
/** 
 * true if succeed to new a line.
 */
public boolean newLine(){
{
    return lineLM.endLine();
  }
}

Fixed version (ground truth):
/** 
 * true if succeed to new a line.
 */
public boolean newLine(){
{
    return parentLM.endLine();
  }
}
Program: 72379
Project: 72379
Buggy source:
public InlineTextLayout(LayoutEngineContext context,ContainerLayout parentContext,IContent content){
  super(context,parentContext,content);
  lineLM=(InlineStackingLayout)parentContext;
  ITextContent textContent=(ITextContent)content;
  lineLM.setTextIndent(textContent);
  String text=textContent.getText();
  if (text != null && text.length() != 0) {
    transform(textContent);
    this.textContent=textContent;
    comp=new TextCompositor(textContent,context.getFontManager(),context.getBidiProcessing(),context.getFontSubstitution(),context.getTextWrapping(),context.isEnableHyphenation(),context.getLocale());
  }
}

Fixed version (ground truth):
public InlineTextLayout(LayoutEngineContext context,ContainerLayout parentContext,IContent content){
  super(context,parentContext,content);
  parentLM=(InlineStackingLayout)parentContext;
  ITextContent textContent=(ITextContent)content;
  parentLM.setTextIndent(textContent);
  String text=textContent.getText();
  if (text != null && text.length() != 0) {
    transform(textContent);
    this.textContent=textContent;
    comp=new TextCompositor(textContent,context.getFontManager(),context.getBidiProcessing(),context.getFontSubstitution(),context.getTextWrapping(),context.isEnableHyphenation(),context.getLocale());
    ContainerLayout ancestor=parentLM;
    do {
      if (null == ancestor) {
        comp.setNewLineStatus(true);
        return;
      }
      if (!ancestor.isRootEmpty()) {
        comp.setNewLineStatus(false);
        return;
      }
      if (ancestor instanceof LineLayout) {
        comp.setNewLineStatus(ancestor.isRootEmpty());
        return;
      }
      ancestor=ancestor.getParent();
    }
 while (true);
  }
}
Program: 72380
Project: 72380
Buggy source:
public int getFreeSpace(){
  return lineLM.getCurrentMaxContentWidth();
}

Fixed version (ground truth):
public int getFreeSpace(){
  return parentLM.getCurrentMaxContentWidth();
}
Program: 72381
Project: 72381
Buggy source:
public void addTextArea(AbstractArea textArea){
{
    lineLM.addArea(textArea);
  }
}

Fixed version (ground truth):
public void addTextArea(AbstractArea textArea){
{
    parentLM.addArea(textArea);
  }
}
Program: 72382
Project: 72382
Buggy source:
protected void initialize(){
  createRoot();
  maxAvaWidth=parent.getCurrentMaxContentWidth();
  maxAvaHeight=parent.getCurrentMaxContentHeight();
  root.setWidth(parent.getCurrentMaxContentWidth());
  lineHeight=((BlockStackingLayout)parent).getLineHeight();
}

Fixed version (ground truth):
protected void initialize(){
  createRoot();
  maxAvaWidth=parent.getCurrentMaxContentWidth();
  maxAvaHeight=parent.getCurrentMaxContentHeight();
  root.setWidth(parent.getCurrentMaxContentWidth());
  lineHeight=((BlockStackingLayout)parent).getLineHeight();
  if (parent.content != null) {
    if (BIRTConstants.BIRT_RTL_VALUE.equals(parent.content.getComputedStyle().getDirection()))     baseLevel=Bidi.DIRECTION_RIGHT_TO_LEFT;
  }
}
Program: 72383
Project: 72383
Buggy source:
protected void align(boolean lastLine){
  assert(parent instanceof BlockStackingLayout);
  String align=((BlockStackingLayout)parent).getTextAlign();
  if ((CSSConstants.CSS_RIGHT_VALUE.equalsIgnoreCase(align) || CSSConstants.CSS_CENTER_VALUE.equalsIgnoreCase(align))) {
    int spacing=root.getWidth() - currentIP;
    Iterator iter=root.getChildren();
    while (iter.hasNext()) {
      AbstractArea area=(AbstractArea)iter.next();
      if (spacing > 0) {
        if (CSSConstants.CSS_RIGHT_VALUE.equalsIgnoreCase(align)) {
          area.setAllocatedPosition(spacing + area.getAllocatedX(),area.getAllocatedY());
        }
 else         if (CSSConstants.CSS_CENTER_VALUE.equalsIgnoreCase(align)) {
          area.setAllocatedPosition(spacing / 2 + area.getAllocatedX(),area.getAllocatedY());
        }
      }
    }
  }
 else   if (CSSConstants.CSS_JUSTIFY_VALUE.equalsIgnoreCase(align) && !lastLine) {
    justify();
  }
  verticalAlign();
}

Fixed version (ground truth):
protected void align(boolean lastLine){
  assert(parent instanceof BlockStackingLayout);
  String align=((BlockStackingLayout)parent).getTextAlign();
  if ((CSSConstants.CSS_RIGHT_VALUE.equalsIgnoreCase(align) || CSSConstants.CSS_CENTER_VALUE.equalsIgnoreCase(align))) {
    int spacing=root.getWidth() - currentIP;
    Iterator iter=root.getChildren();
    while (iter.hasNext()) {
      AbstractArea area=(AbstractArea)iter.next();
      if (spacing > 0) {
        if (CSSConstants.CSS_RIGHT_VALUE.equalsIgnoreCase(align)) {
          area.setAllocatedPosition(spacing + area.getAllocatedX(),area.getAllocatedY());
        }
 else         if (CSSConstants.CSS_CENTER_VALUE.equalsIgnoreCase(align)) {
          area.setAllocatedPosition(spacing / 2 + area.getAllocatedX(),area.getAllocatedY());
        }
      }
    }
  }
 else   if (CSSConstants.CSS_JUSTIFY_VALUE.equalsIgnoreCase(align) && !lastLine) {
    justify();
  }
  if (context.getBidiProcessing())   reorderVisually();
  verticalAlign();
}
Program: 72384
Project: 72384
Buggy source:
private TextArea getNextTextArea(int maxLineWidth){
  if (null != wordVestige) {
    TextArea textArea=(TextArea)AreaFactory.createTextArea(textContent,offset,lineBaseLevel,lineRunDirection,fontInfo);
    textArea.setMaxWidth(maxLineWidth);
    textArea.setWidth(0);
    addWordIntoTextArea(textArea,wordVestige);
    return textArea;
  }
  if (null != remainWord) {
    TextArea textArea=(TextArea)AreaFactory.createTextArea(textContent,offset,lineBaseLevel,lineRunDirection,fontInfo);
    textArea.setMaxWidth(maxLineWidth);
    textArea.setWidth(0);
    addWordIntoTextArea(textArea,remainWord);
    remainWord=null;
    return textArea;
  }
  if (null == remainWords || !remainWords.hasWord()) {
    Chunk chunk=remainChunks.getNext();
    if (chunk == Chunk.HARD_LINE_BREAK) {
      FontHandler handler=new FontHandler(fontManager,textContent,false);
      TextArea textArea=(TextArea)AreaFactory.createTextArea(textContent,handler.getFontInfo(),true);
      textArea.setTextLength(1);
      hasLineBreak=true;
      return textArea;
    }
    fontInfo=chunk.getFontInfo();
    lineBaseLevel=chunk.getBaseLevel();
    lineRunDirection=chunk.getRunDirection();
    remainWords=new WordRecognizerWrapper(chunk.getText(),locale);
  }
  TextArea textArea=(TextArea)AreaFactory.createTextArea(textContent,offset,lineBaseLevel,lineRunDirection,fontInfo);
  textArea.setMaxWidth(maxLineWidth);
  textArea.setWidth(0);
  addWordsIntoTextArea(textArea,remainWords);
  return textArea;
}

Fixed version (ground truth):
private TextArea getNextTextArea(int maxLineWidth){
  if (null != wordVestige) {
    TextArea textArea=(TextArea)AreaFactory.createTextArea(textContent,offset,lineBaseLevel,runLevel,fontInfo);
    textArea.setMaxWidth(maxLineWidth);
    textArea.setWidth(0);
    addWordIntoTextArea(textArea,wordVestige);
    return textArea;
  }
  if (null != remainWord) {
    TextArea textArea=(TextArea)AreaFactory.createTextArea(textContent,offset,lineBaseLevel,runLevel,fontInfo);
    textArea.setMaxWidth(maxLineWidth);
    textArea.setWidth(0);
    addWordIntoTextArea(textArea,remainWord);
    remainWord=null;
    return textArea;
  }
  if (null == remainWords || !remainWords.hasWord()) {
    Chunk chunk=remainChunks.getNext();
    if (chunk == Chunk.HARD_LINE_BREAK) {
      FontHandler handler=new FontHandler(fontManager,textContent,false);
      TextArea textArea=(TextArea)AreaFactory.createTextArea(textContent,handler.getFontInfo(),true);
      textArea.setTextLength(1);
      hasLineBreak=true;
      return textArea;
    }
    fontInfo=chunk.getFontInfo();
    lineBaseLevel=chunk.getBaseLevel();
    runLevel=chunk.getRunLevel();
    remainWords=new WordRecognizerWrapper(chunk.getText(),locale);
  }
  TextArea textArea=(TextArea)AreaFactory.createTextArea(textContent,offset,lineBaseLevel,runLevel,fontInfo);
  textArea.setMaxWidth(maxLineWidth);
  textArea.setWidth(0);
  addWordsIntoTextArea(textArea,remainWords);
  return textArea;
}
Program: 72385
Project: 72385
Buggy source:
public IStyle getComputedStyle(){
  if (computedStyle == null) {
    if (inlineStyle == null || inlineStyle.isEmpty()) {
      String cacheKey=styleClass;
      ITableContent table=((IRowContent)parent).getTable();
      if (column >= 0 && column < table.getColumnCount()) {
        IColumn tblColumn=table.getColumn(column);
        if (tblColumn != null) {
          String columnStyleClass=tblColumn.getStyleClass();
          if (columnStyleClass != null) {
            cacheKey=cacheKey + columnStyleClass;
          }
        }
      }
      ComputedStyle pcs=(ComputedStyle)((IContent)parent).getComputedStyle();
      ComputedStyle cs=pcs.getCachedStyle(cacheKey);
      if (cs == null) {
        cs=new CellComputedStyle(this);
        pcs.addCachedStyle(styleClass,cs);
      }
      computedStyle=cs;
    }
 else {
      computedStyle=new CellComputedStyle(this);
    }
  }
  return computedStyle;
}

Fixed version (ground truth):
public IStyle getComputedStyle(){
  if (computedStyle == null) {
    if (inlineStyle == null || inlineStyle.isEmpty()) {
      String cacheKey=styleClass;
      ITableContent table=((IRowContent)parent).getTable();
      int column=getColumn();
      if (column >= 0 && column < table.getColumnCount()) {
        IColumn tblColumn=table.getColumn(column);
        if (tblColumn != null) {
          String columnStyleClass=tblColumn.getStyleClass();
          if (columnStyleClass != null) {
            cacheKey=cacheKey + columnStyleClass;
          }
        }
      }
      ComputedStyle pcs=(ComputedStyle)((IContent)parent).getComputedStyle();
      ComputedStyle cs=pcs.getCachedStyle(cacheKey);
      if (cs == null) {
        cs=new CellComputedStyle(this);
        pcs.addCachedStyle(styleClass,cs);
      }
      computedStyle=cs;
    }
 else {
      computedStyle=new CellComputedStyle(this);
    }
  }
  return computedStyle;
}
Program: 72386
Project: 72386
Buggy source:
AbstractArea(IReportContent report){
  if (report != null) {
    assert(report instanceof ReportContent);
    style=new AreaStyle(((ReportContent)report).getCSSEngine());
  }
 else {
    style=new AreaStyle(new BIRTCSSEngine());
  }
}

Fixed version (ground truth):
AbstractArea(IReportContent report){
  if (report != null) {
    assert(report instanceof ReportContent);
    style=new AreaStyle(((ReportContent)report).getCSSEngine());
  }
 else {
    style=new AreaStyle(emptyCssEngine);
  }
}
Program: 72388
Project: 72388
Buggy source:
public void writeAlignment(String horizontal,String vertical,boolean wrapText){
  writer.openTag("String_Node_Str");
  if (isValid(horizontal)) {
    writer.attribute("String_Node_Str",horizontal);
  }
  if (isValid(vertical)) {
    writer.attribute("String_Node_Str",vertical);
  }
  if (wrapText) {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
public void writeAlignment(String horizontal,String vertical,String direction,boolean wrapText){
  writer.openTag("String_Node_Str");
  if (isValid(horizontal)) {
    writer.attribute("String_Node_Str",horizontal);
  }
  if (isValid(vertical)) {
    writer.attribute("String_Node_Str",vertical);
  }
  if (isValid(direction)) {
    if (BIRTConstants.BIRT_RTL_VALUE.equals(direction))     writer.attribute("String_Node_Str","String_Node_Str");
 else     writer.attribute("String_Node_Str","String_Node_Str");
  }
  if (wrapText) {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
  writer.closeTag("String_Node_Str");
}
Program: 72390
Project: 72390
Buggy source:
/** 
 * populate the extended extensions information.
 * @param name
 * @param aggrFunc
 * @param elem
 * @param aggrWrapper 
 */
private void populateExtendedAggrInfo(String name,IAggregation aggrFunc,IConfigurationElement elem,AggrFunctionWrapper aggrWrapper){
  IConfigurationElement[] uiInfo=elem.getChildren(ELEMENT_UIINFO);
  assert(uiInfo != null && uiInfo.length == 1);
  String paramInfo=uiInfo[0].getAttribute(ATTRIBUTE_PARAMETER_META_INFO);
  String textInfo=uiInfo[0].getAttribute(ATTRIBUTE_TEXT_DATA);
  aggrWrapper.setDisplayName(textInfo);
  List paramList=new ArrayList();
  String[] paramInfos=paramInfo.split("String_Node_Str");
  boolean[] paramFlags=aggrFunc.getParameterDefn();
  if (paramInfos != null && paramInfos.length > 0) {
    populateDataFiledParameterDefn(paramList);
    for (int k=0; k < paramInfos.length; k++) {
      final String s=paramInfos[k].trim();
      int index=s.indexOf(' ');
      String paramName=null;
      if (index > 0) {
        paramName=s.substring(index + 1).trim();
      }
 else {
        paramName=paramInfos[k];
      }
      if (k + 1 >= paramFlags.length) {
        break;
      }
      ParameterDefn paramDefn=new ParameterDefn(paramName,paramName,!paramFlags[k + 1],false);
      paramList.add(paramDefn);
    }
  }
  aggrWrapper.setParameterDefn(null);
}

Fixed version (ground truth):
/** 
 * populate the extended extensions information.
 * @param name
 * @param aggrFunc
 * @param elem
 * @param aggrWrapper 
 */
private void populateExtendedAggrInfo(String name,IAggregation aggrFunc,IConfigurationElement elem,AggrFunctionWrapper aggrWrapper){
  IConfigurationElement[] uiInfo=elem.getChildren(ELEMENT_UIINFO);
  assert(uiInfo != null && uiInfo.length == 1);
  String paramInfo=uiInfo[0].getAttribute(ATTRIBUTE_PARAMETER_META_INFO);
  String textInfo=uiInfo[0].getAttribute(ATTRIBUTE_TEXT_DATA);
  aggrWrapper.setDisplayName(textInfo);
  List paramList=new ArrayList();
  String[] paramInfos=paramInfo.split("String_Node_Str");
  boolean[] paramFlags=aggrFunc.getParameterDefn();
  if (paramInfos != null && paramInfos.length > 0) {
    populateDataFiledParameterDefn(paramList);
    for (int k=0; k < paramInfos.length; k++) {
      final String s=paramInfos[k].trim();
      int index=s.indexOf(' ');
      String paramName=null;
      if (index > 0) {
        paramName=s.substring(index + 1).trim();
      }
 else {
        paramName=paramInfos[k];
      }
      if (k + 1 >= paramFlags.length) {
        break;
      }
      ParameterDefn paramDefn=new ParameterDefn(paramName,paramName,!paramFlags[k + 1],false);
      paramList.add(paramDefn);
    }
  }
  IParameterDefn[] params=new IParameterDefn[paramList.size()];
  paramList.toArray(params);
  aggrWrapper.setParameterDefn(params);
}
Program: 72391
Project: 72391
Buggy source:
protected IContentEmitter createContentEmitter() throws EngineException {
  String format=renderOptions.getOutputFormat();
  if (format == null) {
    format=RenderOption.OUTPUT_FORMAT_HTML;
  }
  ExtensionManager extManager=ExtensionManager.getInstance();
  boolean supported=false;
  Collection supportedFormats=extManager.getSupportedFormat();
  Iterator iter=supportedFormats.iterator();
  while (iter.hasNext()) {
    String supportedFormat=(String)iter.next();
    if (supportedFormat != null && supportedFormat.equalsIgnoreCase(format)) {
      supported=true;
      break;
    }
  }
  if (!supported) {
    log.log(Level.SEVERE,MessageConstants.FORMAT_NOT_SUPPORTED_EXCEPTION,format);
    throw new UnsupportedFormatException(MessageConstants.FORMAT_NOT_SUPPORTED_EXCEPTION,format);
  }
  pagination=extManager.getPagination(format);
  Boolean outputDisplayNone=extManager.getOutputDisplayNone(format);
  if (!renderOptions.hasOption(IRenderOption.OUTPUT_DISPLAY_NONE)) {
    renderOptions.setOption(IRenderOption.OUTPUT_DISPLAY_NONE,outputDisplayNone);
  }
  IContentEmitter emitter=null;
  try {
    emitter=extManager.createEmitter(format,emitterID);
  }
 catch (  Throwable t) {
    log.log(Level.SEVERE,"String_Node_Str",format);
    throw new EngineException(MessageConstants.CANNOT_CREATE_EMITTER_EXCEPTION,format,t);
  }
  if (emitter == null) {
    log.log(Level.SEVERE,"String_Node_Str",format);
    throw new EngineException(MessageConstants.CANNOT_CREATE_EMITTER_EXCEPTION,format);
  }
  return emitter;
}

Fixed version (ground truth):
protected IContentEmitter createContentEmitter() throws EngineException {
  ExtensionManager extManager=ExtensionManager.getInstance();
  pagination=extManager.getPagination(emitterID);
  Boolean outputDisplayNone=extManager.getOutputDisplayNone(emitterID);
  if (!renderOptions.hasOption(IRenderOption.OUTPUT_DISPLAY_NONE)) {
    renderOptions.setOption(IRenderOption.OUTPUT_DISPLAY_NONE,outputDisplayNone);
  }
  IContentEmitter emitter=null;
  try {
    emitter=extManager.createEmitter(format,emitterID);
  }
 catch (  Throwable t) {
    log.log(Level.SEVERE,"String_Node_Str",format);
    throw new EngineException(MessageConstants.CANNOT_CREATE_EMITTER_EXCEPTION,format,t);
  }
  if (emitter == null) {
    log.log(Level.SEVERE,"String_Node_Str",format);
    throw new EngineException(MessageConstants.CANNOT_CREATE_EMITTER_EXCEPTION,format);
  }
  return emitter;
}
Program: 72393
Project: 72393
Buggy source:
/** 
 * @param format the output format
 * @return the pagination for the specific format
 */
public String getPagination(String format){
  if (format != null) {
    format=format.toLowerCase();
  }
  if (formats.containsKey(format)) {
    return ((EmitterInfo)formats.get(format)).getPagination();
  }
  return PAGE_BREAK_PAGINATION;
}

Fixed version (ground truth):
/** 
 * @param emitterId emitterId
 * @return the pagination for the specified emitter ID.
 */
public String getPagination(String emitterId){
  if (emitterId != null) {
    for (    EmitterInfo emitterInfo : emitterExtensions) {
      if (emitterId.equals(emitterInfo.getID())) {
        return emitterInfo.getPagination();
      }
    }
  }
  return PAGE_BREAK_PAGINATION;
}
Program: 72394
Project: 72394
Buggy source:
public Boolean getOutputDisplayNone(String format){
  if (format != null) {
    format=format.toLowerCase();
  }
  if (formats.containsKey(format)) {
    return ((EmitterInfo)formats.get(format)).getOutputDisplayNone();
  }
  return DEFAULT_OUTPUT_DISPLAY_NONE;
}

Fixed version (ground truth):
public Boolean getOutputDisplayNone(String emitterId){
  if (emitterId != null) {
    for (    EmitterInfo emitterInfo : emitterExtensions) {
      if (emitterId.equals(emitterInfo.getID())) {
        return emitterInfo.getOutputDisplayNone();
      }
    }
  }
  return DEFAULT_OUTPUT_DISPLAY_NONE;
}
Program: 72397
Project: 72397
Buggy source:
public int isNullable(int param) throws OdaException {
  return IParameterMetaData.parameterModeUnknown;
}

Fixed version (ground truth):
public int isNullable(int param) throws OdaException {
  return IParameterMetaData.parameterNullableUnknown;
}
Program: 72398
Project: 72398
Buggy source:
public int getParameterMode(int param) throws OdaException {
  IParameterDefinition defn=(IParameterDefinition)paraDefnList[param];
  if (defn.isInputMode() && defn.isOutputMode())   return IParameterMetaData.parameterModeInOut;
 else   if (defn.isInputMode())   return IParameterMetaData.parameterModeIn;
 else   if (defn.isOutputMode())   return IParameterMetaData.parameterModeOut;
 else   return IParameterMetaData.parameterModeUnknown;
}

Fixed version (ground truth):
public int getParameterMode(int param) throws OdaException {
  IParameterDefinition defn=(IParameterDefinition)paraDefnList[param - 1];
  if (defn.isInputMode() && defn.isOutputMode())   return IParameterMetaData.parameterModeInOut;
 else   if (defn.isInputMode())   return IParameterMetaData.parameterModeIn;
 else   if (defn.isOutputMode())   return IParameterMetaData.parameterModeOut;
 else   return IParameterMetaData.parameterModeUnknown;
}
Program: 72399
Project: 72399
Buggy source:
public int getParameterType(int param) throws OdaException {
  IParameterDefinition defn=(IParameterDefinition)paraDefnList[param];
  Class dataTypeClass=DataType.getClass(defn.getType());
  return DataTypeUtil.toOdaType(dataTypeClass);
}

Fixed version (ground truth):
public int getParameterType(int param) throws OdaException {
  IParameterDefinition defn=(IParameterDefinition)paraDefnList[param - 1];
  Class dataTypeClass=DataType.getClass(defn.getType());
  return DataTypeUtil.toOdaType(dataTypeClass);
}