nus-yam/ex-repair huggingface dataset:
Program: 67321
Project: 67321
Buggy source:
public static org.eclipse.birt.report.engine.layout.emitter.Image parseImage(IImageContent image,int imageSource,String uri,String mimeType,String extension) throws IOException {
  org.eclipse.birt.report.engine.layout.emitter.Image imageInfo=null;
  byte[] data=null;
  InputStream in=null;
  try {
switch (imageSource) {
case IImageContent.IMAGE_FILE:
case IImageContent.IMAGE_URL:
      if (uri != null) {
        if (SvgFile.isSvg(uri)) {
          data=SvgFile.transSvgToArray(uri);
        }
 else {
          data=getNonSVGImageData(uri);
        }
      }
    break;
case IImageContent.IMAGE_NAME:
case IImageContent.IMAGE_EXPRESSION:
  data=image.getData();
if (SvgFile.isSvg(mimeType,uri,extension) && null != data) {
  in=new ByteArrayInputStream(data);
  data=SvgFile.transSvgToArray(in);
}
break;
}
imageInfo=new org.eclipse.birt.report.engine.layout.emitter.Image();
if (data != null) {
imageInfo.setInput(data);
if (!imageInfo.check()) {
imageInfo.setData(null);
}
}
}
  finally {
if (in != null) {
try {
in.close();
in=null;
}
 catch (Exception t) {
logger.log(Level.WARNING,t.getMessage());
}
}
}
return imageInfo;
}

Fixed version (ground truth):
public static org.eclipse.birt.report.engine.layout.emitter.Image parseImage(IImageContent image,int imageSource,String uri,String mimeType,String extension) throws IOException {
  org.eclipse.birt.report.engine.layout.emitter.Image imageInfo=null;
  byte[] data=null;
  InputStream in=null;
  try {
switch (imageSource) {
case IImageContent.IMAGE_FILE:
case IImageContent.IMAGE_URL:
      if (uri != null) {
        if (SvgFile.isSvg(uri)) {
          try {
            data=SvgFile.transSvgToArray(uri);
          }
 catch (          Exception e) {
            logger.log(Level.WARNING,e.getMessage());
          }
        }
 else {
          data=getNonSVGImageData(uri);
        }
      }
    break;
case IImageContent.IMAGE_NAME:
case IImageContent.IMAGE_EXPRESSION:
  data=image.getData();
if (SvgFile.isSvg(mimeType,uri,extension) && null != data) {
  in=new ByteArrayInputStream(data);
  try {
    data=SvgFile.transSvgToArray(in);
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,e.getMessage());
  }
}
break;
}
imageInfo=new org.eclipse.birt.report.engine.layout.emitter.Image();
if (data != null) {
imageInfo.setInput(data);
if (!imageInfo.check()) {
imageInfo.setData(null);
}
}
}
  finally {
if (in != null) {
try {
in.close();
in=null;
}
 catch (Exception t) {
logger.log(Level.WARNING,t.getMessage());
}
}
}
return imageInfo;
}
Program: 67322
Project: 67322
Buggy source:
private void readImage(byte[] data) throws IOException {
  if (data == null || data.length == 0) {
    buffer=null;
    status=RESOURCE_UNREACHABLE;
    return;
  }
  if (isOutputSupported()) {
    buffer=data;
    status=OBJECT_LOADED_SUCCESSFULLY;
  }
 else {
    if (objectType == TYPE_SVG_OBJECT) {
      InputStream in=new ByteArrayInputStream(data);
      buffer=SvgFile.transSvgToArray(in);
      in.close();
      objectType=TYPE_CONVERTED_SVG_OBJECT;
      status=OBJECT_LOADED_SUCCESSFULLY;
    }
 else {
      buffer=null;
      status=UNSUPPORTED_OBJECTS;
    }
  }
}

Fixed version (ground truth):
private void readImage(byte[] data) throws IOException {
  if (data == null || data.length == 0) {
    buffer=null;
    status=RESOURCE_UNREACHABLE;
    return;
  }
  if (isOutputSupported()) {
    buffer=data;
    status=OBJECT_LOADED_SUCCESSFULLY;
  }
 else {
    if (objectType == TYPE_SVG_OBJECT) {
      InputStream in=null;
      try {
        in=new ByteArrayInputStream(data);
        buffer=SvgFile.transSvgToArray(in);
      }
 catch (      Exception e) {
        buffer=null;
        status=UNSUPPORTED_OBJECTS;
        return;
      }
 finally {
        if (in != null) {
          in.close();
        }
      }
      objectType=TYPE_CONVERTED_SVG_OBJECT;
      status=OBJECT_LOADED_SUCCESSFULLY;
    }
 else {
      buffer=null;
      status=UNSUPPORTED_OBJECTS;
    }
  }
}
Program: 67323
Project: 67323
Buggy source:
protected void updateBackgroundImage(){
  BackgroundImageInfo bgi=boxStyle.getBackgroundImage();
  Image img=null;
  if (bgi != null) {
    String imageUrl=bgi.getUrl();
    try {
      img=Image.getInstance(new URL(bgi.getUrl()));
    }
 catch (    Exception e) {
      if (SvgFile.isSvg(imageUrl)) {
        try {
          img=Image.getInstance(SvgFile.transSvgToArray(imageUrl));
        }
 catch (        Exception ex) {
          logger.log(Level.WARNING,ex.getMessage(),ex);
        }
      }
 else {
        logger.log(Level.WARNING,e.getMessage(),e);
      }
    }
    if (img != null) {
      int resolutionX=img.getDpiX();
      int resolutionY=img.getDpiY();
      if (0 == resolutionX || 0 == resolutionY) {
        resolutionX=96;
        resolutionY=96;
      }
      float imageWidth=img.getPlainWidth() / resolutionX * 72;
      float imageHeight=img.getPlainHeight() / resolutionY * 72;
      if (content != null) {
        IStyle style=content.getComputedStyle();
        int ox=getDimensionValue(style.getProperty(IStyle.STYLE_BACKGROUND_POSITION_X),(width - (int)(imageWidth * PDFConstants.LAYOUT_TO_PDF_RATIO)));
        int oy=getDimensionValue(style.getProperty(IStyle.STYLE_BACKGROUND_POSITION_Y),(height - (int)(imageHeight * PDFConstants.LAYOUT_TO_PDF_RATIO)));
        bgi.setXOffset(ox);
        bgi.setYOffset(oy);
      }
    }
  }
}

