nus-yam/ex-repair huggingface dataset:
Program: 67969
Project: 67969
Buggy source:
/** 
 * Return the QueryResults. But the execution of query would be deferred
 * @param outerResults If query is nested within another query, this is the outer query's query result handle.
 * @param scope The ElementState object for the report item using the query; this acts as the JS scope for evaluating script expressions.
 * @param executor
 * @parem dataSourceQuery
 */
QueryResults doPrepare(IBaseQueryResults outerResults,Scriptable scope,QueryExecutor executor,PreparedDataSourceQuery dataSourceQuery) throws DataException {
  if (this.baseQueryDefn == null) {
    DataException e=new DataException(ResourceConstants.PREPARED_QUERY_CLOSED);
    logger.logp(Level.WARNING,PreparedQuery.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw e;
  }
  executor.setAppContext(this.appContext);
  logger.finer("String_Node_Str");
  executor.prepareExecution(outerResults,scope);
  logger.finer("String_Node_Str");
  QueryResults result=new QueryResults(new ServiceForQueryResults(this.session,executor.getQueryScope(),executor.getNestedLevel() + 1,dataSourceQuery,queryService,executor,this.baseQueryDefn,this.exprManager));
  if (this.baseQueryDefn.cacheQueryResults() && this.baseQueryDefn instanceof IQueryDefinition) {
    result.setID(this.session.getQueryResultIDUtil().nextID());
    ((QueryDefinition)this.baseQueryDefn).setQueryResultsID(result.getID());
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Return the QueryResults. But the execution of query would be deferred
 * @param outerResults If query is nested within another query, this is the outer query's query result handle.
 * @param scope The ElementState object for the report item using the query; this acts as the JS scope for evaluating script expressions.
 * @param executor
 * @parem dataSourceQuery
 */
public QueryResults doPrepare(IBaseQueryResults outerResults,Scriptable scope,QueryExecutor executor,PreparedDataSourceQuery dataSourceQuery) throws DataException {
  if (this.baseQueryDefn == null) {
    DataException e=new DataException(ResourceConstants.PREPARED_QUERY_CLOSED);
    logger.logp(Level.WARNING,PreparedQuery.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw e;
  }
  executor.setAppContext(this.appContext);
  logger.finer("String_Node_Str");
  executor.prepareExecution(outerResults,scope);
  logger.finer("String_Node_Str");
  QueryResults result=new QueryResults(new ServiceForQueryResults(this.session,executor.getQueryScope(),executor.getNestedLevel() + 1,dataSourceQuery,queryService,executor,this.baseQueryDefn,this.exprManager));
  if (this.baseQueryDefn.cacheQueryResults() && this.baseQueryDefn instanceof IQueryDefinition) {
    result.setID(this.session.getQueryResultIDUtil().nextID());
    ((QueryDefinition)this.baseQueryDefn).setQueryResultsID(result.getID());
  }
  return result;
}
Program: 67970
Project: 67970
Buggy source:
/** 
 * Set current queryresult ID for sub query. Sub query result ID can not be generated independently, and it is needs to be attached with its parent query.
 * @param selfQueryResultID
 */
void setID(String selfQueryResultID){
  this.setID(null,selfQueryResultID);
}

Fixed version (ground truth):
/** 
 * Set current queryresult ID for sub query. Sub query result ID can not be generated independently, and it is needs to be attached with its parent query.
 * @param selfQueryResultID
 */
public void setID(String selfQueryResultID){
  this.setID(null,selfQueryResultID);
}
Program: 67971
Project: 67971
Buggy source:
protected void drawText(String text,float textX,float textY,float baseline,float width,float height,TextStyle fontStyle){
  writer.drawString(text,textX,textY + baseline,fontStyle.getFontInfo(),convertToPoint(fontStyle.getLetterSpacing()),convertToPoint(fontStyle.getWordSpacing()),fontStyle.getColor(),fontStyle.isLinethrough(),fontStyle.isOverline(),fontStyle.isUnderline(),fontStyle.getAlign());
}

Fixed version (ground truth):
protected void drawText(String text,float textX,float textY,float baseline,float width,float height,TextStyle textStyle){
  writer.drawString(text,textX,textY + baseline,textStyle.getFontInfo(),convertToPoint(textStyle.getLetterSpacing()),convertToPoint(textStyle.getWordSpacing()),textStyle.getColor(),textStyle.isLinethrough(),textStyle.isOverline(),textStyle.isUnderline(),textStyle.getAlign());
  if (textStyle.isHasHyperlink()) {
    FontInfo fontInfo=textStyle.getFontInfo();
    float lineWidth=fontInfo.getLineWidth();
    Color color=textStyle.getColor();
    drawDecorationLine(textX,textY,width,lineWidth,convertToPoint(fontInfo.getUnderlinePosition()),color);
  }
}
Program: 67972
Project: 67972
Buggy source:
private void drawDecorationLine(float textX,float textY,float width,float lineWidth,float verticalOffset,Color color){
  textY=textY + verticalOffset;
  drawLine(textX,textY,textX + width,textY,lineWidth,color,BorderInfo.BORDER_STYLE_SOLID);
}

Fixed version (ground truth):
protected void drawDecorationLine(float textX,float textY,float width,float lineWidth,float verticalOffset,Color color){
  textY=textY + verticalOffset;
  drawLine(textX,textY,textX + width,textY,lineWidth,color,BorderInfo.BORDER_STYLE_SOLID);
}
Program: 67973
Project: 67973
Buggy source:
public static TextStyle buildTextStyle(IContent content,FontInfo fontInfo){
  IStyle style=content.getComputedStyle();
  TextStyle textStyle=new TextStyle(fontInfo);
  CSSValue direction=style.getProperty(IStyle.STYLE_DIRECTION);
  if (IStyle.RTL_VALUE.equals(direction)) {
    textStyle.setDirection(TextStyle.DIRECTION_RTL);
  }
  textStyle.setFontSize(PropertyUtil.getDimensionValue(style.getProperty(IStyle.STYLE_FONT_SIZE)));
  textStyle.setLetterSpacing(PropertyUtil.getDimensionValue(style.getProperty(IStyle.STYLE_LETTER_SPACING)));
  textStyle.setWordSpacing(PropertyUtil.getDimensionValue(style.getProperty(IStyle.STYLE_WORD_SPACING)));
  textStyle.setLineThrough(style.getProperty(IStyle.STYLE_TEXT_LINETHROUGH) == IStyle.LINE_THROUGH_VALUE);
  textStyle.setOverLine(style.getProperty(IStyle.STYLE_TEXT_OVERLINE) == IStyle.OVERLINE_VALUE);
  CSSValue underLine=style.getProperty(IStyle.STYLE_TEXT_UNDERLINE);
  if (underLine == IStyle.UNDERLINE_VALUE) {
    textStyle.setUnderLine(true);
  }
 else {
    if (content.getHyperlinkAction() != null) {
      textStyle.setUnderLine(true);
    }
  }
  textStyle.setAlign(style.getProperty(IStyle.STYLE_TEXT_ALIGN));
  IStyle s=content.getStyle();
  Color color=PropertyUtil.getColor(s.getProperty(IStyle.STYLE_COLOR));
  if (color != null) {
    textStyle.setColor(color);
  }
 else {
    if (content.getHyperlinkAction() != null) {
      textStyle.setColor(Color.BLUE);
    }
 else {
      textStyle.setColor(PropertyUtil.getColor(style.getProperty(IStyle.STYLE_COLOR)));
    }
  }
  return textStyle;
}

Fixed version (ground truth):
public static TextStyle buildTextStyle(IContent content,FontInfo fontInfo){
  IStyle style=content.getComputedStyle();
  TextStyle textStyle=new TextStyle(fontInfo);
  CSSValue direction=style.getProperty(IStyle.STYLE_DIRECTION);
  if (IStyle.RTL_VALUE.equals(direction)) {
    textStyle.setDirection(TextStyle.DIRECTION_RTL);
  }
  textStyle.setFontSize(PropertyUtil.getDimensionValue(style.getProperty(IStyle.STYLE_FONT_SIZE)));
  textStyle.setLetterSpacing(PropertyUtil.getDimensionValue(style.getProperty(IStyle.STYLE_LETTER_SPACING)));
  textStyle.setWordSpacing(PropertyUtil.getDimensionValue(style.getProperty(IStyle.STYLE_WORD_SPACING)));
  textStyle.setLineThrough(style.getProperty(IStyle.STYLE_TEXT_LINETHROUGH) == IStyle.LINE_THROUGH_VALUE);
  textStyle.setOverLine(style.getProperty(IStyle.STYLE_TEXT_OVERLINE) == IStyle.OVERLINE_VALUE);
  CSSValue underLine=style.getProperty(IStyle.STYLE_TEXT_UNDERLINE);
  if (underLine == IStyle.UNDERLINE_VALUE) {
    textStyle.setUnderLine(true);
  }
  textStyle.setAlign(style.getProperty(IStyle.STYLE_TEXT_ALIGN));
  IStyle s=content.getStyle();
  Color color=PropertyUtil.getColor(s.getProperty(IStyle.STYLE_COLOR));
  if (color != null) {
    textStyle.setColor(color);
  }
 else {
    if (content.getHyperlinkAction() != null) {
      textStyle.setColor(Color.BLUE);
    }
 else {
      textStyle.setColor(PropertyUtil.getColor(style.getProperty(IStyle.STYLE_COLOR)));
    }
  }
  if (content.getHyperlinkAction() != null) {
    textStyle.setHasHyperlink(true);
  }
  return textStyle;
}
Program: 67975
Project: 67975
Buggy source:
/** 
 * Draws image at the contentByte
 * @param image the ImageArea specified from the layout
 */
protected void drawImage(IImageArea image){
  int imageX=currentX + getX(image);
  int imageY=currentY + getY(image);
  int height=getHeight(image);
  int width=getWidth(image);
  String helpText=image.getHelpText();
  try {
    byte[] data=image.getImageData();
    String extension=image.getExtension();
    String uri=image.getImageUrl();
    if (data != null) {
      pageGraphic.drawImage(uri,data,extension,imageX,imageY,height,width,helpText,image.getParameters());
    }
 else     if (uri != null) {
      pageGraphic.drawImage(uri,extension,imageX,imageY,height,width,helpText,image.getParameters());
    }
  }
 catch (  Throwable t) {
    log(t,Level.WARNING);
  }
}

Fixed version (ground truth):
/** 
 * Draws image at the contentByte
 * @param image the ImageArea specified from the layout
 */
protected void drawImage(IImageArea image){
  int imageX=currentX + getX(image);
  int imageY=currentY + getY(image);
  int height=getHeight(image);
  int width=getWidth(image);
  String helpText=image.getHelpText();
  try {
    byte[] data=image.getImageData();
    String extension=image.getExtension();
    String uri=image.getImageUrl();
    pageGraphic.drawImage(uri,data,extension,imageX,imageY,height,width,helpText,image.getParameters());
  }
 catch (  Throwable t) {
    log(t,Level.WARNING);
  }
}
Program: 67976
Project: 67976
Buggy source:
protected void addData(SheetData data){
  XlsContainer container=getCurrentContainer();
  container.setEmpty(false);
  int col=axis.getColumnIndexByCoordinate(data.getStartX());
  if (col == -1 || col >= cache.getColumnCount())   return;
  int span=axis.getColumnIndexByCoordinate(data.getEndX()) - col;
  outputDataIfBufferIsFull();
  updataRowIndex(data,container);
  addDatatoCache(col,data);
  for (int i=col + 1; i < col + span; i++) {
    BlankData blankData=new BlankData(data);
    blankData.setType(Type.HORIZONTAL);
    addDatatoCache(i,blankData);
  }
  if (data.getDataType() == SheetData.IMAGE) {
    addEmptyData(data,container);
  }
  if (container instanceof XlsCell) {
    XlsCell cell=(XlsCell)container;
    data.setRowSpanInDesign(cell.getRowSpan() - 1);
  }
}

Fixed version (ground truth):
protected void addData(SheetData data){
  XlsContainer container=getCurrentContainer();
  container.setEmpty(false);
  int col=axis.getColumnIndexByCoordinate(data.getStartX());
  if (col == -1 || col >= cache.getColumnCount())   return;
  int span=axis.getColumnIndexByCoordinate(data.getEndX()) - col;
  outputDataIfBufferIsFull();
  updataRowIndex(data,container);
  addDatatoCache(col,data);
  for (int i=col + 1; i < col + span; i++) {
    BlankData blankData=new BlankData(data);
    blankData.setType(Type.HORIZONTAL);
    addDatatoCache(i,blankData);
  }
  if (data.getDataType() == SheetData.IMAGE) {
    addEmptyData(data,container);
  }
  while (container != null) {
    if (container instanceof XlsCell) {
      XlsCell cell=(XlsCell)container;
      data.setRowSpanInDesign(cell.getRowSpan() - 1);
      break;
    }
 else {
      container=container.getParent();
    }
  }
}
Program: 67978
Project: 67978
Buggy source:
public void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent){
  ExternalUIUtil.updateColumnCache(dataSetHandle,holdEvent);
}

Fixed version (ground truth):
public void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent) throws BirtException {
  ExternalUIUtil.updateColumnCache(dataSetHandle,holdEvent);
}
Program: 67979
Project: 67979
Buggy source:
/** 
 * Save the column meta data to data set handle.
 * @param dataSetHandle
 * @param holdEvent
 */
public static void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent){
  DataService.getInstance().updateColumnCache(dataSetHandle,holdEvent);
}

Fixed version (ground truth):
/** 
 * Save the column meta data to data set handle.
 * @param dataSetHandle
 * @param holdEvent
 */
public static void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent){
  try {
    DataService.getInstance().updateColumnCache(dataSetHandle,holdEvent);
  }
 catch (  BirtException ex) {
    logger.entering(DataSetUIUtil.class.getName(),"String_Node_Str",new Object[]{ex});
  }
}
Program: 67980
Project: 67980
Buggy source:
public void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent){
  provider.updateColumnCache(dataSetHandle,holdEvent);
}

