nus-yam/ex-repair huggingface dataset:
Program: 71153
Project: 71153
Buggy source:
/** 
 * Initializes the pdfEmitter.
 * @param services the emitter svervices object.
 */
private void initialize(IEmitterServices services){
  this.services=services;
  reportRunnable=services.getReportRunnable();
  if (reportRunnable != null) {
    reportDesign=(ReportDesignHandle)reportRunnable.getDesignHandle();
  }
  this.context=services.getReportContext();
  this.output=EmitterUtil.getOuputStream(services,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Initializes the pdfEmitter.
 * @param services the emitter svervices object.
 * @throws EngineException 
 */
private void initialize(IEmitterServices services) throws EngineException {
  this.services=services;
  reportRunnable=services.getReportRunnable();
  if (reportRunnable != null) {
    reportDesign=(ReportDesignHandle)reportRunnable.getDesignHandle();
  }
  this.context=services.getReportContext();
  this.output=EmitterUtil.getOuputStream(services,"String_Node_Str");
}
Program: 71154
Project: 71154
Buggy source:
public PDFRender(IEmitterServices services){
  initialize(services);
}

Fixed version (ground truth):
public PDFRender(IEmitterServices services) throws EngineException {
  initialize(services);
}
Program: 71155
Project: 71155
Buggy source:
public PageDeviceRender createRender(IEmitterServices services){
  return new PostscriptRender(services);
}

Fixed version (ground truth):
public PageDeviceRender createRender(IEmitterServices services) throws EngineException {
  return new PostscriptRender(services);
}
Program: 71156
Project: 71156
Buggy source:
public PostscriptRender(IEmitterServices services){
  initialize(services);
}

Fixed version (ground truth):
public PostscriptRender(IEmitterServices services) throws EngineException {
  initialize(services);
}
Program: 71157
Project: 71157
Buggy source:
/** 
 * Initializes the pdfEmitter.
 * @param services the emitter svervices object.
 */
private void initialize(IEmitterServices services){
  this.services=services;
  IReportRunnable reportRunnable=services.getReportRunnable();
  if (reportRunnable != null) {
    reportDesign=(ReportDesignHandle)reportRunnable.getDesignHandle();
  }
  this.context=services.getReportContext();
  this.output=EmitterUtil.getOuputStream(services,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Initializes the pdfEmitter.
 * @param services the emitter svervices object.
 * @throws EngineException 
 */
private void initialize(IEmitterServices services) throws EngineException {
  this.services=services;
  IReportRunnable reportRunnable=services.getReportRunnable();
  if (reportRunnable != null) {
    reportDesign=(ReportDesignHandle)reportRunnable.getDesignHandle();
  }
  this.context=services.getReportContext();
  this.output=EmitterUtil.getOuputStream(services,"String_Node_Str");
}
Program: 71158
Project: 71158
Buggy source:
public PageDeviceRender createRender(IEmitterServices service){
  return new PPTRender(service);
}

Fixed version (ground truth):
public PageDeviceRender createRender(IEmitterServices service) throws EngineException {
  return new PPTRender(service);
}
Program: 71159
Project: 71159
Buggy source:
public PPTRender(IEmitterServices services){
  initialize(services);
}

Fixed version (ground truth):
public PPTRender(IEmitterServices services) throws EngineException {
  initialize(services);
}
Program: 71160
Project: 71160
Buggy source:
/** 
 * Initializes the PPTEmitter.
 * @param services the emitter services object.
 */
public void initialize(IEmitterServices services){
  this.services=services;
  IReportRunnable reportRunnable=services.getReportRunnable();
  if (reportRunnable != null) {
    reportDesign=(ReportDesignHandle)reportRunnable.getDesignHandle();
  }
  this.context=services.getReportContext();
  this.pptOutput=EmitterUtil.getOuputStream(services,REPORT_FILE);
}

Fixed version (ground truth):
/** 
 * Initializes the PPTEmitter.
 * @param services the emitter services object.
 * @throws EngineException 
 */
public void initialize(IEmitterServices services) throws EngineException {
  this.services=services;
  IReportRunnable reportRunnable=services.getReportRunnable();
  if (reportRunnable != null) {
    reportDesign=(ReportDesignHandle)reportRunnable.getDesignHandle();
  }
  this.context=services.getReportContext();
  this.pptOutput=EmitterUtil.getOuputStream(services,REPORT_FILE);
}
Program: 71161
Project: 71161
Buggy source:
public void startPage(IPageContent page){
  if (orientation == null) {
    orientation=capitalize(page.getOrientation());
  }
  if (needOutputInMasterPage(page.getPageHeader()) && needOutputInMasterPage(page.getPageFooter())) {
    outputInMasterPage=true;
    pageHeader=formatHeaderFooter(page.getPageHeader(),true);
    pageFooter=formatHeaderFooter(page.getPageFooter(),false);
  }
  if (!outputInMasterPage && page.getPageHeader() != null) {
    contentVisitor.visitChildren(page.getPageHeader(),null);
  }
}

Fixed version (ground truth):
public void startPage(IPageContent page) throws BirtException {
  if (orientation == null) {
    orientation=capitalize(page.getOrientation());
  }
  if (needOutputInMasterPage(page.getPageHeader()) && needOutputInMasterPage(page.getPageFooter())) {
    outputInMasterPage=true;
    pageHeader=formatHeaderFooter(page.getPageHeader(),true);
    pageFooter=formatHeaderFooter(page.getPageFooter(),false);
  }
  if (!outputInMasterPage && page.getPageHeader() != null) {
    contentVisitor.visitChildren(page.getPageHeader(),null);
  }
}
Program: 71162
Project: 71162
Buggy source:
public void startForeign(IForeignContent foreign){
  if (IForeignContent.HTML_TYPE.equalsIgnoreCase(foreign.getRawType())) {
    HTML2Content.html2Content(foreign);
    HyperlinkDef link=parseHyperLink(foreign);
    engine.addContainer(foreign.getComputedStyle(),link);
    contentVisitor.visitChildren(foreign,null);
    engine.endContainer();
  }
}

Fixed version (ground truth):
public void startForeign(IForeignContent foreign) throws BirtException {
  if (IForeignContent.HTML_TYPE.equalsIgnoreCase(foreign.getRawType())) {
    HTML2Content.html2Content(foreign);
    HyperlinkDef link=parseHyperLink(foreign);
    engine.addContainer(foreign.getComputedStyle(),link);
    contentVisitor.visitChildren(foreign,null);
    engine.endContainer();
  }
}
Program: 71163
Project: 71163
Buggy source:
public void initialize(IEmitterServices service){
  this.service=service;
  if (service != null) {
    this.out=EmitterUtil.getOuputStream(service,"String_Node_Str" + getOutputFormat());
  }
  context.setTempFileDir(service.getReportEngine().getConfig().getTempDir());
  IReportContext reportContext=service.getReportContext();
  if (reportContext != null) {
    Locale locale=reportContext.getLocale();
    if (locale != null)     context.setLocale(ULocale.forLocale(locale));
  }
}

Fixed version (ground truth):
public void initialize(IEmitterServices service) throws EngineException {
  this.service=service;
  if (service != null) {
    this.out=EmitterUtil.getOuputStream(service,"String_Node_Str" + getOutputFormat());
  }
  context.setTempFileDir(service.getReportEngine().getConfig().getTempDir());
  IReportContext reportContext=service.getReportContext();
  if (reportContext != null) {
    Locale locale=reportContext.getLocale();
    if (locale != null)     context.setLocale(ULocale.forLocale(locale));
  }
}
Program: 71164
Project: 71164
Buggy source:
public void endPage(IPageContent page){
  if (!outputInMasterPage && page.getPageFooter() != null) {
    contentVisitor.visitChildren(page.getPageFooter(),null);
  }
}

Fixed version (ground truth):
public void endPage(IPageContent page) throws BirtException {
  if (!outputInMasterPage && page.getPageFooter() != null) {
    contentVisitor.visitChildren(page.getPageFooter(),null);
  }
}
Program: 71165
Project: 71165
Buggy source:
public void startPage(IPageContent page) throws IOException {
  if (previousPage != null) {
    outputPrePageProperties();
    previousPage=page;
    context.resetWidth();
  }
 else {
    previousPage=page;
    boolean isRtl=false;
    String creator=null;
    String title=null;
    String description=null;
    if (reportContent != null) {
      ReportDesignHandle designHandle=reportContent.getDesign().getReportDesign();
      creator=designHandle.getAuthor();
      title=designHandle.getStringProperty(IModuleModel.TITLE_PROP);
      description=designHandle.getDescription();
      IContent rootContent=reportContent.getRoot();
      isRtl=rootContent != null && rootContent.isRTL();
    }
    wordWriter.start(isRtl,creator,title,description);
    drawDocumentBackground();
  }
  computePageProperties(page);
  context.addWidth(contentWidth);
  wordWriter.startPage();
}

Fixed version (ground truth):
public void startPage(IPageContent page) throws IOException, BirtException {
  if (previousPage != null) {
    outputPrePageProperties();
    previousPage=page;
    context.resetWidth();
  }
 else {
    previousPage=page;
    boolean isRtl=false;
    String creator=null;
    String title=null;
    String description=null;
    if (reportContent != null) {
      ReportDesignHandle designHandle=reportContent.getDesign().getReportDesign();
      creator=designHandle.getAuthor();
      title=designHandle.getStringProperty(IModuleModel.TITLE_PROP);
      description=designHandle.getDescription();
      IContent rootContent=reportContent.getRoot();
      isRtl=rootContent != null && rootContent.isRTL();
    }
    wordWriter.start(isRtl,creator,title,description);
    drawDocumentBackground();
  }
  computePageProperties(page);
  context.addWidth(contentWidth);
  wordWriter.startPage();
}
Program: 71166
Project: 71166
Buggy source:
protected void writeSectionInP() throws IOException {
  wordWriter.startSectionInParagraph();
  writeHeaderFooter();
  wordWriter.writePageProperties(pageHeight,pageWidth,headerHeight,footerHeight,topMargin,bottomMargin,leftMargin,rightMargin,orientation);
  wordWriter.endSectionInParagraph();
}

Fixed version (ground truth):
protected void writeSectionInP() throws IOException, BirtException {
  wordWriter.startSectionInParagraph();
  writeHeaderFooter();
  wordWriter.writePageProperties(pageHeight,pageWidth,headerHeight,footerHeight,topMargin,bottomMargin,leftMargin,rightMargin,orientation);
  wordWriter.endSectionInParagraph();
}
Program: 71167
Project: 71167
Buggy source:
public abstract void startForeign(IForeignContent foreign);

Fixed version (ground truth):
public abstract void startForeign(IForeignContent foreign) throws BirtException ;
Program: 71168
Project: 71168
Buggy source:
private void outputPrePageProperties() throws IOException {
  adjustInline();
  writeSectionInP();
  wordWriter.endPage();
}

Fixed version (ground truth):
private void outputPrePageProperties() throws IOException, BirtException {
  adjustInline();
  writeSectionInP();
  wordWriter.endPage();
}
Program: 71169
Project: 71169
Buggy source:
public void end(IReportContent report) throws IOException {
  adjustInline();
  writeSectionInBody();
  wordWriter.endPage();
  wordWriter.end();
}

Fixed version (ground truth):
public void end(IReportContent report) throws IOException, BirtException {
  adjustInline();
  writeSectionInBody();
  wordWriter.endPage();
  wordWriter.end();
}
Program: 71170
Project: 71170
Buggy source:
protected void writeSectionInBody() throws IOException {
  wordWriter.startSection();
  writeHeaderFooter();
  wordWriter.writePageProperties(pageHeight,pageWidth,headerHeight,footerHeight,topMargin,bottomMargin,leftMargin,rightMargin,orientation);
  wordWriter.endSection();
}

Fixed version (ground truth):
protected void writeSectionInBody() throws IOException, BirtException {
  wordWriter.startSection();
  writeHeaderFooter();
  wordWriter.writePageProperties(pageHeight,pageWidth,headerHeight,footerHeight,topMargin,bottomMargin,leftMargin,rightMargin,orientation);
  wordWriter.endSection();
}
Program: 71171
Project: 71171
Buggy source:
public void initialize(IEmitterServices service){
  if (service != null) {
    this.out=EmitterUtil.getOuputStream(service,"String_Node_Str" + getOutputFormat());
    this.reportRunnable=service.getReportRunnable();
    this.actionHandler=(IHTMLActionHandler)service.getOption(RenderOption.ACTION_HANDLER);
    reportContext=service.getReportContext();
    ULocale locale=null;
    if (reportContext != null) {
      locale=ULocale.forLocale(reportContext.getLocale());
    }
    if (locale == null) {
      locale=ULocale.getDefault();
    }
    EngineResourceHandle resourceHandle=new EngineResourceHandle(locale);
    messageFlashObjectNotSupported=resourceHandle.getMessage(MessageConstants.FLASH_OBJECT_NOT_SUPPORTED_PROMPT);
  }
  context=new EmitterContext();
}

Fixed version (ground truth):
public void initialize(IEmitterServices service) throws EngineException {
  if (service != null) {
    this.out=EmitterUtil.getOuputStream(service,"String_Node_Str" + getOutputFormat());
    this.reportRunnable=service.getReportRunnable();
    this.actionHandler=(IHTMLActionHandler)service.getOption(RenderOption.ACTION_HANDLER);
    reportContext=service.getReportContext();
    ULocale locale=null;
    if (reportContext != null) {
      locale=ULocale.forLocale(reportContext.getLocale());
    }
    if (locale == null) {
      locale=ULocale.getDefault();
    }
    EngineResourceHandle resourceHandle=new EngineResourceHandle(locale);
    messageFlashObjectNotSupported=resourceHandle.getMessage(MessageConstants.FLASH_OBJECT_NOT_SUPPORTED_PROMPT);
  }
  context=new EmitterContext();
}
Program: 71172
Project: 71172
Buggy source:
private void writeHeaderFooter() throws IOException {
  if (previousPage.getPageHeader() != null) {
    SimpleMasterPageDesign master=(SimpleMasterPageDesign)previousPage.getGenerateBy();
    wordWriter.startHeader(!master.isShowHeaderOnFirst());
    contentVisitor.visitChildren(previousPage.getPageHeader(),null);
    wordWriter.endHeader();
  }
  if (previousPage.getPageFooter() != null) {
    wordWriter.startFooter();
    contentVisitor.visitChildren(previousPage.getPageFooter(),null);
    wordWriter.endFooter();
  }
}

Fixed version (ground truth):
private void writeHeaderFooter() throws IOException, BirtException {
  if (previousPage.getPageHeader() != null) {
    SimpleMasterPageDesign master=(SimpleMasterPageDesign)previousPage.getGenerateBy();
    wordWriter.startHeader(!master.isShowHeaderOnFirst());
    contentVisitor.visitChildren(previousPage.getPageHeader(),null);
    wordWriter.endHeader();
  }
  if (previousPage.getPageFooter() != null) {
    wordWriter.startFooter();
    contentVisitor.visitChildren(previousPage.getPageFooter(),null);
    wordWriter.endFooter();
  }
}
Program: 71173
Project: 71173
Buggy source:
public void startPage(IPageContent page){
  try {
    emitterImplement.startPage(page);
  }
 catch (  IOException e) {
    logger.log(Level.SEVERE,e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
public void startPage(IPageContent page) throws BirtException {
  try {
    emitterImplement.startPage(page);
  }
 catch (  IOException e) {
    logger.log(Level.SEVERE,e.getLocalizedMessage(),e);
  }
}
Program: 71174
Project: 71174
Buggy source:
public void startForeign(IForeignContent foreign){
  if (isClipped) {
    return;
  }
  emitterImplement.startForeign(foreign);
}

Fixed version (ground truth):
public void startForeign(IForeignContent foreign) throws BirtException {
  if (isClipped) {
    return;
  }
  emitterImplement.startForeign(foreign);
}
Program: 71175
Project: 71175
Buggy source:
public void end(IReportContent report){
  try {
    emitterImplement.end(report);
  }
 catch (  IOException e) {
    logger.log(Level.SEVERE,e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
public void end(IReportContent report) throws BirtException {
  try {
    emitterImplement.end(report);
  }
 catch (  IOException e) {
    logger.log(Level.SEVERE,e.getLocalizedMessage(),e);
  }
}
Program: 71176
Project: 71176
Buggy source:
public void initialize(IEmitterServices service){
  emitterImplement.initialize(service);
}

Fixed version (ground truth):
public void initialize(IEmitterServices service) throws EngineException {
  emitterImplement.initialize(service);
}
Program: 71177
Project: 71177
Buggy source:
protected void updateRtLFlag() throws EngineException {
  if (renderOptions == null)   return;
  IReportRunnable runnable=executionContext.getRunnable();
  if (runnable == null)   return;
  ReportDesignHandle handle=(ReportDesignHandle)runnable.getDesignHandle();
  if (handle != null) {
    Object bidiFlag=renderOptions.getOption(IRenderOption.RTL_FLAG);
    String bidiOrientation=null;
    if (bidiFlag != null) {
      if (Boolean.TRUE.equals(bidiFlag)) {
        bidiOrientation=DesignChoiceConstants.BIDI_DIRECTION_RTL;
      }
 else {
        bidiOrientation=DesignChoiceConstants.BIDI_DIRECTION_LTR;
      }
      try {
        handle.setBidiOrientation(bidiOrientation);
        Report report=executionContext.getReport();
        AbstractStyle rootStyle=(AbstractStyle)report.getStyles().get(report.getRootStyleName());
        if (rootStyle != null) {
          rootStyle.setDirection(bidiOrientation);
        }
      }
 catch (      SemanticException e) {
        log.log(Level.WARNING,"String_Node_Str",e);
        throw new EngineException("String_Node_Str");
      }
    }
 else     if (handle.isDirectionRTL()) {
      renderOptions.setOption(IRenderOption.RTL_FLAG,new Boolean(true));
      IRenderOption renderOptions2=executionContext.getRenderOption();
      if (renderOptions2 != null) {
        renderOptions2.setOption(IRenderOption.RTL_FLAG,new Boolean(true));
        executionContext.setRenderOption(renderOptions2);
      }
    }
  }
}

Fixed version (ground truth):
protected void updateRtLFlag() throws EngineException {
  if (renderOptions == null)   return;
  IReportRunnable runnable=executionContext.getRunnable();
  if (runnable == null)   return;
  ReportDesignHandle handle=(ReportDesignHandle)runnable.getDesignHandle();
  if (handle != null) {
    Object bidiFlag=renderOptions.getOption(IRenderOption.RTL_FLAG);
    if (Boolean.TRUE.equals(bidiFlag)) {
      String bidiOrientation=DesignChoiceConstants.BIDI_DIRECTION_RTL;
      try {
        handle.setBidiOrientation(bidiOrientation);
        updateBidiStyle(bidiOrientation);
      }
 catch (      SemanticException e) {
        log.log(Level.WARNING,"String_Node_Str",e);
        throw new EngineException("String_Node_Str");
      }
    }
 else     if (handle.isDirectionRTL()) {
      renderOptions.setOption(IRenderOption.RTL_FLAG,new Boolean(true));
      IRenderOption renderOptions2=executionContext.getRenderOption();
      if (renderOptions2 != null) {
        renderOptions2.setOption(IRenderOption.RTL_FLAG,new Boolean(true));
        executionContext.setRenderOption(renderOptions2);
      }
    }
  }
}
Program: 71178
Project: 71178
Buggy source:
/** 
 * @param expression
 * @return
 * @throws DataException
 */
private int getExpressionDataTypeOfSortKey(String expression) throws DataException {
  try {
    if (expression == null)     return DataType.ANY_TYPE;
    String bindingName=ExpressionUtil.getColumnBindingName(expression);
    if (bindingName == null)     return DataType.ANY_TYPE;
    Object binding=this.baseQueryDefn.getBindings().get(bindingName);
    if (binding == null)     return DataType.ANY_TYPE;
    int dataType=((IBinding)binding).getDataType();
    if (dataType != DataType.UNKNOWN_TYPE)     return dataType;
 else     return DataType.ANY_TYPE;
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}

Fixed version (ground truth):
/** 
 * @param expression
 * @return
 * @throws DataException
 */
private int getExpressionDataTypeOfSortKey(String expression) throws DataException {
  try {
    if (expression == null)     return DataType.ANY_TYPE;
    String bindingName=ExpressionUtil.getColumnBindingName(expression);
    if (bindingName == null)     return DataType.ANY_TYPE;
    if (bindingName.equals(ScriptConstants.ROW_NUM_KEYWORD)) {
      return DataType.INTEGER_TYPE;
    }
    Object binding=this.baseQueryDefn.getBindings().get(bindingName);
    if (binding == null)     return DataType.ANY_TYPE;
    int dataType=((IBinding)binding).getDataType();
    if (dataType != DataType.UNKNOWN_TYPE)     return dataType;
 else     return DataType.ANY_TYPE;
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}
Program: 71179
Project: 71179
Buggy source:
/** 
 * get the data type of a expression
 * @param cx
 * @param expr
 * @return
 * @throws DataException 
 */
private int getColumnDataType(Context cx,String expr) throws DataException {
  String columnName=QueryExecutorUtil.getColInfoFromJSExpr(cx,expr).getColumnName();
  if (columnName == null) {
    return DataType.UNKNOWN_TYPE;
  }
  if (columnName.equals(ScriptConstants.ROW_NUM_KEYWORD)) {
    return DataType.INTEGER_TYPE;
  }
  Object baseExpr=(this.baseQueryDefn.getBindings().get(columnName));
  if (baseExpr == null) {
    return DataType.UNKNOWN_TYPE;
  }
  return ((IBinding)baseExpr).getExpression().getDataType();
}

Fixed version (ground truth):
/** 
 * get the data type of a expression
 * @param cx
 * @param expr
 * @return
 * @throws DataException 
 */
private int getColumnDataType(Context cx,String expr) throws DataException {
  String columnName=QueryExecutorUtil.getColInfoFromJSExpr(cx,expr).getColumnName();
  if (columnName == null) {
    return DataType.UNKNOWN_TYPE;
  }
  if (columnName.equals(ScriptConstants.ROW_NUM_KEYWORD)) {
    return DataType.INTEGER_TYPE;
  }
  Object baseExpr=(this.baseQueryDefn.getBindings().get(columnName));
  if (baseExpr == null) {
    return DataType.UNKNOWN_TYPE;
  }
  int dataType=((IBinding)baseExpr).getExpression().getDataType();
  if (dataType == DataType.UNKNOWN_TYPE)   return DataType.ANY_TYPE;
  return dataType;
}
Program: 71180
Project: 71180
Buggy source:
/** 
 * Build the background style string.
 * @param styleBuffer The <code>StringBuffer</code> to which the result is output.
 * @param style The style object.
 * @param emitter The <code>HTMLReportEmitter</code> object which provides resource manager and hyperlink builder objects.
 */
public static void buildBackground(StringBuffer styleBuffer,IStyle style,HTMLReportEmitter emitter){
  buildProperty(styleBuffer,HTMLTags.ATTR_BACKGROUND_COLOR,style.getBackgroundColor());
  String image=style.getBackgroundImage();
  if (image == null || "String_Node_Str".equalsIgnoreCase(image)) {
    return;
  }
  image=emitter.handleStyleImage(image);
  if (image != null && image.length() > 0) {
    buildURLProperty(styleBuffer,HTMLTags.ATTR_BACKGROUND_IMAGE,image);
    buildProperty(styleBuffer,HTMLTags.ATTR_BACKGROUND_REPEAT,style.getBackgroundRepeat());
    buildProperty(styleBuffer,HTMLTags.ATTR_BACKGROUND_ATTACHEMNT,style.getBackgroundAttachment());
    String x=style.getBackgroundPositionX();
    String y=style.getBackgroundPositionY();
    if (x != null || y != null) {
      if (x == null) {
        x="String_Node_Str";
      }
      if (y == null) {
        y="String_Node_Str";
      }
      addPropName(styleBuffer,HTMLTags.ATTR_BACKGROUND_POSITION);
      addPropValue(styleBuffer,x);
      addPropValue(styleBuffer,y);
      styleBuffer.append(';');
    }
  }
}

Fixed version (ground truth):
/** 
 * Build the background style string.
 * @param styleBuffer The <code>StringBuffer</code> to which the result is output.
 * @param style The style object.
 * @param emitter The <code>HTMLReportEmitter</code> object which provides resource manager and hyperlink builder objects.
 */
public static void buildBackground(StringBuffer styleBuffer,IStyle style,HTMLReportEmitter emitter){
  buildProperty(styleBuffer,HTMLTags.ATTR_BACKGROUND_COLOR,style.getBackgroundColor());
  String image=style.getBackgroundImage();
  if (image == null || "String_Node_Str".equalsIgnoreCase(image)) {
    return;
  }
  image=emitter.handleStyleImage(image,true);
  if (image != null && image.length() > 0) {
    buildURLProperty(styleBuffer,HTMLTags.ATTR_BACKGROUND_IMAGE,image);
    buildProperty(styleBuffer,HTMLTags.ATTR_BACKGROUND_REPEAT,style.getBackgroundRepeat());
    buildProperty(styleBuffer,HTMLTags.ATTR_BACKGROUND_ATTACHEMNT,style.getBackgroundAttachment());
    String x=style.getBackgroundPositionX();
    String y=style.getBackgroundPositionY();
    if (x != null || y != null) {
      if (x == null) {
        x="String_Node_Str";
      }
      if (y == null) {
        y="String_Node_Str";
      }
      addPropName(styleBuffer,HTMLTags.ATTR_BACKGROUND_POSITION);
      addPropValue(styleBuffer,x);
      addPropValue(styleBuffer,y);
      styleBuffer.append(';');
    }
  }
}
Program: 71181
Project: 71181
Buggy source:
/** 
 * handle style image
 * @param uri uri in style image
 * @return
 */
public String handleStyleImage(String uri){
  ReportDesignHandle design=(ReportDesignHandle)runnable.getDesignHandle();
  URL url=design.findResource(uri,IResourceLocator.IMAGE);
  if (url == null) {
    return uri;
  }
  uri=url.toExternalForm();
  Image image=new Image(uri);
  image.setReportRunnable(runnable);
  image.setRenderOption(renderOption);
  String imgUri=null;
  if (imageHandler != null) {
switch (image.getSource()) {
case IImage.URL_IMAGE:
      imgUri=imageHandler.onURLImage(image,reportContext);
    break;
case IImage.FILE_IMAGE:
  imgUri=imageHandler.onFileImage(image,reportContext);
break;
case IImage.INVALID_IMAGE:
break;
default :
assert(false);
}
}
return imgUri;
}

Fixed version (ground truth):
/** 
 * handle style image
 * @param uri uri in style image
 * @param isBackground Is this image a used for a background?
 * @return
 */
public String handleStyleImage(String uri,boolean isBackground){
  ReportDesignHandle design=(ReportDesignHandle)runnable.getDesignHandle();
  URL url=design.findResource(uri,IResourceLocator.IMAGE);
  if (url == null) {
    return uri;
  }
  uri=url.toExternalForm();
  Image image=null;
  if (isBackground && SvgFile.isSvg(uri)) {
    try {
      byte[] buffer=SvgFile.transSvgToArray(uri);
      image=new Image(buffer,uri,"String_Node_Str");
    }
 catch (    IOException e) {
      image=new Image(uri);
    }
  }
 else {
    image=new Image(uri);
  }
  image.setReportRunnable(runnable);
  image.setRenderOption(renderOption);
  String imgUri=null;
  if (imageHandler != null) {
switch (image.getSource()) {
case IImage.URL_IMAGE:
      imgUri=imageHandler.onURLImage(image,reportContext);
    break;
case IImage.FILE_IMAGE:
  imgUri=imageHandler.onFileImage(image,reportContext);
break;
case IImage.CUSTOM_IMAGE:
imgUri=imageHandler.onCustomImage(image,reportContext);
break;
case IImage.INVALID_IMAGE:
break;
default :
assert(false);
}
}
return imgUri;
}
Program: 71183
Project: 71183
Buggy source:
public void initialize(IEmitterServices service){
  this.service=service;
  if (service != null) {
    this.out=EmitterUtil.getOuputStream(service,"String_Node_Str" + getOutputFormat());
  }
  context.setTempFileDir(service.getReportEngine().getConfig().getTempDir());
}

Fixed version (ground truth):
public void initialize(IEmitterServices service){
  this.service=service;
  if (service != null) {
    this.out=EmitterUtil.getOuputStream(service,"String_Node_Str" + getOutputFormat());
  }
  context.setTempFileDir(service.getReportEngine().getConfig().getTempDir());
  IReportContext reportContext=service.getReportContext();
  if (reportContext != null) {
    Locale locale=reportContext.getLocale();
    if (locale != null)     context.setLocale(ULocale.forLocale(locale));
  }
}
Program: 71184
Project: 71184
Buggy source:
private SheetData createImageData(IImageContent image,StyleEntry entry,XlsContainer container){
  int type=SheetData.IMAGE;
  entry.setProperty(StyleConstant.DATA_TYPE_PROP,Integer.toString(type));
  byte[] imageData=EmitterUtil.parseImage(image,image.getImageSource(),image.getURI(),image.getMIMEType(),image.getExtension());
  if (imageData != null) {
    return new ImageData(image,entry,type,imageData,container);
  }
 else {
    return createData(image.getAltText(),entry);
  }
}

Fixed version (ground truth):
private SheetData createImageData(IImageContent image,StyleEntry entry,XlsContainer container){
  int type=SheetData.IMAGE;
  entry.setProperty(StyleConstant.DATA_TYPE_PROP,Integer.toString(type));
  String uri=image.getURI();
  String mimeType=image.getMIMEType();
  String extension=image.getExtension();
  String altText=image.getAltText();
  if (FlashFile.isFlash(mimeType,uri,extension)) {
    if (null == altText) {
      altText=messageFlashObjectNotSupported;
    }
    return createData(altText,entry);
  }
  byte[] imageData=EmitterUtil.parseImage(image,image.getImageSource(),image.getURI(),image.getMIMEType(),image.getExtension());
  if (imageData != null) {
    return new ImageData(image,entry,type,imageData,container);
  }
 else {
    return createData(image.getAltText(),entry);
  }
}
Program: 71185
Project: 71185
Buggy source:
public ExcelLayoutEngine(PageDef page,ExcelContext context,ExcelEmitter emitter){
  this.context=context;
  this.emitter=emitter;
  initalize(page);
}

Fixed version (ground truth):
public ExcelLayoutEngine(PageDef page,ExcelContext context,ExcelEmitter emitter){
  this.context=context;
  this.emitter=emitter;
  ULocale locale=context.getLocale();
  if (locale == null) {
    locale=ULocale.getDefault();
  }
  EngineResourceHandle resourceHandle=new EngineResourceHandle(locale);
  messageFlashObjectNotSupported=resourceHandle.getMessage(MessageConstants.FLASH_OBJECT_NOT_SUPPORTED_PROMPT);
  initalize(page);
}
Program: 71186
Project: 71186
Buggy source:
public void startImage(IImageContent image){
  IStyle style=image.getComputedStyle();
  InlineFlag inlineFlag=getInlineFlag(style);
  String uri=image.getURI();
  String mimeType=image.getMIMEType();
  String extension=image.getExtension();
  String altText=image.getAltText();
  if (FlashFile.isFlash(mimeType,uri,extension)) {
    if (null == altText) {
      if (null != reportContext) {
        ULocale locale=ULocale.forLocale(reportContext.getLocale());
        EngineResourceHandle handle=new EngineResourceHandle(locale);
        altText=handle.getMessage(MessageConstants.FLASH_OBJECT_NOT_SUPPORTED_PROMPT);
      }
    }
    wordWriter.drawImage(null,0.0,0.0,null,style,inlineFlag,altText,uri);
    return;
  }
  byte[] data=org.eclipse.birt.report.engine.layout.emitter.EmitterUtil.parseImage(image,image.getImageSource(),uri,mimeType,extension);
  if (data == null || data.length == 0) {
    wordWriter.drawImage(null,0.0,0.0,null,style,inlineFlag,altText,uri);
    return;
  }
  int defaultW=0;
  int defaultH=0;
  try {
    Image imageData=javax.imageio.ImageIO.read(new ByteArrayInputStream(data));
    if (imageData != null) {
      defaultW=imageData.getWidth(null);
      defaultH=imageData.getHeight(null);
    }
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
  double height=WordUtil.convertImageSize(image.getHeight(),defaultH);
  double width=WordUtil.convertImageSize(image.getWidth(),defaultW);
  writeBookmark(image);
  writeToc(image);
  HyperlinkInfo hyper=getHyperlink(image);
  wordWriter.drawImage(data,height,width,hyper,style,inlineFlag,altText,uri);
}

Fixed version (ground truth):
public void startImage(IImageContent image){
  IStyle style=image.getComputedStyle();
  InlineFlag inlineFlag=getInlineFlag(style);
  String uri=image.getURI();
  String mimeType=image.getMIMEType();
  String extension=image.getExtension();
  String altText=image.getAltText();
  if (FlashFile.isFlash(mimeType,uri,extension)) {
    if (altText == null) {
      altText=messageFlashObjectNotSupported;
    }
    wordWriter.drawImage(null,0.0,0.0,null,style,inlineFlag,altText,uri);
    return;
  }
  byte[] data=org.eclipse.birt.report.engine.layout.emitter.EmitterUtil.parseImage(image,image.getImageSource(),uri,mimeType,extension);
  if (data == null || data.length == 0) {
    wordWriter.drawImage(null,0.0,0.0,null,style,inlineFlag,altText,uri);
    return;
  }
  int defaultW=0;
  int defaultH=0;
  try {
    Image imageData=javax.imageio.ImageIO.read(new ByteArrayInputStream(data));
    if (imageData != null) {
      defaultW=imageData.getWidth(null);
      defaultH=imageData.getHeight(null);
    }
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
  double height=WordUtil.convertImageSize(image.getHeight(),defaultH);
  double width=WordUtil.convertImageSize(image.getWidth(),defaultW);
  writeBookmark(image);
  writeToc(image);
  HyperlinkInfo hyper=getHyperlink(image);
  wordWriter.drawImage(data,height,width,hyper,style,inlineFlag,altText,uri);
}
Program: 71187
Project: 71187
Buggy source:
public void initialize(IEmitterServices service){
  if (service != null) {
    this.out=EmitterUtil.getOuputStream(service,"String_Node_Str" + getOutputFormat());
    this.reportRunnable=service.getReportRunnable();
    this.actionHandler=(IHTMLActionHandler)service.getOption(RenderOption.ACTION_HANDLER);
    this.reportContext=service.getReportContext();
  }
  context=new EmitterContext();
}

Fixed version (ground truth):
public void initialize(IEmitterServices service){
  if (service != null) {
    this.out=EmitterUtil.getOuputStream(service,"String_Node_Str" + getOutputFormat());
    this.reportRunnable=service.getReportRunnable();
    this.actionHandler=(IHTMLActionHandler)service.getOption(RenderOption.ACTION_HANDLER);
    reportContext=service.getReportContext();
    ULocale locale=null;
    if (reportContext != null) {
      locale=ULocale.forLocale(reportContext.getLocale());
    }
    if (locale == null) {
      locale=ULocale.getDefault();
    }
    EngineResourceHandle resourceHandle=new EngineResourceHandle(locale);
    messageFlashObjectNotSupported=resourceHandle.getMessage(MessageConstants.FLASH_OBJECT_NOT_SUPPORTED_PROMPT);
  }
  context=new EmitterContext();
}
Program: 71188
Project: 71188
Buggy source:
protected void updateRtLFlag() throws EngineException {
  if (renderOptions == null)   return;
  IReportRunnable runnable=executionContext.getRunnable();
  if (runnable == null)   return;
  Report report=executionContext.getReport();
  AbstractStyle rootStyle=(AbstractStyle)report.getStyles().get(report.getRootStyleName());
  ReportDesignHandle handle=(ReportDesignHandle)runnable.getDesignHandle();
  if (handle != null) {
    Object bidiFlag=renderOptions.getOption(IRenderOption.RTL_FLAG);
    String bidiOrientation=null;
    if (bidiFlag != null) {
      if (Boolean.TRUE.equals(bidiFlag)) {
        bidiOrientation=DesignChoiceConstants.BIDI_DIRECTION_RTL;
      }
 else {
        bidiOrientation=DesignChoiceConstants.BIDI_DIRECTION_LTR;
      }
      try {
        handle.setBidiOrientation(bidiOrientation);
        rootStyle.setDirection(bidiOrientation);
      }
 catch (      SemanticException e) {
        log.log(Level.WARNING,"String_Node_Str",e);
        throw new EngineException("String_Node_Str");
      }
    }
 else     if (handle.isDirectionRTL()) {
      renderOptions.setOption(IRenderOption.RTL_FLAG,new Boolean(true));
      IRenderOption renderOptions2=executionContext.getRenderOption();
      if (renderOptions2 != null) {
        renderOptions2.setOption(IRenderOption.RTL_FLAG,new Boolean(true));
        executionContext.setRenderOption(renderOptions2);
      }
    }
  }
}

Fixed version (ground truth):
protected void updateRtLFlag() throws EngineException {
  if (renderOptions == null)   return;
  IReportRunnable runnable=executionContext.getRunnable();
  if (runnable == null)   return;
  ReportDesignHandle handle=(ReportDesignHandle)runnable.getDesignHandle();
  if (handle != null) {
    Object bidiFlag=renderOptions.getOption(IRenderOption.RTL_FLAG);
    String bidiOrientation=null;
    if (bidiFlag != null) {
      if (Boolean.TRUE.equals(bidiFlag)) {
        bidiOrientation=DesignChoiceConstants.BIDI_DIRECTION_RTL;
      }
 else {
        bidiOrientation=DesignChoiceConstants.BIDI_DIRECTION_LTR;
      }
      try {
        handle.setBidiOrientation(bidiOrientation);
        Report report=executionContext.getReport();
        AbstractStyle rootStyle=(AbstractStyle)report.getStyles().get(report.getRootStyleName());
{
          if (rootStyle != null) {
            rootStyle.setDirection(bidiOrientation);
          }
        }
      }
 catch (      SemanticException e) {
        log.log(Level.WARNING,"String_Node_Str",e);
        throw new EngineException("String_Node_Str");
      }
    }
 else     if (handle.isDirectionRTL()) {
      renderOptions.setOption(IRenderOption.RTL_FLAG,new Boolean(true));
      IRenderOption renderOptions2=executionContext.getRenderOption();
      if (renderOptions2 != null) {
        renderOptions2.setOption(IRenderOption.RTL_FLAG,new Boolean(true));
        executionContext.setRenderOption(renderOptions2);
      }
    }
  }
}
Program: 71189
Project: 71189
Buggy source:
public static String convertColor(String value){
  if (value == null || "String_Node_Str".equalsIgnoreCase(value)) {
    return null;
  }
 else   return value.replace("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public static String convertColor(String value){
  if (value == null || "String_Node_Str".equalsIgnoreCase(value) || "String_Node_Str".equalsIgnoreCase(value)) {
    return null;
  }
 else   return value.replace("String_Node_Str","String_Node_Str");
}
Program: 71192
Project: 71192
Buggy source:
public void saveReport(ModuleHandle moduleHandle,Object element,IPath origReportPath,IProgressMonitor monitor){
  if (element instanceof IFileEditorInput) {
    IFileEditorInput input=(IFileEditorInput)element;
    saveFile(moduleHandle,input.getFile(),origReportPath,monitor);
  }
 else   if (element instanceof IEditorInput) {
    IPath path=getInputPath((IEditorInput)element);
    if (path != null) {
      saveFile(moduleHandle,path.toFile(),origReportPath,monitor);
    }
  }
}

Fixed version (ground truth):
public void saveReport(ModuleHandle moduleHandle,Object element,IPath origReportPath,IProgressMonitor monitor){
  if (element instanceof IFileEditorInput) {
    IFileEditorInput input=(IFileEditorInput)element;
    IFile file=input.getFile();
    if (ResourcesPlugin.getWorkspace().validateEdit(new IFile[]{file},IWorkspace.VALIDATE_PROMPT).getSeverity() == IStatus.OK) {
      saveFile(moduleHandle,file,origReportPath,monitor);
    }
  }
 else   if (element instanceof IEditorInput) {
    IPath path=getInputPath((IEditorInput)element);
    if (path != null) {
      saveFile(moduleHandle,path.toFile(),origReportPath,monitor);
    }
  }
}
Program: 71193
Project: 71193
Buggy source:
/** 
 * Populate the sortings in a query.
 * @throws DataException
 */
private void populateSorting() throws DataException {
  List sorts=this.baseQueryDefn.getSorts();
  if (sorts != null && !sorts.isEmpty()) {
    IQuery.SortSpec[] sortSpecs=new IQuery.SortSpec[sorts.size()];
    Iterator it=sorts.iterator();
    for (int i=0; it.hasNext(); i++) {
      ISortDefinition src=(ISortDefinition)it.next();
      int sortIndex=-1;
      String sortKey=src.getColumn();
      if (sortKey == null)       sortKey=src.getExpression().getText();
 else {
        sortKey=getColumnRefExpression(sortKey);
      }
      temporaryComputedColumns.add(new ComputedColumn("String_Node_Str" + i + "String_Node_Str",sortKey,DataType.ANY_TYPE));
      sortIndex=-1;
      sortKey=String.valueOf("String_Node_Str" + i + "String_Node_Str");
      IQuery.SortSpec dest=new IQuery.SortSpec(sortIndex,sortKey,src.getSortDirection() == ISortDefinition.SORT_ASC,src.getSortStrength() == -1 ? null : Collator.getInstance());
      sortSpecs[i]=dest;
    }
    odiQuery.setOrdering(Arrays.asList(sortSpecs));
  }
}

Fixed version (ground truth):
/** 
 * Populate the sortings in a query.
 * @throws DataException
 */
private void populateSorting() throws DataException {
  List sorts=this.baseQueryDefn.getSorts();
  if (sorts != null && !sorts.isEmpty()) {
    IQuery.SortSpec[] sortSpecs=new IQuery.SortSpec[sorts.size()];
    Iterator it=sorts.iterator();
    for (int i=0; it.hasNext(); i++) {
      ISortDefinition src=(ISortDefinition)it.next();
      int sortIndex=-1;
      String sortKey=src.getColumn();
      if (sortKey == null)       sortKey=src.getExpression().getText();
 else {
        sortKey=getColumnRefExpression(sortKey);
      }
      temporaryComputedColumns.add(new ComputedColumn("String_Node_Str" + i + "String_Node_Str",sortKey,getExpressionDataTypeOfSortKey(sortKey)));
      sortIndex=-1;
      sortKey=String.valueOf("String_Node_Str" + i + "String_Node_Str");
      IQuery.SortSpec dest=new IQuery.SortSpec(sortIndex,sortKey,src.getSortDirection() == ISortDefinition.SORT_ASC,src.getSortStrength() == -1 ? null : Collator.getInstance());
      sortSpecs[i]=dest;
    }
    odiQuery.setOrdering(Arrays.asList(sortSpecs));
  }
}
Program: 71195
Project: 71195
Buggy source:
/** 
 * @param dimAxisIndex
 * @param sortType
 * @return
 * @throws OLAPException
 */
protected Object fetchValueFromMirror(int dimAxisIndex,int sortType) throws OLAPException {
  if (this.dimTraverse.dimensionCursorPosition[dimAxisIndex] < 0 || this.dimTraverse.dimensionCursorPosition[dimAxisIndex] >= edgeDimensRelation.mirrorLength[dimAxisIndex])   throw new OLAPException(ResourceConstants.RD_EXPR_RESULT_SET_NOT_START);
  if (sortType == IDimensionSortDefn.SORT_UNDEFINED) {
    return this.dimAxis[dimAxisIndex].getDisctinctValue().get(this.dimTraverse.dimensionCursorPosition[dimAxisIndex]);
  }
  Collection collection=null;
  try {
    collection=fetchValueCollectionInEdgeInfo(dimAxisIndex);
  }
 catch (  IOException e) {
  }
  Vector v=this.dimAxis[dimAxisIndex].getDisctinctValue();
  v.removeAll(collection);
  if (sortType == IDimensionSortDefn.SORT_ASC) {
    for (int i=0, startSize=v.size(); i < collection.size(); i++) {
      v.insertElementAt(collection.iterator().next(),startSize);
      startSize++;
    }
  }
 else {
    Iterator iter=collection.iterator();
    int index=0;
    while (iter.hasNext()) {
      v.insertElementAt(iter.next(),index);
      index++;
    }
  }
  return v.get(this.dimTraverse.dimensionCursorPosition[dimAxisIndex]);
}

Fixed version (ground truth):
/** 
 * @param dimAxisIndex
 * @param sortType
 * @return
 * @throws OLAPException
 */
protected Object fetchValueFromMirror(int dimAxisIndex,int sortType) throws OLAPException {
  if (this.dimTraverse.dimensionCursorPosition[dimAxisIndex] < 0 || this.dimTraverse.dimensionCursorPosition[dimAxisIndex] >= edgeDimensRelation.mirrorLength[dimAxisIndex])   throw new OLAPException(ResourceConstants.RD_EXPR_RESULT_SET_NOT_START);
  if (sortType == IDimensionSortDefn.SORT_UNDEFINED) {
    return this.dimAxis[dimAxisIndex].getDisctinctValue().get(this.dimTraverse.dimensionCursorPosition[dimAxisIndex]);
  }
  Collection collection=null;
  try {
    collection=fetchValueCollectionInEdgeInfo(dimAxisIndex);
  }
 catch (  IOException e) {
  }
  Vector v=this.dimAxis[dimAxisIndex].getDisctinctValue();
  v.removeAll(collection);
  Iterator iter=collection.iterator();
  if (sortType == IDimensionSortDefn.SORT_ASC) {
    for (int i=0, startSize=v.size(); i < collection.size(); i++) {
      v.insertElementAt(iter.next(),startSize);
      startSize++;
    }
  }
 else {
    int index=0;
    while (iter.hasNext()) {
      v.insertElementAt(iter.next(),index);
      index++;
    }
  }
  return v.get(this.dimTraverse.dimensionCursorPosition[dimAxisIndex]);
}
Program: 71196
Project: 71196
Buggy source:
/** 
 * @param dimAxisIndex
 * @return
 * @throws IOException
 */
private Collection fetchValueCollectionInEdgeInfo(int dimAxisIndex) throws IOException {
  Set value=new HashSet();
  int edgeStart=this.getEdgeStart(this.mirrorStartPosition - 1);
  int edgeEnd=this.getEdgeEnd(this.mirrorStartPosition - 1);
  while (edgeStart <= edgeEnd) {
    this.rs.seek(edgeStart);
    value.add(this.rs.getLevelKeyValue(dimAxisIndex)[this.rs.getLevelKeyColCount(dimAxisIndex) - 1]);
    edgeStart++;
  }
  return value;
}

Fixed version (ground truth):
/** 
 * @param dimAxisIndex
 * @return
 * @throws IOException
 */
private Collection fetchValueCollectionInEdgeInfo(int dimAxisIndex) throws IOException {
  Set value=new LinkedHashSet();
  EdgeInfo info=this.dimTraverse.findCurrentEdgeInfo(this.mirrorStartPosition - 1);
  int index=this.edgeDimensRelation.currentRelation[this.mirrorStartPosition - 1].indexOf(info);
  EdgeInfo nextEdgeInfo=null;
  if (index < this.edgeDimensRelation.currentRelation[this.mirrorStartPosition - 1].size() - 1) {
    nextEdgeInfo=(EdgeInfo)this.edgeDimensRelation.currentRelation[this.mirrorStartPosition - 1].get(index + 1);
  }
  int edgeStart=info == null ? this.rs.length() - 1 : info.firstChild;
  int edgeEnd=nextEdgeInfo == null ? this.rs.length() - 1 : nextEdgeInfo.firstChild;
  if (edgeStart >= 0) {
    while (edgeStart <= edgeEnd) {
      this.rs.seek(edgeStart);
      value.add(this.rs.getLevelKeyValue(dimAxisIndex)[this.rs.getLevelKeyColCount(dimAxisIndex) - 1]);
      edgeStart++;
    }
  }
  return value;
}
Program: 71197
Project: 71197
Buggy source:
public ImageData(IImageContent image,StyleEntry style,int datatype,XlsContainer currentContainer){
  super();
  this.style=style;
  this.datatype=datatype;
  height=ExcelUtil.convertImageSize(image.getHeight(),0);
  width=minWidth(currentContainer.getSizeInfo().getWidth(),image.getWidth());
  altText=image.getAltText();
  imageUrl=image.getURI();
  imageData=EmitterUtil.parseImage(image,image.getImageSource(),image.getURI(),image.getMIMEType(),image.getExtension());
  container=currentContainer;
  rowSpanInDesign=0;
}

Fixed version (ground truth):
public ImageData(IImageContent image,StyleEntry style,int datatype,byte[] imageData,XlsContainer currentContainer){
  super();
  this.style=style;
  this.datatype=datatype;
  height=ExcelUtil.convertImageSize(image.getHeight(),0);
  width=minWidth(currentContainer.getSizeInfo().getWidth(),image.getWidth());
  altText=image.getAltText();
  imageUrl=image.getURI();
  this.imageData=imageData;
  container=currentContainer;
  rowSpanInDesign=0;
}
Program: 71198
Project: 71198
Buggy source:
private ImageData createImageData(IImageContent image,StyleEntry entry,XlsContainer container){
  int type=SheetData.IMAGE;
  entry.setProperty(StyleConstant.DATA_TYPE_PROP,Integer.toString(type));
  return new ImageData(image,entry,type,container);
}

Fixed version (ground truth):
private SheetData createImageData(IImageContent image,StyleEntry entry,XlsContainer container){
  int type=SheetData.IMAGE;
  entry.setProperty(StyleConstant.DATA_TYPE_PROP,Integer.toString(type));
  byte[] imageData=EmitterUtil.parseImage(image,image.getImageSource(),image.getURI(),image.getMIMEType(),image.getExtension());
  if (imageData != null) {
    return new ImageData(image,entry,type,imageData,container);
  }
 else {
    return createData(image.getAltText(),entry);
  }
}
Program: 71199
Project: 71199
Buggy source:
public void addImageData(IImageContent image,IStyle style,HyperlinkDef link){
  XlsContainer container=getCurrentContainer();
  ContainerSizeInfo rule=container.getSizeInfo();
  StyleEntry entry=engine.getStyle(style,rule);
  ImageData data=createImageData(image,entry,container);
  data.setHyperlinkDef(link);
  data.setSizeInfo(rule);
  addData(data);
}

Fixed version (ground truth):
public void addImageData(IImageContent image,IStyle style,HyperlinkDef link){
  XlsContainer container=getCurrentContainer();
  ContainerSizeInfo rule=container.getSizeInfo();
  StyleEntry entry=engine.getStyle(style,rule);
  SheetData data=createImageData(image,entry,container);
  data.setHyperlinkDef(link);
  data.setSizeInfo(rule);
  addData(data);
}