Fixed version (ground truth):
protected void updateBackgroundImage(){
  BackgroundImageInfo bgi=boxStyle.getBackgroundImage();
  Image img=null;
  if (bgi != null) {
    String imageUrl=bgi.getUrl();
    try {
      img=Image.getInstance(new URL(bgi.getUrl()));
    }
 catch (    Exception e) {
      try {
        img=Image.getInstance(SvgFile.transSvgToArray(imageUrl));
      }
 catch (      IOException ex) {
        logger.log(Level.WARNING,ex.getMessage(),ex);
        return;
      }
catch (      Exception te) {
        logger.log(Level.WARNING,e.getMessage(),e);
        return;
      }
    }
    if (img != null) {
      int resolutionX=img.getDpiX();
      int resolutionY=img.getDpiY();
      if (0 == resolutionX || 0 == resolutionY) {
        resolutionX=96;
        resolutionY=96;
      }
      float imageWidth=img.getPlainWidth() / resolutionX * 72;
      float imageHeight=img.getPlainHeight() / resolutionY * 72;
      if (content != null) {
        IStyle style=content.getComputedStyle();
        int ox=getDimensionValue(style.getProperty(IStyle.STYLE_BACKGROUND_POSITION_X),(width - (int)(imageWidth * PDFConstants.LAYOUT_TO_PDF_RATIO)));
        int oy=getDimensionValue(style.getProperty(IStyle.STYLE_BACKGROUND_POSITION_Y),(height - (int)(imageHeight * PDFConstants.LAYOUT_TO_PDF_RATIO)));
        bgi.setXOffset(ox);
        bgi.setYOffset(oy);
      }
    }
  }
}
Program: 67324
Project: 67324
Buggy source:
public static byte[] transSvgToArray(InputStream inputStream) throws IOException {
  JPEGTranscoder transcoder=new JPEGTranscoder();
  transcoder.addTranscodingHint(JPEGTranscoder.KEY_QUALITY,new Float(.8));
  TranscoderInput input=new TranscoderInput(inputStream);
  ByteArrayOutputStream ostream=new ByteArrayOutputStream();
  TranscoderOutput output=new TranscoderOutput(ostream);
  try {
    transcoder.transcode(input,output);
  }
 catch (  TranscoderException e) {
    logger.log(Level.SEVERE,e.getLocalizedMessage(),e);
  }
  ostream.flush();
  return ostream.toByteArray();
}

Fixed version (ground truth):
public static byte[] transSvgToArray(InputStream inputStream) throws Exception {
  JPEGTranscoder transcoder=new JPEGTranscoder();
  transcoder.addTranscodingHint(JPEGTranscoder.KEY_QUALITY,new Float(.8));
  TranscoderInput input=new TranscoderInput(inputStream);
  ByteArrayOutputStream ostream=new ByteArrayOutputStream();
  TranscoderOutput output=new TranscoderOutput(ostream);
  transcoder.transcode(input,output);
  ostream.flush();
  return ostream.toByteArray();
}
Program: 67325
Project: 67325
Buggy source:
public void setPaperTray(int paperTrayCode){
  options.put(OPTION_PAPER_TRAY,paperTrayCode);
}

Fixed version (ground truth):
public void setPaperTray(String paperTray){
  options.put(OPTION_PAPER_TRAY,paperTray);
}
Program: 67326
Project: 67326
Buggy source:
public int getPaperTray(){
  return getIntOption(OPTION_PAPER_TRAY,IPostscriptRenderOption.TRAYCODE_AUTO);
}

Fixed version (ground truth):
public String getPaperTray(){
  return getStringOption(OPTION_PAPER_TRAY);
}
Program: 67327
Project: 67327
Buggy source:
private void setPaperTray(int paperTrayCode){
  out.println("String_Node_Str");
  out.print("String_Node_Str");
  if (paperTrayCode == IPostscriptRenderOption.TRAYCODE_MANUAL) {
    out.println("String_Node_Str");
  }
 else   if (paperTrayCode == IPostscriptRenderOption.TRAYCODE_AUTO) {
    out.println("String_Node_Str");
  }
 else {
    out.println("String_Node_Str" + paperTrayCode + "String_Node_Str");
  }
  out.println("String_Node_Str");
}

Fixed version (ground truth):
private void setPaperTray(String paperTray){
  String trayString=getPaperTrayCode(paperTray);
  if (trayString != null) {
    out.println("String_Node_Str");
    out.println(trayString);
    out.println("String_Node_Str");
  }
}
Program: 67328
Project: 67328
Buggy source:
public void startRenderer(String author,String description,String paperSize,int paperTrayCode,String duplex,int copies,boolean collate,String resolution,boolean color,int scale) throws IOException {
  this.scale=scale;
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  int[] pageSize=getPaperSize(paperSize);
  if (pageSize != null) {
    int width=pageSize[0];
    int height=pageSize[1];
    setPaperSize(paperSize,width,height);
  }
  setPaperTray(paperTrayCode);
  setDuplex(duplex);
  setResolution(resolution);
  setGray(color);
  FileUtil.load("String_Node_Str",out);
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}

Fixed version (ground truth):
public void startRenderer(String author,String description,String paperSize,String paperTray,String duplex,int copies,boolean collate,String resolution,boolean color,int scale) throws IOException {
  this.scale=scale;
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  int[] pageSize=getPaperSize(paperSize);
  if (pageSize != null) {
    int width=pageSize[0];
    int height=pageSize[1];
    setPaperSize(paperSize,width,height);
  }
  setPaperTray(paperTray);
  setDuplex(duplex);
  setResolution(resolution);
  setGray(color);
  FileUtil.load("String_Node_Str",out);
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}
Program: 67329
Project: 67329
Buggy source:
public PostscriptPageDevice(RenderOption renderOption,OutputStream output,String title,String author,String description) throws Exception {
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(output);
  writer=new PostscriptWriter(bufferedOutputStream,title);
  String paperSize=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_SIZE);
  int paperTrayCode=renderOption.getIntOption(PostscriptRenderOption.OPTION_PAPER_TRAY,IPostscriptRenderOption.TRAYCODE_AUTO);
  String duplex=renderOption.getStringOption(PostscriptRenderOption.OPTION_DUPLEX);
  int copies=renderOption.getIntOption(PostscriptRenderOption.OPTION_COPIES,1);
  boolean collate=renderOption.getBooleanOption(PostscriptRenderOption.OPTION_COLLATE,false);
  String resolution=renderOption.getStringOption(IPostscriptRenderOption.OPTION_RESOLUTION);
  boolean color=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_COLOR,true);
  int scale=renderOption.getIntOption(IPostscriptRenderOption.OPTION_SCALE,100);
  writer.startRenderer(author,description,paperSize,paperTrayCode,duplex,copies,collate,resolution,color,scale);
}