Fixed version (ground truth):
public void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent) throws BirtException {
  provider.updateColumnCache(dataSetHandle,holdEvent);
}
Program: 67981
Project: 67981
Buggy source:
void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent);

Fixed version (ground truth):
void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent) throws BirtException ;
Program: 67982
Project: 67982
Buggy source:
public void selectArea(boolean selected,Object data){
  if (data instanceof Object[]) {
    Object[] array=(Object[])data;
    seriesdefinition=(SeriesDefinition)array[0];
    query=(Query)array[1];
    updateText(query.getDefinition());
    DataDefinitionTextManager.getInstance().addDataDefinitionText(getInputControl(),this);
    if (fAggEditorComposite != null) {
      fAggEditorComposite.setAggregation(query,seriesdefinition);
    }
  }
}

Fixed version (ground truth):
public void selectArea(boolean selected,Object data){
  if (data instanceof Object[]) {
    Object[] array=(Object[])data;
    seriesdefinition=(SeriesDefinition)array[0];
    query=(Query)array[1];
    updateText(query.getDefinition());
    DataDefinitionTextManager.getInstance().addDataDefinitionText(getInputControl(),this);
    setTooltipForInputControl();
    if (fAggEditorComposite != null) {
      fAggEditorComposite.setAggregation(query,seriesdefinition);
    }
  }
}
Program: 67984
Project: 67984
Buggy source:
/** 
 * Updates AutoScale by checking min or max
 * @param sc
 * @param oMinimum
 * @param oMaximum
 * @param rtc
 * @param ax
 * @throws ChartException
 */
public static void setNumberMinMaxToScale(AutoScale sc,Object oMinimum,Object oMaximum,final RunTimeContext rtc,final OneAxis ax) throws ChartException {
  if (oMinimum != null) {
    if (oMinimum instanceof NumberDataElement) {
      sc.setMinimum(new Double(((NumberDataElement)oMinimum).getValue()));
    }
 else {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.GENERATION,"String_Node_Str",new Object[]{sc.getMinimum(),ax.getModelAxis().getType().getName()},Messages.getResourceBundle(rtc.getULocale()));
    }
    sc.info.bMinimumFixed(true);
  }
  if (oMaximum != null) {
    if (oMaximum instanceof NumberDataElement) {
      sc.setMaximum(Double.valueOf(((NumberDataElement)oMaximum).getValue()));
    }
 else {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.GENERATION,"String_Node_Str",new Object[]{sc.getMaximum(),ax.getModelAxis().getType().getName()},Messages.getResourceBundle(rtc.getULocale()));
    }
    sc.info.bMaximumFixed(true);
  }
  if (sc.info.bMaximumFixed && sc.info.bMinimumFixed) {
    if (((Double)sc.getMinimum()).doubleValue() > ((Double)sc.getMaximum()).doubleValue()) {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.GENERATION,"String_Node_Str",new Object[]{sc.getMinimum(),sc.getMaximum()},Messages.getResourceBundle(rtc.getULocale()));
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates AutoScale by checking min or max
 * @param sc
 * @param oMinimum
 * @param oMaximum
 * @param rtc
 * @param ax
 * @throws ChartException
 */
public static void setNumberMinMaxToScale(AutoScale sc,Object oMinimum,Object oMaximum,final RunTimeContext rtc,final OneAxis ax) throws ChartException {
  if (oMinimum != null) {
    if (oMinimum instanceof NumberDataElement) {
      sc.setMinimum(new Double(((NumberDataElement)oMinimum).getValue()));
    }
 else {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.GENERATION,"String_Node_Str",new Object[]{oMinimum,ax.getModelAxis().getType().getName()},Messages.getResourceBundle(rtc.getULocale()));
    }
    sc.info.bMinimumFixed(true);
  }
  if (oMaximum != null) {
    if (oMaximum instanceof NumberDataElement) {
      sc.setMaximum(Double.valueOf(((NumberDataElement)oMaximum).getValue()));
    }
 else {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.GENERATION,"String_Node_Str",new Object[]{oMaximum,ax.getModelAxis().getType().getName()},Messages.getResourceBundle(rtc.getULocale()));
    }
    sc.info.bMaximumFixed(true);
  }
  if (sc.info.bMaximumFixed && sc.info.bMinimumFixed) {
    if (((Double)sc.getMinimum()).doubleValue() > ((Double)sc.getMaximum()).doubleValue()) {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.GENERATION,"String_Node_Str",new Object[]{sc.getMinimum(),sc.getMaximum()},Messages.getResourceBundle(rtc.getULocale()));
    }
  }
}
Program: 67985
Project: 67985
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public String toString(){
  if (eIsProxy())   return super.toString();
  StringBuffer result=new StringBuffer(super.toString());
  result.append("String_Node_Str");
  if (valueESet)   result.append(value);
 else   result.append("String_Node_Str");
  result.append(')');
  return result.toString();
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 */
@Override public String toString(){
  if (eIsProxy())   return super.toString();
  StringBuffer result=new StringBuffer(this.getClass().getInterfaces()[0].getSimpleName());
  result.append("String_Node_Str");
  if (valueESet)   result.append(value);
 else   result.append("String_Node_Str");
  result.append(')');
  return result.toString();
}
Program: 67986
Project: 67986
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public String toString(){
  if (eIsProxy())   return super.toString();
  StringBuffer result=new StringBuffer(super.toString());
  result.append("String_Node_Str");
  if (valueESet)   result.append(value);
 else   result.append("String_Node_Str");
  result.append(')');
  return result.toString();
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 */
@Override public String toString(){
  if (eIsProxy())   return super.toString();
  StringBuffer result=new StringBuffer(this.getClass().getInterfaces()[0].getSimpleName());
  result.append("String_Node_Str");
  if (valueESet)   result.append(value);
 else   result.append("String_Node_Str");
  result.append(')');
  return result.toString();
}
Program: 67987
Project: 67987
Buggy source:
public void render() throws Exception {
  setupRenderOption();
  IContentEmitter emitter=createContentEmitter();
  String format=executionContext.getOutputFormat();
  IReportExecutor executor=new ReportletExecutor(executionContext,offset);
  executor=createRenderExtensionExecutor(executor);
  executor=new SuppressDuplciateReportExecutor(executor);
  executor=new LocalizedReportExecutor(executionContext,executor);
  executionContext.setExecutor(executor);
  initializeContentEmitter(emitter,executor);
  IReportLayoutEngine layoutEngine=createReportLayoutEngine(pagination,renderOptions);
  layoutEngine.setPageHandler(new LayoutPageHandler(((HTMLReportLayoutEngine)layoutEngine).getContext()));
  layoutEngine.setLocale(executionContext.getLocale());
  if (ExtensionManager.PAPER_SIZE_PAGINATION.equals(pagination)) {
    emitter=new LayoutEngine(executor,((HTMLReportLayoutEngine)layoutEngine).getContext(),emitter,renderOptions,executionContext.getLocale(),getDocumentTotalPage());
  }
  startRender();
  IReportContent report=executor.execute();
  emitter.start(report);
  layoutEngine.layout(executor,report,emitter,false);
  layoutEngine.close();
  emitter.end(report);
  closeRender();
  executor.close();
  outputPageCount=layoutEngine.getPageCount();
}

Fixed version (ground truth):
public void render() throws Exception {
  setupRenderOption();
  IContentEmitter emitter=createContentEmitter();
  String format=executionContext.getOutputFormat();
  IReportExecutor executor=new ReportletExecutor(executionContext,offset);
  executor=createRenderExtensionExecutor(executor);
  executor=new SuppressDuplciateReportExecutor(executor);
  executor=new LocalizedReportExecutor(executionContext,executor);
  executionContext.setExecutor(executor);
  initializeContentEmitter(emitter,executor);
  IReportLayoutEngine layoutEngine=createReportLayoutEngine(pagination,renderOptions);
  layoutEngine.setPageHandler(new LayoutPageHandler(((HTMLReportLayoutEngine)layoutEngine).getContext()));
  layoutEngine.setLocale(executionContext.getLocale());
  if (ExtensionManager.PAPER_SIZE_PAGINATION.equals(pagination)) {
    emitter=new LayoutEngine(executor,((HTMLReportLayoutEngine)layoutEngine).getContext(),emitter,renderOptions,executionContext,getDocumentTotalPage());
  }
  startRender();
  IReportContent report=executor.execute();
  emitter.start(report);
  layoutEngine.layout(executor,report,emitter,false);
  layoutEngine.close();
  emitter.end(report);
  closeRender();
  executor.close();
  outputPageCount=layoutEngine.getPageCount();
}
Program: 67989
Project: 67989
Buggy source:
public ILayout createLayout(ContainerArea parent,LayoutContext context,IContent content){
switch (content.getContentType()) {
case IContent.DATA_CONTENT:
case IContent.LABEL_CONTENT:
case IContent.TEXT_CONTENT:
    if (PropertyUtil.isInlineElement(content)) {
      DimensionType width=content.getWidth();
      if (width != null) {
        return new BlockTextArea(parent,context,content);
      }
 else {
        return new InlineTextArea(parent,context,content);
      }
    }
 else {
      return new BlockTextArea(parent,context,content);
    }
case IContent.IMAGE_CONTENT:
  return new ImageAreaLayout(parent,context,(IImageContent)content);
case IContent.AUTOTEXT_CONTENT:
int type=((IAutoTextContent)content).getType();
if (type == IAutoTextContent.TOTAL_PAGE || type == IAutoTextContent.UNFILTERED_TOTAL_PAGE) {
context.addUnresolvedContent(content);
return new TemplateAreaLayout(parent,context,content);
}
 else {
if (PropertyUtil.isInlineElement(content)) {
  return new InlineTextArea(parent,context,content);
}
 else {
  return new BlockTextArea(parent,context,content);
}
}
default :
return null;
}
}

Fixed version (ground truth):
public ILayout createLayout(ContainerArea parent,LayoutContext context,IContent content){
switch (content.getContentType()) {
case IContent.DATA_CONTENT:
case IContent.LABEL_CONTENT:
case IContent.TEXT_CONTENT:
    if (PropertyUtil.isInlineElement(content)) {
      DimensionType width=content.getWidth();
      if (width != null) {
        return new BlockTextArea(parent,context,content);
      }
 else {
        return new InlineTextArea(parent,context,content);
      }
    }
 else {
      return new BlockTextArea(parent,context,content);
    }
case IContent.IMAGE_CONTENT:
  return new ImageAreaLayout(parent,context,(IImageContent)content);
case IContent.AUTOTEXT_CONTENT:
int type=((IAutoTextContent)content).getType();
if ((type == IAutoTextContent.TOTAL_PAGE || type == IAutoTextContent.UNFILTERED_TOTAL_PAGE) && context.getEngineTaskType() != IEngineTask.TASK_RENDER) {
context.addUnresolvedContent(content);
return new TemplateAreaLayout(parent,context,content);
}
 else {
if (PropertyUtil.isInlineElement(content)) {
  return new InlineTextArea(parent,context,content);
}
 else {
  return new BlockTextArea(parent,context,content);
}
}
default :
return null;
}
}
Program: 67990
Project: 67990
Buggy source:
public void build() throws BirtException {
  IReportExecutor executor=executionContext.getExecutor();
  engine=LayoutEngineFactory.createLayoutEngine(ExtensionManager.PAGE_BREAK_PAGINATION);
  engine.setOption(EngineTask.TASK_TYPE,new Integer(IEngineTask.TASK_RUN));
  IReportContent report=executor.execute();
  if (executionContext.isFixedLayout() && engine instanceof HTMLReportLayoutEngine) {
    HTMLLayoutContext htmlContext=((HTMLReportLayoutEngine)engine).getContext();
    htmlContext.setFixedLayout(true);
    LayoutEngine pdfEmitter=new LayoutEngine(executor,htmlContext,outputEmitters,null,executionContext.getLocale(),0);
    pdfEmitter.setPageHandler(layoutPageHandler);
    initializeContentEmitter(pdfEmitter,executor);
    pdfEmitter.createPageHintGenerator();
    pdfEmitter.start(report);
    engine.layout(executor,report,pdfEmitter,true);
    engine.close();
    pdfEmitter.end(report);
  }
 else {
    engine.setPageHandler(layoutPageHandler);
    outputEmitters.start(report);
    engine.layout(executor,report,outputEmitters,true);
    engine.close();
    outputEmitters.end(report);
  }
  engine=null;
}

Fixed version (ground truth):
public void build() throws BirtException {
  IReportExecutor executor=executionContext.getExecutor();
  engine=LayoutEngineFactory.createLayoutEngine(ExtensionManager.PAGE_BREAK_PAGINATION);
  engine.setOption(EngineTask.TASK_TYPE,new Integer(IEngineTask.TASK_RUN));
  IReportContent report=executor.execute();
  if (executionContext.isFixedLayout() && engine instanceof HTMLReportLayoutEngine) {
    HTMLLayoutContext htmlContext=((HTMLReportLayoutEngine)engine).getContext();
    htmlContext.setFixedLayout(true);
    LayoutEngine pdfEmitter=new LayoutEngine(executor,htmlContext,outputEmitters,null,executionContext,0);
    pdfEmitter.setPageHandler(layoutPageHandler);
    initializeContentEmitter(pdfEmitter,executor);
    pdfEmitter.createPageHintGenerator();
    pdfEmitter.start(report);
    engine.layout(executor,report,pdfEmitter,true);
    engine.close();
    pdfEmitter.end(report);
  }
 else {
    engine.setPageHandler(layoutPageHandler);
    outputEmitters.start(report);
    engine.layout(executor,report,outputEmitters,true);
    engine.close();
    outputEmitters.end(report);
  }
  engine=null;
}
Program: 67991
Project: 67991
Buggy source:
private void exportEmbeddedImage(ImageHandle image,LibraryHandle libraryHandle) throws SemanticException {
  if (!(DesignChoiceConstants.IMAGE_REF_TYPE_EMBED.equals(image.getSource()))) {
    return;
  }
  EmbeddedImageHandle embeded=image.getEmbeddedImage();
  if (embeded == null) {
    return;
  }
  boolean notExist=ElementExportUtil.canExport(embeded,libraryHandle,false);
  if (!notExist) {
    int confirm=confirmOverride(null,Messages.getString("String_Node_Str"));
switch (confirm) {
case 0:
      break;
case 1:
{
      ElementExportUtil.exportElement((DesignElementHandle)image,libraryHandle,true);
      return;
    }
case 2:
default :
  cancelPressed();
return;
}
}
ElementExportUtil.exportElement((DesignElementHandle)image,libraryHandle,true);
ElementExportUtil.exportStructure(embeded,libraryHandle,true);
}

Fixed version (ground truth):
private boolean exportEmbeddedImage(ImageHandle image,LibraryHandle libraryHandle) throws SemanticException {
  if (!(DesignChoiceConstants.IMAGE_REF_TYPE_EMBED.equals(image.getSource()))) {
    return false;
  }
  EmbeddedImageHandle embeded=image.getEmbeddedImage();
  if (embeded == null) {
    return false;
  }
  boolean notExist=ElementExportUtil.canExport(embeded,libraryHandle,false);
  if (!notExist) {
    int confirm=confirmOverride(null,Messages.getString("String_Node_Str"));
switch (confirm) {
case 0:
      break;
case 1:
{
      ElementExportUtil.exportElement((DesignElementHandle)image,libraryHandle,true);
      return true;
    }
case 2:
default :
  cancelPressed();
return false;
}
}
ElementExportUtil.exportElement((DesignElementHandle)image,libraryHandle,true);
ElementExportUtil.exportStructure(embeded,libraryHandle,true);
return true;
}
Program: 67993
Project: 67993
Buggy source:
/** 
 * @param cx
 * @param expr1
 * @throws DataException 
 */
private static void prepareScriptExpression(ScriptContext cx,IBaseExpression expr1) throws DataException {
  try {
    if (expr1 == null)     return;
    if (expr1 instanceof IScriptExpression) {
      String exprText=((IScriptExpression)expr1).getText();
      if (expr1.getHandle() != null)       expr1.setHandle(new OLAPExpressionHandler(cx.compile(expr1.getScriptId(),null,0,exprText)));
    }
 else     if (expr1 instanceof IExpressionCollection) {
      Object[] exprs=((IExpressionCollection)expr1).getExpressions().toArray();
      for (int i=0; i < exprs.length; i++) {
        prepareScriptExpression(cx,(IBaseExpression)exprs[i]);
      }
    }
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}

Fixed version (ground truth):
/** 
 * @param cx
 * @param expr1
 * @throws DataException 
 */
private static void prepareScriptExpression(ScriptContext cx,IBaseExpression expr1) throws DataException {
  try {
    if (expr1 == null)     return;
    if (expr1 instanceof IScriptExpression) {
      String exprText=((IScriptExpression)expr1).getText();
      if (expr1.getHandle() == null)       expr1.setHandle(new OLAPExpressionHandler(cx.compile(expr1.getScriptId(),null,0,exprText)));
    }
 else     if (expr1 instanceof IExpressionCollection) {
      Object[] exprs=((IExpressionCollection)expr1).getExpressions().toArray();
      for (int i=0; i < exprs.length; i++) {
        prepareScriptExpression(cx,(IBaseExpression)exprs[i]);
      }
    }
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}
Program: 67994
Project: 67994
Buggy source:
public MirroredAggregationResultSet(IAggregationResultSet rs,int mirrorLevel,boolean breakHierarchy,List sortList) throws IOException {
  this.mirrorLevel=mirrorLevel;
  this.breakHierarchy=breakHierarchy;
  Member member=new Member();
  member.setKeyValues(new Object[]{"String_Node_Str"});
  this.rootNode=new MemberTreeNode(member);
  this.resultObject=new Object[rs.getLevelCount()];
  this.rs=rs;
  this.sortList=sortList;
  this.isTimeMirror=TimeMemberUtil.containsTimeMirror(rs,mirrorLevel);
  if (!isTimeMirror && breakHierarchy) {
    this.breakHierarchyList=new ArrayList[rs.getLevelCount() - mirrorLevel];
    for (int j=0; j < breakHierarchyList.length; j++) {
      breakHierarchyList[j]=new ArrayList();
    }
    populateMirror();
  }
 else {
    if (!breakHierarchy) {
      this.mirrorLevel=this.mirrorLevel - 1;
    }
    populateTimeMirror();
    nodeLength=getLength(this.rootNode);
    valueMapLength=0;
    Iterator iter=this.noBreakHierarchyKeyMap.entrySet().iterator();
    while (iter.hasNext()) {
      valueMapLength+=getLength((MemberTreeNode)((Entry)iter.next()).getValue());
    }
    this.length=nodeLength * valueMapLength;
  }
}

Fixed version (ground truth):
public MirroredAggregationResultSet(IAggregationResultSet rs,int mirrorLevel,boolean breakHierarchy,List sortList) throws IOException {
  this.mirrorLevel=mirrorLevel;
  this.breakHierarchy=breakHierarchy;
  Member member=new Member();
  member.setKeyValues(new Object[]{"String_Node_Str"});
  this.rootNode=new MemberTreeNode(member);
  this.resultObject=new Object[rs.getLevelCount()];
  this.rs=rs;
  this.sortList=sortList;
  this.isTimeMirror=TimeMemberUtil.containsTimeMirror(rs,mirrorLevel);
  if (!isTimeMirror && breakHierarchy) {
    this.breakHierarchyList=new ArrayList[rs.getLevelCount() - mirrorLevel];
    for (int j=0; j < breakHierarchyList.length; j++) {
      breakHierarchyList[j]=new ArrayList();
    }
    populateMirror();
  }
 else {
    if (!isTimeMirror && !breakHierarchy) {
      this.mirrorLevel=this.mirrorLevel - 1;
    }
    populateTimeMirror();
    nodeLength=getLength(this.rootNode);
    valueMapLength=0;
    Iterator iter=this.noBreakHierarchyKeyMap.entrySet().iterator();
    while (iter.hasNext()) {
      valueMapLength+=getLength((MemberTreeNode)((Entry)iter.next()).getValue());
    }
    this.length=nodeLength * valueMapLength;
  }
}
Program: 67996
Project: 67996
Buggy source:
public static MemberTreeNode[] createDayOfMonth(int year,int month){
  boolean isLeapYear=false;
  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
    isLeapYear=true;
  }
  MemberTreeNode[] nodes=new MemberTreeNode[0];
  if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
    nodes=new MemberTreeNode[31];
    for (int i=0; i < nodes.length; i++) {
      Member member=new Member();
      member.setKeyValues(new Object[]{new Integer(i)});
      nodes[i]=new MemberTreeNode(member);
    }
  }
 else   if (month == 2) {
    if (isLeapYear) {
      nodes=new MemberTreeNode[29];
      for (int i=0; i < nodes.length; i++) {
        Member member=new Member();
        member.setKeyValues(new Object[]{new Integer(i)});
        nodes[i]=new MemberTreeNode(member);
      }
    }
 else {
      nodes=new MemberTreeNode[28];
      for (int i=0; i < nodes.length; i++) {
        Member member=new Member();
        member.setKeyValues(new Object[]{new Integer(i)});
        nodes[i]=new MemberTreeNode(member);
      }
    }
  }
 else {
    nodes=new MemberTreeNode[30];
    for (int i=0; i < nodes.length; i++) {
      Member member=new Member();
      member.setKeyValues(new Object[]{new Integer(i)});
      nodes[i]=new MemberTreeNode(member);
    }
  }
  return nodes;
}

Fixed version (ground truth):
public static MemberTreeNode[] createDayOfMonth(int year,int month){
  boolean isLeapYear=false;
  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
    isLeapYear=true;
  }
  MemberTreeNode[] nodes=new MemberTreeNode[0];
  if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
    nodes=new MemberTreeNode[31];
    for (int i=1; i <= nodes.length; i++) {
      Member member=new Member();
      member.setKeyValues(new Object[]{new Integer(i)});
      nodes[i - 1]=new MemberTreeNode(member);
    }
  }
 else   if (month == 2) {
    if (isLeapYear) {
      nodes=new MemberTreeNode[29];
      for (int i=1; i <= nodes.length; i++) {
        Member member=new Member();
        member.setKeyValues(new Object[]{new Integer(i)});
        nodes[i - 1]=new MemberTreeNode(member);
      }
    }
 else {
      nodes=new MemberTreeNode[28];
      for (int i=1; i <= nodes.length; i++) {
        Member member=new Member();
        member.setKeyValues(new Object[]{new Integer(i)});
        nodes[i - 1]=new MemberTreeNode(member);
      }
    }
  }
 else {
    nodes=new MemberTreeNode[30];
    for (int i=1; i <= nodes.length; i++) {
      Member member=new Member();
      member.setKeyValues(new Object[]{new Integer(i)});
      nodes[i - 1]=new MemberTreeNode(member);
    }
  }
  return nodes;
}
Program: 67997
Project: 67997
Buggy source:
public void run(){
  if (previewPainter != null) {
    previewPainter.renderModel((IChartObject)getParameter(ChartLivePreviewThread.PARAM_CHART_MODEL));
  }
}