Fixed version (ground truth):
public PostscriptPageDevice(RenderOption renderOption,OutputStream output,String title,String author,String description) throws Exception {
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(output);
  writer=new PostscriptWriter(bufferedOutputStream,title);
  String paperSize=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_SIZE);
  String paperTray=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_TRAY);
  String duplex=renderOption.getStringOption(PostscriptRenderOption.OPTION_DUPLEX);
  int copies=renderOption.getIntOption(PostscriptRenderOption.OPTION_COPIES,1);
  boolean collate=renderOption.getBooleanOption(PostscriptRenderOption.OPTION_COLLATE,false);
  String resolution=renderOption.getStringOption(IPostscriptRenderOption.OPTION_RESOLUTION);
  boolean color=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_COLOR,true);
  int scale=renderOption.getIntOption(IPostscriptRenderOption.OPTION_SCALE,100);
  writer.startRenderer(author,description,paperSize,paperTray,duplex,copies,collate,resolution,color,scale);
}
Program: 67330
Project: 67330
Buggy source:
void setPaperTray(int paperTrayCode);

Fixed version (ground truth):
void setPaperTray(String paperTray);
Program: 67331
Project: 67331
Buggy source:
int getPaperTray();

Fixed version (ground truth):
String getPaperTray();
Program: 67333
Project: 67333
Buggy source:
public String getColumnText(Object element,int columnIndex){
  return ((CellValue[])element)[columnIndex].getDisplayValue();
}

Fixed version (ground truth):
public String getColumnText(Object element,int columnIndex){
  if ((element instanceof CellValue[]) && (((CellValue[])element).length > 0)) {
    return ((CellValue[])element)[columnIndex].getDisplayValue();
  }
 else {
    return null;
  }
}
Program: 67334
Project: 67334
Buggy source:
private void createResultSetTableViewer(){
  resultSetTableViewer=new TableViewer(resultSetTable);
  resultSetTableViewer.setSorter(null);
  resultSetTableViewer.setContentProvider(new IStructuredContentProvider(){
    public Object[] getElements(    Object inputElement){
      if (inputElement instanceof List) {
        return ((List)inputElement).toArray();
      }
      return new Object[0];
    }
    public void inputChanged(    Viewer viewer,    Object oldInput,    Object newInput){
    }
    public void dispose(){
    }
  }
);
  resultSetTableViewer.setLabelProvider(new ITableLabelProvider(){
    public Image getColumnImage(    Object element,    int columnIndex){
      return null;
    }
    public String getColumnText(    Object element,    int columnIndex){
      return ((CellValue[])element)[columnIndex].getDisplayValue();
    }
    public void addListener(    ILabelProviderListener listener){
    }
    public void dispose(){
    }
    public boolean isLabelProperty(    Object element,    String property){
      return false;
    }
    public void removeListener(    ILabelProviderListener listener){
    }
  }
);
}