Fixed version (ground truth):
public void run(){
  if (previewPainter != null) {
    Chart cm=(Chart)getParameter(ChartLivePreviewThread.PARAM_CHART_MODEL);
    if (cm instanceof ChartWithAxes) {
      checkDataTypeForChartWithAxes();
    }
 else {
      ChartWizard.removeAllExceptions(ChartWizard.CheckSeriesBindingType_ID);
    }
    previewPainter.renderModel(cm);
  }
}
Program: 67998
Project: 67998
Buggy source:
public void doPreview(){
  LivePreviewTask lpt=new LivePreviewTask(Messages.getString("String_Node_Str"),null);
  lpt.addTask(new LivePreviewTask(){
    public void run(){
      if (previewPainter != null) {
        setParameter(ChartLivePreviewThread.PARAM_CHART_MODEL,ChartUIUtil.prepareLivePreview(getChartModel(),getDataServiceProvider(),((ChartWizardContext)context).getActionEvaluator()));
      }
    }
  }
);
  lpt.addTask(new LivePreviewTask(){
    public void run(){
      if (previewCanvas != null && previewCanvas.getDisplay() != null && !previewCanvas.getDisplay().isDisposed()) {
        previewCanvas.getDisplay().syncExec(new Runnable(){
          public void run(){
            if (previewPainter != null) {
              previewPainter.renderModel((IChartObject)getParameter(ChartLivePreviewThread.PARAM_CHART_MODEL));
            }
          }
        }
);
      }
    }
  }
);
  ((ChartLivePreviewThread)((ChartWizardContext)context).getLivePreviewThread()).setParentShell(getPreviewCanvas().getShell());
  ((ChartLivePreviewThread)((ChartWizardContext)context).getLivePreviewThread()).add(lpt);
}

Fixed version (ground truth):
public void doPreview(){
  LivePreviewTask lpt=new LivePreviewTask(Messages.getString("String_Node_Str"),null);
  lpt.addTask(new LivePreviewTask(){
    public void run(){
      if (previewPainter != null) {
        setParameter(ChartLivePreviewThread.PARAM_CHART_MODEL,ChartUIUtil.prepareLivePreview(getChartModel(),getDataServiceProvider(),((ChartWizardContext)context).getActionEvaluator()));
      }
    }
  }
);
  lpt.addTask(new LivePreviewTask(){
    public void run(){
      if (previewCanvas != null && previewCanvas.getDisplay() != null && !previewCanvas.getDisplay().isDisposed()) {
        previewCanvas.getDisplay().syncExec(new Runnable(){
          public void run(){
            if (previewPainter != null) {
              Chart cm=(Chart)getParameter(ChartLivePreviewThread.PARAM_CHART_MODEL);
              if (cm instanceof ChartWithAxes) {
                checkDataTypeForChartWithAxes();
              }
 else {
                ChartWizard.removeAllExceptions(ChartWizard.CheckSeriesBindingType_ID);
              }
              previewPainter.renderModel(cm);
            }
          }
        }
);
      }
    }
  }
);
  ((ChartLivePreviewThread)((ChartWizardContext)context).getLivePreviewThread()).setParentShell(getPreviewCanvas().getShell());
  ((ChartLivePreviewThread)((ChartWizardContext)context).getLivePreviewThread()).add(lpt);
}
Program: 67999
Project: 67999
Buggy source:
public static void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent){
}