Fixed version (ground truth):
private void createResultSetTableViewer(){
  resultSetTableViewer=new TableViewer(resultSetTable);
  resultSetTableViewer.setSorter(null);
  resultSetTableViewer.setContentProvider(new IStructuredContentProvider(){
    public Object[] getElements(    Object inputElement){
      if (inputElement instanceof List) {
        return ((List)inputElement).toArray();
      }
      return new Object[0];
    }
    public void inputChanged(    Viewer viewer,    Object oldInput,    Object newInput){
    }
    public void dispose(){
    }
  }
);
  resultSetTableViewer.setLabelProvider(new ITableLabelProvider(){
    public Image getColumnImage(    Object element,    int columnIndex){
      return null;
    }
    public String getColumnText(    Object element,    int columnIndex){
      if ((element instanceof CellValue[]) && (((CellValue[])element).length > 0)) {
        return ((CellValue[])element)[columnIndex].getDisplayValue();
      }
 else {
        return null;
      }
    }
    public void addListener(    ILabelProviderListener listener){
    }
    public void dispose(){
    }
    public boolean isLabelProperty(    Object element,    String property){
      return false;
    }
    public void removeListener(    ILabelProviderListener listener){
    }
  }
);
}
Program: 67335
Project: 67335
Buggy source:
public ITOCReader getTOCReader(ClassLoader loader) throws EngineException {
  loadCoreStreamLazily();
  if (cachedTocReaderV0 != null) {
    return cachedTocReaderV0;
  }
  try {
    return new TOCReader(archive,loader);
  }
 catch (  IOException ex) {
    throw new EngineException("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
public ITOCReader getTOCReader(ClassLoader loader) throws EngineException {
  loadCoreStreamLazily();
  if (cachedTreeV0 != null) {
    return new TOCReaderV0(cachedTreeV0);
  }
  try {
    return new TOCReader(archive,loader);
  }
 catch (  IOException ex) {
    throw new EngineException("String_Node_Str",ex);
  }
}
Program: 67336
Project: 67336
Buggy source:
private void loadCoreStream(DataInputStream di) throws IOException {
  ReportDocumentCoreInfo documentInfo=new ReportDocumentCoreInfo();
  loadCoreStreamHeader(di,documentInfo);
  loadCoreStreamBody(di,documentInfo);
  checkpoint=documentInfo.checkpoint;
  pageCount=documentInfo.pageCount;
  globalVariables=documentInfo.globalVariables;
  parameters=documentInfo.parameters;
  if (checkpoint == CHECKPOINT_END) {
    if (indexReader == null) {
      indexReader=documentInfo.indexReader;
    }
 else {
      if (documentInfo.indexReader != null) {
        documentInfo.indexReader.close();
      }
    }
    if (tocReader == null) {
      cachedTocReaderV0=documentInfo.tocReader;
      tocReader=documentInfo.tocReader;
    }
 else {
      if (documentInfo.tocReader != null) {
        documentInfo.tocReader.close();
      }
    }
  }
}

Fixed version (ground truth):
private void loadCoreStream(DataInputStream di) throws IOException {
  ReportDocumentCoreInfo documentInfo=new ReportDocumentCoreInfo();
  loadCoreStreamHeader(di,documentInfo);
  loadCoreStreamBody(di,documentInfo);
  checkpoint=documentInfo.checkpoint;
  pageCount=documentInfo.pageCount;
  globalVariables=documentInfo.globalVariables;
  parameters=documentInfo.parameters;
  if (checkpoint == CHECKPOINT_END) {
    if (indexReader == null) {
      indexReader=documentInfo.indexReader;
    }
 else {
      if (documentInfo.indexReader != null) {
        documentInfo.indexReader.close();
      }
    }
    if (tocReader == null) {
      tocReader=documentInfo.tocReader;
      if (tocReader != null) {
        cachedTreeV0=(TreeNode)tocReader.readTree();
      }
    }
 else {
      if (documentInfo.tocReader != null) {
        documentInfo.tocReader.close();
      }
    }
  }
}
Program: 67337
Project: 67337
Buggy source:
public TOCReaderV0(InputStream in,boolean checkVersion) throws IOException {
  DataInputStream input=new DataInputStream(in);
  if (checkVersion) {
    IOUtil.readString(input);
  }
  root=readRoot(input);
}

Fixed version (ground truth):
public TOCReaderV0(TreeNode root){
  this.root=root;
}
Program: 67338
Project: 67338
Buggy source:
/** 
 * Build the style of cell content.
 */
public void buildCellStyle(ICellContent cell,StringBuffer styleBuffer,boolean isHead,boolean fixedCellHeight){
  IStyle style=cell.getStyle();
  if (fixedReport) {
    HTMLEmitterUtil.buildOverflowStyle(styleBuffer,style,true);
  }
  CSSValue display=style.getProperty(IStyle.STYLE_DISPLAY);
  if (IStyle.NONE_VALUE == display) {
    styleBuffer.append("String_Node_Str");
  }
  style=getElementStyle(cell);
  if (style == null) {
    if (fixedCellHeight) {
      styleBuffer.append("String_Node_Str");
    }
    return;
  }
  AttributeBuilder.buildFont(styleBuffer,style);
  AttributeBuilder.buildMargins(styleBuffer,style);
  if (fixedCellHeight) {
    styleBuffer.append("String_Node_Str");
  }
 else {
    AttributeBuilder.buildPaddings(styleBuffer,style);
  }
  AttributeBuilder.buildBorders(styleBuffer,style);
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildText(styleBuffer,style);
  AttributeBuilder.buildVisual(styleBuffer,style);
  AttributeBuilder.buildTextDecoration(styleBuffer,style);
}

Fixed version (ground truth):
/** 
 * Build the style of cell content.
 */
public void buildCellStyle(ICellContent cell,StringBuffer styleBuffer,boolean isHead,boolean fixedCellHeight){
  IStyle style=cell.getStyle();
  if (style == null) {
    return;
  }
  if (fixedReport) {
    HTMLEmitterUtil.buildOverflowStyle(styleBuffer,style,true);
  }
  CSSValue display=style.getProperty(IStyle.STYLE_DISPLAY);
  if (IStyle.NONE_VALUE == display) {
    styleBuffer.append("String_Node_Str");
  }
  style=getElementStyle(cell);
  if (style == null) {
    if (fixedCellHeight) {
      styleBuffer.append("String_Node_Str");
    }
    return;
  }
  AttributeBuilder.buildFont(styleBuffer,style);
  AttributeBuilder.buildMargins(styleBuffer,style);
  if (fixedCellHeight) {
    styleBuffer.append("String_Node_Str");
  }
 else {
    AttributeBuilder.buildPaddings(styleBuffer,style);
  }
  AttributeBuilder.buildBorders(styleBuffer,style);
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildText(styleBuffer,style);
  AttributeBuilder.buildVisual(styleBuffer,style);
  AttributeBuilder.buildTextDecoration(styleBuffer,style);
}
Program: 67339
Project: 67339
Buggy source:
/** 
 * build overflow style which displays the vertical or horizontal scrollbar automatically if content inside the div tag exceed the limit in any aspect.
 * @param buf - the buffer to build the overflow style
 * @param style - the style of current report item
 * @param outputHidden - whether to output the overflow property with hidden value
 */
public static void buildOverflowStyle(StringBuffer buf,IStyle style,boolean outputHidden){
  String overflow=style.getOverflow();
  if (outputHidden || (overflow != null && !CSSConstants.CSS_OVERFLOW_HIDDEN_VALUE.equals(overflow))) {
    buf.append("String_Node_Str");
    buf.append(overflow != null ? overflow : CSSConstants.CSS_OVERFLOW_HIDDEN_VALUE);
    buf.append("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * build overflow style which displays the vertical or horizontal scrollbar automatically if content inside the div tag exceed the limit in any aspect.
 * @param buf - the buffer to build the overflow style
 * @param style - the style of current report item
 * @param outputHidden - whether to output the overflow property with hidden value
 */
public static void buildOverflowStyle(StringBuffer buf,IStyle style,boolean outputHidden){
  if (style != null) {
    String overflow=style.getOverflow();
    if (outputHidden || (overflow != null && !CSSConstants.CSS_OVERFLOW_HIDDEN_VALUE.equals(overflow))) {
      buf.append("String_Node_Str");
      buf.append(overflow != null ? overflow : CSSConstants.CSS_OVERFLOW_HIDDEN_VALUE);
      buf.append("String_Node_Str");
    }
  }
}
Program: 67340
Project: 67340
Buggy source:
private void setDuplex(String duplex){
  if (duplex != null && !"String_Node_Str".equalsIgnoreCase(duplex)) {
    String duplexValue=duplex;
    String tumbleValue="String_Node_Str";
    if ("String_Node_Str".equalsIgnoreCase(duplex)) {
      duplexValue="String_Node_Str";
    }
 else     if ("String_Node_Str".equalsIgnoreCase(duplex)) {
      duplexValue="String_Node_Str";
      duplexValue="String_Node_Str";
    }
    out.println("String_Node_Str" + duplexValue);
    out.println("String_Node_Str" + tumbleValue + "String_Node_Str");
    out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
private void setDuplex(String duplex){
  if (duplex != null && !"String_Node_Str".equalsIgnoreCase(duplex)) {
    String duplexValue=duplex;
    String tumbleValue="String_Node_Str";
    if ("String_Node_Str".equalsIgnoreCase(duplex)) {
      duplexValue="String_Node_Str";
    }
 else     if ("String_Node_Str".equalsIgnoreCase(duplex)) {
      duplexValue="String_Node_Str";
      tumbleValue="String_Node_Str";
    }
    out.println("String_Node_Str" + duplexValue);
    out.println("String_Node_Str" + tumbleValue + "String_Node_Str");
    out.println("String_Node_Str");
  }
}
Program: 67341
Project: 67341
Buggy source:
public void addEntry(String sText,int iColumn) throws IllegalArgumentException {
  if (iColumn > cells.length) {
    throw new IllegalArgumentException(Messages.getString("String_Node_Str",new Object[]{String.valueOf(iColumn),String.valueOf(cells.length)}));
  }
  cells[iColumn].add(sText);
  if (cells[iColumn].size() > iMaxRowIndex) {
    iMaxRowIndex=cells[iColumn].size();
    updateScrollbars();
  }
}

Fixed version (ground truth):
public void addEntry(String sText,int iColumn) throws IllegalArgumentException {
  if (iColumn > cells.length) {
    throw new IllegalArgumentException(Messages.getString("String_Node_Str",new Object[]{String.valueOf(iColumn),String.valueOf(cells.length)}));
  }
  if (sText != null && sText.indexOf('\n') > -1) {
    sText=sText.replaceAll("String_Node_Str","String_Node_Str");
  }
  cells[iColumn].add(sText);
  if (cells[iColumn].size() > iMaxRowIndex) {
    iMaxRowIndex=cells[iColumn].size();
    updateScrollbars();
  }
}
Program: 67342
Project: 67342
Buggy source:
public void startPage(float pageWidth,float pageHeight){
  this.pageHeight=pageHeight;
  out.println("String_Node_Str" + pageIndex + "String_Node_Str"+ pageIndex);
  out.println("String_Node_Str" + (int)Math.round(pageWidth) + "String_Node_Str"+ (int)Math.round(pageHeight));
  out.println("String_Node_Str");
  ++pageIndex;
}

Fixed version (ground truth):
public void startPage(float pageWidth,float pageHeight,String orientation){
  this.orientation=orientation;
  this.pageHeight=pageHeight;
  out.println("String_Node_Str" + pageIndex + "String_Node_Str"+ pageIndex);
  out.println("String_Node_Str" + (int)Math.round(pageWidth) + "String_Node_Str"+ (int)Math.round(pageHeight));
  out.println("String_Node_Str");
  if (orientation != null && orientation.equalsIgnoreCase("String_Node_Str")) {
    gSave();
    out.println("String_Node_Str");
    out.println("String_Node_Str");
    out.print("String_Node_Str");
    out.println(pageHeight + "String_Node_Str");
  }
  setScale((int)pageHeight,scale);
  ++pageIndex;
}
Program: 67343
Project: 67343
Buggy source:
public void endPage(){
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}

Fixed version (ground truth):
public void endPage(){
  if (orientation != null && orientation.equalsIgnoreCase("String_Node_Str")) {
    gRestore();
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}
Program: 67344
Project: 67344
Buggy source:
public void startRenderer(String author,String description,String paperSize,int paperTrayCode,String duplex,int copies,boolean collate,String resolution,boolean color,int scale) throws IOException {
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  int[] pageSize=getPaperSize(paperSize);
  int width=pageSize[0];
  int height=pageSize[1];
  setPaperSize(paperSize,width,height);
  setPaperTray(paperTrayCode);
  setDuplex(duplex);
  setResolution(resolution);
  setGray(color);
  FileUtil.load("String_Node_Str",out);
  setScale(height,scale);
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}

Fixed version (ground truth):
public void startRenderer(String author,String description,String paperSize,int paperTrayCode,String duplex,int copies,boolean collate,String resolution,boolean color,int scale) throws IOException {
  this.scale=scale;
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  int[] pageSize=getPaperSize(paperSize);
  int width=pageSize[0];
  int height=pageSize[1];
  setPaperSize(paperSize,width,height);
  setPaperTray(paperTrayCode);
  setDuplex(duplex);
  setResolution(resolution);
  setGray(color);
  FileUtil.load("String_Node_Str",out);
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}
Program: 67345
Project: 67345
Buggy source:
public PostscriptPage(int pageWidth,int pageHeight,Color color,PostscriptWriter writer){
  super(pageWidth,pageHeight);
  writer.startPage(this.pageWidth,this.pageHeight);
  writer.fillPage(color);
  this.writer=writer;
  this.isDisposed=false;
}

Fixed version (ground truth):
public PostscriptPage(int pageWidth,int pageHeight,Color color,PostscriptWriter writer,String orientation){
  super(pageWidth,pageHeight);
  writer.startPage(this.pageWidth,this.pageHeight,orientation);
  writer.fillPage(color);
  this.writer=writer;
  this.isDisposed=false;
}
Program: 67346
Project: 67346
Buggy source:
public IPage newPage(int width,int height,Color backgroundColor){
  if (currentPage != null) {
    currentPage.dispose();
  }
  currentPage=new PostscriptPage(width,height,backgroundColor,writer);
  return currentPage;
}

Fixed version (ground truth):
public IPage newPage(int width,int height,Color backgroundColor){
  if (currentPage != null) {
    currentPage.dispose();
  }
  currentPage=new PostscriptPage(width,height,backgroundColor,writer,orientation);
  return currentPage;
}
Program: 67347
Project: 67347
Buggy source:
protected void setUp() throws Exception {
  super.setUp();
  cells[0]=new CellArea(10,10,40,40);
  cells[1]=new CellArea(50,10,40,40);
  cells[2]=new CellArea(90,10,40,40);
  cells[2].defineBorder(BorderInfo.RIGHT_BORDER,6);
  cells[2].defineBorder(BorderInfo.RIGHT_BORDER,Color.orange);
  cells[3]=new CellArea(10,50,40,80);
  cells[3].defineBorder(BorderInfo.BOTTOM_BORDER,6);
  cells[3].defineBorder(BorderInfo.BOTTOM_BORDER,Color.blue);
  cells[4]=new CellArea(50,50,40,40);
  cells[5]=new CellArea(90,50,40,40);
  cells[5].defineBorder(BorderInfo.RIGHT_BORDER,6);
  cells[5].defineBorder(BorderInfo.RIGHT_BORDER,Color.orange);
  cells[6]=null;
  cells[7]=new CellArea(50,90,40,40);
  cells[7].defineBorder(BorderInfo.BOTTOM_BORDER,4);
  cells[7].defineBorder(BorderInfo.BOTTOM_BORDER,Color.blue);
  cells[8]=new CellArea(90,90,40,40);
  cells[8].defineBorder(BorderInfo.BOTTOM_BORDER,2);
  cells[8].defineBorder(BorderInfo.BOTTOM_BORDER,Color.blue);
  cells[8].defineBorder(BorderInfo.RIGHT_BORDER,6);
  cells[8].defineBorder(BorderInfo.RIGHT_BORDER,Color.orange);
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(new FileOutputStream("String_Node_Str"));
  writer=new PostscriptWriter(bufferedOutputStream,"String_Node_Str");
  writer.startRenderer();
  writer.startPage(pageWidth,pageHeight);
  testBorderDraw();
  writer.endPage();
  writer.stopRenderer();
}

Fixed version (ground truth):
protected void setUp() throws Exception {
  super.setUp();
  cells[0]=new CellArea(10,10,40,40);
  cells[1]=new CellArea(50,10,40,40);
  cells[2]=new CellArea(90,10,40,40);
  cells[2].defineBorder(BorderInfo.RIGHT_BORDER,6);
  cells[2].defineBorder(BorderInfo.RIGHT_BORDER,Color.orange);
  cells[3]=new CellArea(10,50,40,80);
  cells[3].defineBorder(BorderInfo.BOTTOM_BORDER,6);
  cells[3].defineBorder(BorderInfo.BOTTOM_BORDER,Color.blue);
  cells[4]=new CellArea(50,50,40,40);
  cells[5]=new CellArea(90,50,40,40);
  cells[5].defineBorder(BorderInfo.RIGHT_BORDER,6);
  cells[5].defineBorder(BorderInfo.RIGHT_BORDER,Color.orange);
  cells[6]=null;
  cells[7]=new CellArea(50,90,40,40);
  cells[7].defineBorder(BorderInfo.BOTTOM_BORDER,4);
  cells[7].defineBorder(BorderInfo.BOTTOM_BORDER,Color.blue);
  cells[8]=new CellArea(90,90,40,40);
  cells[8].defineBorder(BorderInfo.BOTTOM_BORDER,2);
  cells[8].defineBorder(BorderInfo.BOTTOM_BORDER,Color.blue);
  cells[8].defineBorder(BorderInfo.RIGHT_BORDER,6);
  cells[8].defineBorder(BorderInfo.RIGHT_BORDER,Color.orange);
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(new FileOutputStream("String_Node_Str"));
  writer=new PostscriptWriter(bufferedOutputStream,"String_Node_Str");
  writer.startRenderer();
  writer.startPage(pageWidth,pageHeight,"String_Node_Str");
  testBorderDraw();
  writer.endPage();
  writer.stopRenderer();
}
Program: 67351
Project: 67351
Buggy source:
private int[] getPaperSize(String paperSize){
  int width=595;
  int height=842;
  if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=612;
    height=792;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=612;
    height=1008;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=419;
    height=595;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=595;
    height=842;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=842;
    height=1191;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=499;
    height=709;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=729;
    height=1032;
  }
  return new int[]{width,height};
}

Fixed version (ground truth):
private int[] getPaperSize(String paperSize){
  if (paperSize == null || paperSize.trim().length() == 0)   return null;
  int width=595;
  int height=842;
  if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=612;
    height=792;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=612;
    height=1008;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=419;
    height=595;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=595;
    height=842;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=842;
    height=1191;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=499;
    height=709;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=729;
    height=1032;
  }
  return new int[]{width,height};
}
Program: 67352
Project: 67352
Buggy source:
public void startRenderer(String author,String description,String paperSize,int paperTrayCode,String duplex,int copies,boolean collate,String resolution,boolean color,int scale) throws IOException {
  this.scale=scale;
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  int[] pageSize=getPaperSize(paperSize);
  int width=pageSize[0];
  int height=pageSize[1];
  setPaperSize(paperSize,width,height);
  setPaperTray(paperTrayCode);
  setDuplex(duplex);
  setResolution(resolution);
  setGray(color);
  FileUtil.load("String_Node_Str",out);
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}

Fixed version (ground truth):
public void startRenderer(String author,String description,String paperSize,int paperTrayCode,String duplex,int copies,boolean collate,String resolution,boolean color,int scale) throws IOException {
  this.scale=scale;
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  int[] pageSize=getPaperSize(paperSize);
  if (pageSize != null) {
    int width=pageSize[0];
    int height=pageSize[1];
    setPaperSize(paperSize,width,height);
  }
  setPaperTray(paperTrayCode);
  setDuplex(duplex);
  setResolution(resolution);
  setGray(color);
  FileUtil.load("String_Node_Str",out);
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}
Program: 67353
Project: 67353
Buggy source:
/** 
 * Returns an iterator over the values in a list property, or <code>null</code> if the property is not a list property. The iterator returns a <code>StructureHandle</code> for each entry in the list. For highlight rules, the iterator returns a list of <code>HighlightRuleHandle</code>s.
 * @return An iterator over the values in a list property.
 * @see StructureHandle
 * @see StructureIterator
 */
public Iterator iterator(){
  if (isList()) {
    return new StructureIterator(this);
  }
 else   if (getTypeCode() == IPropertyType.LIST_TYPE) {
    return new SimpleIterator(this);
  }
  return Collections.EMPTY_LIST.iterator();
}

Fixed version (ground truth):
/** 
 * Returns an iterator over the values in a list property, or <code>null</code> if the property is not a list property. The iterator returns a <code>StructureHandle</code> for each entry in the list. For highlight rules, the iterator returns a list of <code>HighlightRuleHandle</code>s.
 * @return An iterator over the values in a list property.
 * @see StructureHandle
 * @see StructureIterator
 */
public Iterator iterator(){
  if (isList()) {
    return new StructureIterator(this);
  }
  int typeCode=getTypeCode();
  if (typeCode == IPropertyType.LIST_TYPE || (typeCode == IPropertyType.CONTENT_ELEMENT_TYPE && getDefn().isList())) {
    return new SimpleIterator(this);
  }
  return Collections.EMPTY_LIST.iterator();
}
Program: 67355
Project: 67355
Buggy source:
/** 
 * Populate the aggregation references, return whether the aggregation should  be calculated on OVERALL level, which is indicated by reference to "dataSetRow" java script object.
 * @param aggrReferences
 * @param expr
 * @param aggrMap
 * @return
 * @throws DataException
 */
private boolean popAggrRefFromScriptExpr(Set aggrReferences,IScriptExpression expr,Map aggrMap) throws DataException {
  try {
    List usedRowReferences=ExpressionUtil.extractColumnExpressions(expr.getText());
    boolean result=this.hasDataSetRowReference(expr);
    for (int i=0; i < usedRowReferences.size(); i++) {
      Object o=aggrMap.get(((IColumnBinding)usedRowReferences.get(i)).getResultSetColumnName());
      if (o != null) {
        aggrReferences.add(o);
      }
 else {
        result=result || popAggrRefFromBaseExpr(aggrReferences,this.getBinding(((IColumnBinding)usedRowReferences.get(i)).getResultSetColumnName()).getExpression(),aggrMap);
      }
    }
    return result;
  }
 catch (  BirtException be) {
    throw DataException.wrap(be);
  }
}

Fixed version (ground truth):
/** 
 * Populate the aggregation references, return whether the aggregation should  be calculated on OVERALL level, which is indicated by reference to "dataSetRow" java script object.
 * @param aggrReferences
 * @param expr
 * @param aggrMap
 * @return
 * @throws DataException
 */
private boolean popAggrRefFromScriptExpr(Set aggrReferences,IScriptExpression expr,Map aggrMap) throws DataException {
  try {
    List usedRowReferences=ExpressionUtil.extractColumnExpressions(expr.getText());
    boolean result=this.hasDataSetRowReference(expr);
    for (int i=0; i < usedRowReferences.size(); i++) {
      Object o=aggrMap.get(((IColumnBinding)usedRowReferences.get(i)).getResultSetColumnName());
      if (o != null) {
        aggrReferences.add(o);
      }
 else {
        if (this.getBinding(((IColumnBinding)usedRowReferences.get(i)).getResultSetColumnName()) == null) {
          return false;
        }
        result=result || popAggrRefFromBaseExpr(aggrReferences,this.getBinding(((IColumnBinding)usedRowReferences.get(i)).getResultSetColumnName()).getExpression(),aggrMap);
      }
    }
    return result;
  }
 catch (  BirtException be) {
    throw DataException.wrap(be);
  }
}
Program: 67357
Project: 67357
Buggy source:
public void addSimpleLevelFilter(SimpleLevelFilter simpleLevelFilter){
  simpleLevelFilters.add(simpleLevelFilter);
}

Fixed version (ground truth):
public void addSimpleLevelFilter(List<SimpleLevelFilter> simpleLevelFilter){
  simpleLevelFilters.addAll(simpleLevelFilter);
}
Program: 67358
Project: 67358
Buggy source:
/** 
 * @param aggregations
 * @param stopSign
 * @return
 * @throws IOException
 * @throws BirtException
 */
private IAggregationResultSet executeDimensionTableQuery(AggregationDefinition aggregations,StopSign stopSign) throws IOException, BirtException {
  DimLevel[] levels=aggregations.getLevels();
  String dimensionName=levels[0].getDimensionName();
  IDimension[] dimensions=cube.getDimesions();
  Dimension sourceDimension=null;
  for (int i=0; i < dimensions.length; i++) {
    if (dimensionName.equals(dimensions[i].getName())) {
      sourceDimension=(Dimension)dimensions[i];
      break;
    }
  }
  IDiskArray dimensionrow=getFiltedDistinctDiemensionRow(sourceDimension,levels,aggregations.getSortTypes(),stopSign);
  IAggregationResultSet resultSet=new AggregationResultSet(aggregations,dimensionrow,getKeyColumnName(aggregations),null);
  return resultSet;
}

Fixed version (ground truth):
/** 
 * @param aggregations
 * @param stopSign
 * @return
 * @throws IOException
 * @throws BirtException
 */
private IAggregationResultSet executeDimensionTableQuery(AggregationDefinition aggregations,StopSign stopSign) throws IOException, BirtException {
  DimLevel[] levels=aggregations.getLevels();
  String dimensionName=levels[0].getDimensionName();
  IDimension[] dimensions=cube.getDimesions();
  Dimension sourceDimension=null;
  for (int i=0; i < dimensions.length; i++) {
    if (dimensionName.equals(dimensions[i].getName())) {
      sourceDimension=(Dimension)dimensions[i];
      break;
    }
  }
  IDiskArray dimensionrow=getFiltedDistinctDiemensionRow(sourceDimension,levels,aggregations.getSortTypes(),stopSign);
  IAggregationResultSet resultSet=new AggregationResultSet(aggregations,dimensionrow,getKeyColumnName(aggregations),getAttributeColumnName(aggregations,sourceDimension));
  return resultSet;
}
Program: 67359
Project: 67359
Buggy source:
public void setEnableMultipleSheet(boolean enableMultipleSheet){
  setOption(OPTION_ENABLE_MULTIPLE_SHEET,enableMultipleSheet);
}

Fixed version (ground truth):
public void setEnableMultipleSheet(boolean enableMultipleSheet){
  setOption(OPTION_MULTIPLE_SHEET,enableMultipleSheet);
}
Program: 67360
Project: 67360
Buggy source:
public boolean isEnableMultipleSheet(){
  return getBooleanOption(OPTION_ENABLE_MULTIPLE_SHEET,false);
}

Fixed version (ground truth):
public boolean isEnableMultipleSheet(){
  return getBooleanOption(OPTION_MULTIPLE_SHEET,false);
}
Program: 67362
Project: 67362
Buggy source:
public void close() throws DataException {
  try {
    List<T> keyList=new LinkedList<T>();
    keyList.addAll(this.numberAndIndex.keySet());
    if (keyList.size() == 0) {
      output.close();
      return;
    }
    Collections.sort(keyList,new NumberComparator<T>());
    int segs=(keyList.size() - 1) / BLOCKNUMBER + 1;
    IOUtil.writeInt(output,segs);
    long intOffset=output.getOffset();
    DataOutputStream dout=new DataOutputStream(output);
    long[] offsets=new long[segs];
    Object[] boundaryValues=new Object[segs];
    for (int i=0; i < segs; i++) {
      IOUtil.writeLong(dout,0);
      boundaryValues[i]=keyList.get(i * BLOCKNUMBER);
    }
    for (int i=0; i < boundaryValues.length; i++) {
      IOUtil.writeObject(dout,boundaryValues[i]);
    }
    for (int i=0; i < segs; i++) {
      offsets[i]=output.getOffset();
      IOUtil.writeInt(dout,i == segs - 1 ? keyList.size() % BLOCKNUMBER : BLOCKNUMBER);
      for (int j=i * BLOCKNUMBER; j < (i + 1) * BLOCKNUMBER && j < keyList.size(); j++) {
        IOUtil.writeObject(dout,keyList.get(j));
        IOUtil.writeList(dout,numberAndIndex.get(keyList.get(j)));
      }
    }
    output.seek(intOffset);
    for (int i=0; i < offsets.length; i++) {
      IOUtil.writeLong(dout,offsets[i]);
    }
    output.close();
  }
 catch (  Exception e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
public void close() throws DataException {
  try {
    List<T> keyList=new LinkedList<T>();
    keyList.addAll(this.numberAndIndex.keySet());
    if (keyList.size() == 0) {
      IOUtil.writeInt(output,0);
      output.close();
      return;
    }
    Collections.sort(keyList,new NumberComparator<T>());
    int segs=(keyList.size() - 1) / BLOCKNUMBER + 1;
    IOUtil.writeInt(output,segs);
    long intOffset=output.getOffset();
    DataOutputStream dout=new DataOutputStream(output);
    long[] offsets=new long[segs];
    Object[] boundaryValues=new Object[segs];
    for (int i=0; i < segs; i++) {
      IOUtil.writeLong(dout,0);
      boundaryValues[i]=keyList.get(i * BLOCKNUMBER);
    }
    for (int i=0; i < boundaryValues.length; i++) {
      IOUtil.writeObject(dout,boundaryValues[i]);
    }
    for (int i=0; i < segs; i++) {
      offsets[i]=output.getOffset();
      IOUtil.writeInt(dout,i == segs - 1 ? keyList.size() % BLOCKNUMBER : BLOCKNUMBER);
      for (int j=i * BLOCKNUMBER; j < (i + 1) * BLOCKNUMBER && j < keyList.size(); j++) {
        IOUtil.writeObject(dout,keyList.get(j));
        IOUtil.writeList(dout,numberAndIndex.get(keyList.get(j)));
      }
    }
    output.seek(intOffset);
    for (int i=0; i < offsets.length; i++) {
      IOUtil.writeLong(dout,offsets[i]);
    }
    output.close();
  }
 catch (  Exception e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
}
Program: 67364
Project: 67364
Buggy source:
private final LevelHandle findLevelHandle(CubeHandle cube,ExpressionCodec exprCodec,Query query){
  if (query != null && query.isDefined() && exprCodec.isCubeBinding(query.getDefinition(),true)) {
    String bindingName=exprCodec.getBindingName();
    Iterator<ComputedColumnHandle> bindings=ChartItemUtil.getAllColumnBindingsIterator((ReportItemHandle)handle);
    while (bindings.hasNext()) {
      ComputedColumnHandle cc=bindings.next();
      if (cc.getName().equals(bindingName)) {
        String expr=cc.getExpression();
        if (ChartExpressionUtil.isDimensionExpresion(expr)) {
          String[] levels=ChartExpressionUtil.getLevelNameFromDimensionExpression(expr);
          return cube.getDimension(levels[0]).getDefaultHierarchy().getLevel(levels[1]);
        }
        break;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private final LevelHandle findLevelHandle(CubeHandle cube,ExpressionCodec exprCodec,Query query){
  if (query != null && query.isDefined() && exprCodec.isCubeBinding(query.getDefinition(),true)) {
    String bindingName=exprCodec.getBindingName();
    Iterator<ComputedColumnHandle> bindings=ChartItemUtil.getAllColumnBindingsIterator((ReportItemHandle)handle);
    while (bindings.hasNext()) {
      ComputedColumnHandle cc=bindings.next();
      if (cc.getName().equals(bindingName)) {
        String expr=cc.getExpression();
        if (ChartExpressionUtil.isDimensionExpresion(expr)) {
          String[] levels=ChartExpressionUtil.getLevelNameFromDimensionExpression(expr);
          if (cube.getDimension(levels[0]) != null) {
            return cube.getDimension(levels[0]).getDefaultHierarchy().getLevel(levels[1]);
          }
        }
        break;
      }
    }
  }
  return null;
}
Program: 67366
Project: 67366
Buggy source:
protected void initializeContentEmitter(IContentEmitter emitter,IReportExecutor executor) throws BirtException {
  HashMap configs=engine.getConfig().getEmitterConfigs();
  IReportContext reportContext=executionContext.getReportContext();
  IRenderOption options=executionContext.getRenderOption();
  EngineEmitterServices services=new EngineEmitterServices(reportContext,options,configs);
  emitter.initialize(services);
}

Fixed version (ground truth):
protected void initializeContentEmitter(IContentEmitter emitter) throws BirtException {
  HashMap configs=engine.getConfig().getEmitterConfigs();
  IReportContext reportContext=executionContext.getReportContext();
  IRenderOption options=executionContext.getRenderOption();
  EngineEmitterServices services=new EngineEmitterServices(reportContext,options,configs);
  emitter.initialize(services);
}