Fixed version (ground truth):
public static void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent){
  try {
    if (dataSetHandle.getModuleHandle() instanceof ReportDesignHandle) {
      EngineConfig ec=new EngineConfig();
      ReportEngine engine=(ReportEngine)new ReportEngineFactory().createReportEngine(ec);
      ReportDesignHandle copy=(ReportDesignHandle)(dataSetHandle.getModuleHandle().copy().getHandle(null));
      DummyEngineTask engineTask=new DummyEngineTask(engine,new ReportEngineHelper(engine).openReportDesign(copy),copy);
      DataRequestSession session=engineTask.getDataSession();
      Map appContext=new HashMap();
      appContext.put(DataEngine.MEMORY_DATA_SET_CACHE,Integer.valueOf(dataSetHandle.getRowFetchLimit()));
      appContext.put(ResourceIdentifiers.ODA_APP_CONTEXT_KEY_CONSUMER_RESOURCE_IDS,createResourceIdentifiers());
      engineTask.setAppContext(appContext);
      engineTask.run();
      DataService.getInstance().registerSession(dataSetHandle,session);
      session.refreshMetaData(dataSetHandle,holdEvent);
      engineTask.close();
      engine.destroy();
    }
 else {
      DataSessionContext context=new DataSessionContext(DataEngineContext.DIRECT_PRESENTATION,dataSetHandle.getRoot(),null);
      Map appContext=new HashMap();
      appContext.put(DataEngine.MEMORY_DATA_SET_CACHE,Integer.valueOf(dataSetHandle.getRowFetchLimit()));
      appContext.put(ResourceIdentifiers.ODA_APP_CONTEXT_KEY_CONSUMER_RESOURCE_IDS,createResourceIdentifiers());
      context.setAppContext(appContext);
      DataRequestSession drSession=DataRequestSession.newSession(context);
      drSession.refreshMetaData(dataSetHandle,holdEvent);
      drSession.shutdown();
    }
  }
 catch (  BirtException ex) {
    ExceptionHandler.handle(ex);
  }
}
Program: 68001
Project: 68001
Buggy source:
@Override protected Composite createDropDown(Composite parent){
  Composite composite=new Composite(parent,SWT.BORDER | SWT.DOUBLE_BUFFERED);
  GridData gd=new GridData();
  gd.widthHint=CELL_WIDTH * 8 + MARGIN;
  gd.heightHint=CELL_HEIGHT * 8 + MARGIN;
  composite.setLayoutData(gd);
  composite.addListener(SWT.MouseDown,this);
  composite.addListener(SWT.FocusOut,this);
  composite.addListener(SWT.KeyDown,this);
  composite.addListener(SWT.Traverse,this);
  composite.addPaintListener(this);
  return composite;
}

Fixed version (ground truth):
@Override protected Composite createDropDown(Composite parent){
  Composite composite=new Composite(parent,SWT.BORDER | SWT.DOUBLE_BUFFERED);
  GridData gd=new GridData();
  gd.widthHint=CELL_WIDTH * 8 + MARGIN;
  gd.heightHint=CELL_HEIGHT * 8 + MARGIN;
  composite.setLayoutData(gd);
  composite.addListener(SWT.MouseDown,this);
  composite.addListener(SWT.FocusOut,this);
  composite.addListener(SWT.KeyDown,this);
  composite.addPaintListener(this);
  return composite;
}
Program: 68002
Project: 68002
Buggy source:
public void toggleDropDown(){
  if (dropDown == null || dropDown.isDisposed()) {
    Point pt=UIHelper.getScreenLocation(host);
    int x=pt.x;
    int y=pt.y + host.getSize().y;
    Shell shell=new Shell(host.getShell(),SWT.NONE);
    shell.setLayout(new GridLayout());
    shell.setLocation(x,y);
    dropDown=createDropDown(shell);
    dropDown.addListener(SWT.KeyDown,this);
    dropDown.addListener(SWT.FocusOut,this);
    shell.layout();
    shell.pack();
    shell.open();
  }
 else {
    dropDown.getShell().close();
  }
}

Fixed version (ground truth):
public void toggleDropDown(){
  if (dropDown == null || dropDown.isDisposed()) {
    Point pt=UIHelper.getScreenLocation(host);
    int x=pt.x;
    int y=pt.y + host.getSize().y;
    Shell shell=new Shell(host.getShell(),SWT.NONE);
    shell.setLayout(new GridLayout());
    shell.setLocation(x,y);
    dropDown=createDropDown(shell);
    shell.layout();
    shell.pack();
    shell.open();
  }
 else {
    dropDown.getShell().close();
  }
}
Program: 68003
Project: 68003
Buggy source:
public RDAggrValueHolder(DataInputStream valueStream) throws IOException, DataException {
  this.bindingName=IOUtil.readString(valueStream);
  populateRunningAggrInfo(valueStream);
  this.groupLevel=IOUtil.readInt(valueStream);
  this.size=IOUtil.readInt(valueStream);
  this.valueStream=valueStream;
  if (size > 0) {
    this.currentValue=IOUtil.readObject(valueStream);
  }
}

Fixed version (ground truth):
public RDAggrValueHolder(DataInputStream valueStream) throws IOException, DataException {
  this.bindingName=IOUtil.readString(valueStream);
  populateRunningAggrInfo(valueStream);
  this.groupLevel=IOUtil.readInt(valueStream);
  this.size=IOUtil.readInt(valueStream);
  this.valueStream=valueStream;
  if (size > 0) {
    this.currentValue=IOUtil.readObject(valueStream,DataEngineSession.getCurrentClassLoader());
  }
}
Program: 68004
Project: 68004
Buggy source:
public Object get(int index) throws IOException {
  if (index == groupInstanceIndex)   return currentValue;
  if (index < groupInstanceIndex || index >= size)   return null;
  while (groupInstanceIndex < index) {
    this.currentValue=IOUtil.readObject(valueStream);
    groupInstanceIndex++;
  }
  return this.currentValue;
}

Fixed version (ground truth):
public Object get(int index) throws IOException {
  if (index == groupInstanceIndex)   return currentValue;
  if (index < groupInstanceIndex || index >= size)   return null;
  while (groupInstanceIndex < index) {
    this.currentValue=IOUtil.readObject(valueStream,DataEngineSession.getCurrentClassLoader());
    groupInstanceIndex++;
  }
  return this.currentValue;
}
Program: 68005
Project: 68005
Buggy source:
/** 
 * @param value
 * @param parent with of parent, the unit is 1/1000 point.
 * @return
 */
public static int convertDimensionType(DimensionType value,float parent,float dpi){
  float INCH_PX=dpi;
  float PX_PT=INCH_PT / INCH_PX;
  if (value == null) {
    return (int)(parent * 1000);
  }
  if (DimensionType.UNITS_PERCENTAGE.equals(value.getUnits())) {
    return (int)(value.getMeasure() / 100 * parent);
  }
  if (DimensionType.UNITS_PX.equalsIgnoreCase(value.getUnits())) {
    return (int)(value.getMeasure() * PX_PT * 1000);
  }
  if (DimensionType.UNITS_EM.equalsIgnoreCase(value.getUnits()) || DimensionType.UNITS_EX.equalsIgnoreCase(value.getUnits())) {
    return (int)(value.getMeasure() * 12 * 1000);
  }
 else {
    return (int)(value.convertTo(DimensionType.UNITS_PT) * 1000);
  }
}

Fixed version (ground truth):
/** 
 * @param value
 * @param parent with of parent, the unit is 1/1000 point.
 * @return
 */
public static int convertDimensionType(DimensionType value,float parent,float dpi){
  float INCH_PX=dpi;
  float PX_PT=INCH_PT / INCH_PX;
  if (value == null) {
    return (int)(parent);
  }
  if (DimensionType.UNITS_PERCENTAGE.equals(value.getUnits())) {
    return (int)(value.getMeasure() / 100 * parent);
  }
  if (DimensionType.UNITS_PX.equalsIgnoreCase(value.getUnits())) {
    return (int)(value.getMeasure() * PX_PT * 1000);
  }
  if (DimensionType.UNITS_EM.equalsIgnoreCase(value.getUnits()) || DimensionType.UNITS_EX.equalsIgnoreCase(value.getUnits())) {
    return (int)(value.getMeasure() * 12 * 1000);
  }
 else {
    return (int)(value.convertTo(DimensionType.UNITS_PT) * 1000);
  }
}
Program: 68006
Project: 68006
Buggy source:
public ImageData(IImageContent image,int styleId,int datatype,Image imageInfo,XlsContainer currentContainer,int heightDpi,int widthDpi){
  super();
  this.dataType=datatype;
  this.styleId=styleId;
  height=ExcelUtil.convertDimensionType(image.getHeight(),imageInfo.getHeight() * ExcelUtil.INCH_PT / heightDpi,heightDpi) / 1000;
  imageHeight=(int)height;
  int imageWidth=(int)ExcelUtil.convertDimensionType(image.getWidth(),imageInfo.getWidth() * 1000 * ExcelUtil.INCH_PT / widthDpi,widthDpi);
  width=Math.min(currentContainer.getSizeInfo().getWidth(),imageWidth);
  altText=image.getAltText();
  imageUrl=image.getURI();
  this.imageData=imageInfo.getData();
  rowSpanInDesign=0;
  this.imageInfo=imageInfo;
}

Fixed version (ground truth):
public ImageData(IImageContent image,int styleId,int datatype,Image imageInfo,XlsContainer currentContainer,int heightDpi,int widthDpi){
  super();
  this.dataType=datatype;
  this.styleId=styleId;
  height=ExcelUtil.convertDimensionType(image.getHeight(),imageInfo.getHeight() * 1000 * ExcelUtil.INCH_PT / heightDpi,heightDpi) / 1000;
  imageHeight=(int)height;
  int imageWidth=(int)ExcelUtil.convertDimensionType(image.getWidth(),imageInfo.getWidth() * 1000 * ExcelUtil.INCH_PT / widthDpi,widthDpi);
  width=Math.min(currentContainer.getSizeInfo().getWidth(),imageWidth);
  altText=image.getAltText();
  imageUrl=image.getURI();
  this.imageData=imageInfo.getData();
  rowSpanInDesign=0;
  this.imageInfo=imageInfo;
}
Program: 68008
Project: 68008
Buggy source:
/** 
 * Adds the externalized property configuration id for use by  a BIRT consumer application's propertyProvider extension.
 */
private void addPropertyConfigurationId(OdaDataSourceDesign dteSource) throws BirtException {
  String configIdValue=dteSource.getExtensionID() + Constants.ODA_PROP_CONFIG_KEY_SEPARATOR + dteSource.getName();
  dteSource.addPublicProperty(Constants.ODA_PROP_CONFIGURATION_ID,configIdValue);
}

Fixed version (ground truth):
/** 
 * Adds the externalized property configuration id for use by  a BIRT consumer application's propertyProvider extension. Use the name not qualified name as configurationId.
 */
private void addPropertyConfigurationId(OdaDataSourceDesign dteSource,OdaDataSourceHandle sourceHandle) throws BirtException {
  String configIdValue=dteSource.getExtensionID() + Constants.ODA_PROP_CONFIG_KEY_SEPARATOR + sourceHandle.getName();
  dteSource.addPublicProperty(Constants.ODA_PROP_CONFIGURATION_ID,configIdValue);
}
Program: 68010
Project: 68010
Buggy source:
/** 
 * Adds the externalized property configuration id for use by  a BIRT consumer application's propertyProvider extension.
 */
private void addPropertyConfigurationId(OdaDataSourceDesign dteSource) throws BirtException {
  String configIdValue=dteSource.getExtensionID() + Constants.ODA_PROP_CONFIG_KEY_SEPARATOR + dteSource.getName();
  dteSource.addPublicProperty(Constants.ODA_PROP_CONFIGURATION_ID,configIdValue);
}

Fixed version (ground truth):
/** 
 * Adds the externalized property configuration id for use by  a BIRT consumer application's propertyProvider extension. Use the name not qualified name as configurationId.
 */
private void addPropertyConfigurationId(OdaDataSourceDesign dteSource,OdaDataSourceHandle sourceHandle) throws BirtException {
  String configIdValue=dteSource.getExtensionID() + Constants.ODA_PROP_CONFIG_KEY_SEPARATOR + sourceHandle.getName();
  dteSource.addPublicProperty(Constants.ODA_PROP_CONFIGURATION_ID,configIdValue);
}