nus-yam/ex-repair huggingface dataset:
Program: 68068
Project: 68068
Buggy source:
public void endContainer(IContainerContent container){
  boolean flag=hasForeignParent(container);
  if (flag) {
    if (!CSSConstants.CSS_INLINE_VALUE.equalsIgnoreCase(container.getComputedStyle().getDisplay())) {
      adjustInline();
    }
    if (!styles.isEmpty()) {
      styles.pop();
    }
    if (!inlineStyles.isEmpty()) {
      inlineStyles.pop();
    }
    if (!CSSConstants.CSS_INLINE_VALUE.equalsIgnoreCase(container.getComputedStyle().getDisplay())) {
      if (inForeign && hasPInside) {
        context.addContainer(false);
        hasPInside=false;
      }
 else {
        context.addContainer(true);
      }
      context.setLastIsTable(true);
    }
  }
}

Fixed version (ground truth):
public void endContainer(IContainerContent container){
  boolean flag=hasForeignParent(container);
  if (flag) {
    if (!CSSConstants.CSS_INLINE_VALUE.equalsIgnoreCase(container.getComputedStyle().getDisplay())) {
      adjustInline();
    }
    if (!styles.isEmpty()) {
      styles.pop();
    }
    if (!inlineStyles.isEmpty()) {
      inlineStyles.pop();
    }
    if (!CSSConstants.CSS_INLINE_VALUE.equalsIgnoreCase(container.getComputedStyle().getDisplay())) {
      if (inForeign && hasPInside) {
        context.addContainer(false);
        hasPInside=false;
      }
 else       if (!inForeign) {
        context.addContainer(true);
      }
      context.setLastIsTable(true);
    }
  }
}
Program: 68069
Project: 68069
Buggy source:
public void setUp() throws Exception {
  super.setUp();
  this.dataSet.setDistinctValue(true);
}

Fixed version (ground truth):
public void setUp() throws Exception {
  super.setUp();
}
Program: 68070
Project: 68070
Buggy source:
/** 
 * @throws Exception
 */
public void testBasic() throws Exception {
  QueryDefinition queryDefn=newReportQuery();
  String[] name=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  ScriptExpression[] se=new ScriptExpression[name.length];
  se[0]=new ScriptExpression("String_Node_Str");
  se[1]=new ScriptExpression("String_Node_Str");
  se[2]=new ScriptExpression("String_Node_Str");
  se[3]=new ScriptExpression("String_Node_Str");
  se[4]=new ScriptExpression("String_Node_Str");
  se[5]=new ScriptExpression("String_Node_Str");
  for (int i=0; i < name.length; i++)   queryDefn.addResultSetExpression(name[i],se[i]);
  IResultIterator ri=executeQuery(queryDefn);
  while (ri.next()) {
    String str="String_Node_Str";
    for (int i=0; i < name.length; i++) {
      str+=ri.getValue(name[i]);
      if (i < name.length - 1)       str+="String_Node_Str";
    }
    testPrintln(str);
  }
  checkOutputFile();
}

Fixed version (ground truth):
/** 
 * @throws Exception
 */
public void testBasic() throws Exception {
  this.dataSet.setDistinctValue(true);
  QueryDefinition queryDefn=newReportQuery();
  String[] name=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  ScriptExpression[] se=new ScriptExpression[name.length];
  se[0]=new ScriptExpression("String_Node_Str");
  se[1]=new ScriptExpression("String_Node_Str");
  se[2]=new ScriptExpression("String_Node_Str");
  se[3]=new ScriptExpression("String_Node_Str");
  se[4]=new ScriptExpression("String_Node_Str");
  se[5]=new ScriptExpression("String_Node_Str");
  for (int i=0; i < name.length; i++)   queryDefn.addResultSetExpression(name[i],se[i]);
  IResultIterator ri=executeQuery(queryDefn);
  while (ri.next()) {
    String str="String_Node_Str";
    for (int i=0; i < name.length; i++) {
      str+=ri.getValue(name[i]);
      if (i < name.length - 1)       str+="String_Node_Str";
    }
    testPrintln(str);
  }
  checkOutputFile();
}
Program: 68071
Project: 68071
Buggy source:
private void createPreviewArea(Composite composite){
  Composite previewArea=new Composite(composite,SWT.BORDER);
  GridData gd=new GridData(GridData.FILL_BOTH);
  gd.widthHint=250;
  gd.heightHint=200;
  previewArea.setLayoutData(gd);
  previewArea.setLayout(new FillLayout());
  previewCanvas=new IconCanvas(previewArea);
}

Fixed version (ground truth):
private void createPreviewArea(Composite composite){
  Composite previewArea=new Composite(composite,SWT.BORDER);
  GridData gd=new GridData(GridData.FILL_BOTH);
  gd.widthHint=250;
  gd.heightHint=200;
  previewArea.setLayoutData(gd);
  previewArea.setLayout(new FillLayout());
  previewCanvas=new IconCanvas(previewArea);
  previewCanvas.setSize(250,200);
}
Program: 68072
Project: 68072
Buggy source:
private void initURIEditor(){
  String uri="String_Node_Str";
  if (cursor.getImage().size() > 0) {
    uri=cursor.getImage().get(0).getURL();
  }
  txtUriEditor.setText(uri);
  txtUriEditor.setFocus();
  updateButtons();
  previewCanvas.pack();
  preview(removeQuote(txtUriEditor.getText()));
}

Fixed version (ground truth):
private void initURIEditor(){
  String uri="String_Node_Str";
  if (cursor.getImage().size() > 0) {
    uri=cursor.getImage().get(0).getURL();
  }
  txtUriEditor.setText(uri);
  txtUriEditor.setFocus();
  updateButtons();
  preview(removeQuote(txtUriEditor.getText()));
}
Program: 68075
Project: 68075
Buggy source:
/** 
 * get Cached metadata
 * @throws BirtException
 */
public DataSetViewData[] populateAllCachedMetaData(DataSetHandle dataSetHandle,DataRequestSession session) throws BirtException {
  IResultMetaData metaData=session.getDataSetMetaData(dataSetHandle,true);
  DataSetViewData[] items=new DataSetViewData[metaData.getColumnCount()];
  for (int i=0; i < metaData.getColumnCount(); i++) {
    items[i]=new DataSetViewData();
    items[i].setName(metaData.getColumnName(i + 1));
    items[i].setDataTypeName(DataAdapterUtil.adapterToModelDataType(metaData.getColumnType(i + 1)));
    items[i].setAlias(metaData.getColumnAlias(i + 1));
    items[i].setComputedColumn(metaData.isComputedColumn(i + 1));
    items[i].setPosition(i + 1);
    items[i].setDataType(metaData.getColumnType(i + 1));
    ColumnHintHandle hint=findColumnHint(dataSetHandle,items[i].getName());
    if (hint != null) {
      items[i].setAnalysis(hint.getAnalysis());
      items[i].setACLExpression(hint.getACLExpression());
      items[i].setFormat(hint.getFormat());
      items[i].setDisplayLength(hint.getDisplayLength());
      items[i].setHeading(hint.getHeading());
      items[i].setHelpText(hint.getHelpText());
      items[i].setHorizontalAlign(hint.getHorizontalAlign());
      items[i].setTextFormat(hint.getTextFormat());
      items[i].setDescription(hint.getDescription());
    }
  }
  return items;
}

Fixed version (ground truth):
/** 
 * get Cached metadata
 * @throws BirtException
 */
public DataSetViewData[] populateAllCachedMetaData(DataSetHandle dataSetHandle,DataRequestSession session) throws BirtException {
  IResultMetaData metaData=session.getDataSetMetaData(dataSetHandle,true);
  DataSetViewData[] items=new DataSetViewData[metaData.getColumnCount()];
  for (int i=0; i < metaData.getColumnCount(); i++) {
    items[i]=new DataSetViewData();
    items[i].setName(metaData.getColumnName(i + 1));
    items[i].setDataTypeName(DataAdapterUtil.adapterToModelDataType(metaData.getColumnType(i + 1)));
    items[i].setAlias(metaData.getColumnAlias(i + 1));
    items[i].setComputedColumn(metaData.isComputedColumn(i + 1));
    items[i].setPosition(i + 1);
    items[i].setDataType(metaData.getColumnType(i + 1));
    ColumnHintHandle hint=findColumnHint(dataSetHandle,items[i].getName());
    if (hint != null) {
      items[i].setAnalysis(hint.getAnalysis());
      items[i].setACLExpression(hint.getACLExpression());
      items[i].setFormat(hint.getFormat());
      items[i].setDisplayLength(hint.getDisplayLength());
      items[i].setHeading(hint.getHeading());
      items[i].setHelpText(hint.getHelpText());
      items[i].setHorizontalAlign(hint.getHorizontalAlign());
      items[i].setTextFormat(hint.getTextFormat());
      items[i].setDescription(hint.getDescription());
      items[i].setWordWrap(hint.wordWrap());
    }
  }
  return items;
}
Program: 68076
Project: 68076
Buggy source:
/** 
 * collection all custom properties
 * @param props
 * @return
 */
Properties collectCustomProperties(Properties props){
  if (props == null)   props=new Properties();
  props.setProperty(Constants.ODADriverClass,getDriverClass());
  props.setProperty(Constants.ODAURL,getDriverURL());
  props.setProperty(Constants.ODAUser,getODAUser());
  props.setProperty(Constants.ODAPassword,getODAPassword());
  props.setProperty(Constants.ODAJndiName,getODAJndiName());
  props=bidiSupportObj.addBidiProperties(props);
  return props;
}

Fixed version (ground truth):
/** 
 * collection all custom properties
 * @param props
 * @return
 */
Properties collectCustomProperties(Properties props){
  if (props == null)   props=new Properties();
  if (!EMPTY_STRING.equals(getDriverClass()))   props.setProperty(Constants.ODADriverClass,getDriverClass());
  if (!EMPTY_STRING.equals(getDriverURL()))   props.setProperty(Constants.ODAURL,getDriverURL());
  if (!EMPTY_STRING.equals(getODAUser()))   props.setProperty(Constants.ODAUser,getODAUser());
  if (!EMPTY_STRING.equals(getODAPassword()))   props.setProperty(Constants.ODAPassword,getODAPassword());
  if (!EMPTY_STRING.equals(getODAJndiName()))   props.setProperty(Constants.ODAJndiName,getODAJndiName());
  props=bidiSupportObj.addBidiProperties(props);
  return props;
}
Program: 68077
Project: 68077
Buggy source:
private void updateButtons(){
  getButton(IDialogConstants.OK_ID).setEnabled(true);
}

Fixed version (ground truth):
private void updateButtons(){
  boolean complete=txtUriEditor.getText() != null && txtUriEditor.getText().trim().length() > 0;
  if (complete) {
    try {
      new URL(removeQuote(txtUriEditor.getText().trim()));
    }
 catch (    Exception e) {
      complete=false;
    }
  }
  if (!complete) {
    previewCanvas.clear();
  }
  btnPreview.setEnabled(complete);
  getButton(IDialogConstants.OK_ID).setEnabled(complete);
}
Program: 68078
Project: 68078
Buggy source:
public void widgetSelected(SelectionEvent e){
  Object source=e.getSource();
  if (source == btnUriBuilder) {
    try {
      String sExpr=context.getUIServiceProvider().invoke(IUIServiceProvider.COMMAND_EXPRESSION_DATA_BINDINGS,txtUriEditor.getText(),context.getExtendedItem(),title.getText());
      txtUriEditor.setText(sExpr == null ? "String_Node_Str" : sExpr);
    }
 catch (    ChartException e1) {
      WizardBase.displayException(e1);
    }
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  Object source=e.getSource();
  if (source == btnPreview) {
    preview(removeQuote(txtUriEditor.getText()));
  }
}
Program: 68079
Project: 68079
Buggy source:
private void createInputArea(Composite parent){
  inputArea=new Composite(parent,SWT.NONE);
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  inputArea.setLayoutData(gd);
  GridLayout gl=new GridLayout();
  gl.numColumns=2;
  inputArea.setLayout(gl);
  title=new Label(inputArea,SWT.NONE);
  gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.horizontalSpan=2;
  title.setLayoutData(gd);
  Label l=new Label(inputArea,SWT.NONE);
  gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.horizontalSpan=2;
  l.setLayoutData(gd);
  l.setText(Messages.getString("String_Node_Str"));
  txtUriEditor=new Text(inputArea,SWT.SINGLE | SWT.BORDER);
  txtUriEditor.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  txtUriEditor.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      updateButtons();
    }
  }
);
  txtUriEditor.addFocusListener(new FocusAdapter(){
    public void focusLost(    FocusEvent e){
      preview(removeQuote(txtUriEditor.getText()));
    }
  }
);
  btnUriBuilder=new Button(inputArea,SWT.PUSH);
  gd=new GridData();
  ChartUIUtil.setChartImageButtonSizeByPlatform(gd);
  btnUriBuilder.setLayoutData(gd);
  btnUriBuilder.setImage(UIHelper.getImage("String_Node_Str"));
  btnUriBuilder.addSelectionListener(this);
  btnUriBuilder.setToolTipText(org.eclipse.birt.chart.ui.i18n.Messages.getString("String_Node_Str"));
}

Fixed version (ground truth):
private void createInputArea(Composite parent){
  inputArea=new Composite(parent,SWT.NONE);
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  inputArea.setLayoutData(gd);
  GridLayout gl=new GridLayout();
  gl.numColumns=2;
  inputArea.setLayout(gl);
  title=new Label(inputArea,SWT.NONE);
  gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.horizontalSpan=2;
  title.setLayoutData(gd);
  Label l=new Label(inputArea,SWT.NONE);
  gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.horizontalSpan=2;
  l.setLayoutData(gd);
  l.setText(Messages.getString("String_Node_Str"));
  txtUriEditor=new Text(inputArea,SWT.SINGLE | SWT.BORDER);
  txtUriEditor.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  txtUriEditor.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      updateButtons();
    }
  }
);
  txtUriEditor.addFocusListener(new FocusAdapter(){
    public void focusLost(    FocusEvent e){
      preview(removeQuote(txtUriEditor.getText()));
    }
  }
);
  btnPreview=new Button(inputArea,SWT.NONE);
  gd=new GridData();
  btnPreview.setLayoutData(gd);
  btnPreview.addSelectionListener(this);
  btnPreview.setText(Messages.getString("String_Node_Str"));
}
Program: 68080
Project: 68080
Buggy source:
private void updateButtons(){
  boolean complete=uriEditor.getText() != null && uriEditor.getText().trim().length() > 0;
  URL url=null;
  try {
    url=new URL(removeQuote(uriEditor.getText().trim()));
    if (selectedType == EMBEDDED_TYPE) {
      File file=new File(url.getPath());
      complete=file.exists() && file.isAbsolute();
    }
  }
 catch (  Exception e) {
    complete=false;
  }
  previewButton.setEnabled(complete);
  getButton(IDialogConstants.OK_ID).setEnabled(complete);
  browseButton.setVisible(embedded.getSelection());
}

Fixed version (ground truth):
private void updateButtons(){
  boolean complete=uriEditor.getText() != null && uriEditor.getText().trim().length() > 0;
  URL url=null;
  try {
    url=new URL(removeQuote(uriEditor.getText().trim()));
    if (selectedType == EMBEDDED_TYPE) {
      File file=new File(url.getPath());
      complete=file.exists() && file.isAbsolute();
    }
  }
 catch (  Exception e) {
    complete=false;
  }
  previewButton.setEnabled(complete);
  getButton(IDialogConstants.OK_ID).setEnabled(complete);
  if (!complete) {
    previewCanvas.clear();
  }
  browseButton.setVisible(embedded.getSelection());
}
Program: 68081
Project: 68081
Buggy source:
private static void addAllBindingAsSortKey(IQueryDefinition queryDefn) throws DataException {
  if (!(queryDefn instanceof BaseQueryDefinition)) {
    return;
  }
  Set<String> sortedBinding=new HashSet<String>();
  List<ISortDefinition> sorts=queryDefn.getSorts();
  if (sorts != null) {
    for (    ISortDefinition sd : sorts) {
      List<String> bindingNames=ExpressionCompilerUtil.extractColumnExpression(sd.getExpression(),ExpressionUtil.ROW_INDICATOR);
      if (bindingNames != null) {
        for (        String bindingName : bindingNames) {
          sortedBinding.add(bindingName);
        }
      }
    }
  }
  Iterator bindings=queryDefn.getBindings().values().iterator();
  BaseQueryDefinition queryDefinition=((BaseQueryDefinition)queryDefn);
  while (bindings.hasNext()) {
    IBinding binding=(IBinding)bindings.next();
    if (!sortedBinding.contains(binding.getBindingName())) {
      SortDefinition sd=new SortDefinition();
      sd.setExpression(ExpressionUtil.createJSRowExpression(binding.getBindingName()));
      queryDefinition.addSort(sd);
    }
  }
}

Fixed version (ground truth):
private static void addAllBindingAsSortKey(IQueryDefinition queryDefn) throws DataException {
  if (!(queryDefn instanceof BaseQueryDefinition)) {
    return;
  }
  Set<String> sortedBinding=new HashSet<String>();
  List<ISortDefinition> sorts=queryDefn.getSorts();
  if (sorts != null) {
    for (    ISortDefinition sd : sorts) {
      List<String> bindingNames=ExpressionCompilerUtil.extractColumnExpression(sd.getExpression(),ExpressionUtil.ROW_INDICATOR);
      if (bindingNames != null && bindingNames.size() > 0) {
        for (        String bindingName : bindingNames) {
          sortedBinding.add(bindingName);
        }
      }
 else {
        if (sd.getColumn() != null)         sortedBinding.add(sd.getColumn());
      }
    }
  }
  Iterator bindings=queryDefn.getBindings().values().iterator();
  BaseQueryDefinition queryDefinition=((BaseQueryDefinition)queryDefn);
  while (bindings.hasNext()) {
    IBinding binding=(IBinding)bindings.next();
    if (!sortedBinding.contains(binding.getBindingName())) {
      SortDefinition sd=new SortDefinition();
      sd.setExpression(ExpressionUtil.createJSRowExpression(binding.getBindingName()));
      queryDefinition.addSort(sd);
    }
  }
}
Program: 68082
Project: 68082
Buggy source:
/** 
 * @param imageName
 * @param imageTitle
 * @param width
 * @param height
 * @param x
 * @param y
 */
private void exportImageDefn(String imageName,String imageTitle,double width,double height,double x,double y,String link){
  println("String_Node_Str" + (shapeCount) + "String_Node_Str");
  if (link != null) {
    link=codeLink(link);
    print("String_Node_Str" + link + "String_Node_Str");
  }
  println("String_Node_Str" + x + "String_Node_Str"+ y+ "String_Node_Str"+ width+ "String_Node_Str"+ height+ "String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str" + imageName + "String_Node_Str"+ imageTitle+ "String_Node_Str");
  println("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  println("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param imageName
 * @param imageTitle
 * @param width
 * @param height
 * @param x
 * @param y
 */
private void exportImageDefn(String imageName,String imageTitle,double width,double height,double x,double y,HyperlinkDef link){
  println("String_Node_Str" + (shapeCount) + "String_Node_Str");
  if (link != null) {
    String hyperlink=link.getLink();
    String tooltip=link.getTooltip();
    if (tooltip != null) {
      tooltip=codeLink(tooltip);
      print("String_Node_Str" + tooltip + "String_Node_Str");
    }
    if (hyperlink != null) {
      hyperlink=codeLink(hyperlink);
      print("String_Node_Str" + link + "String_Node_Str");
    }
  }
  println("String_Node_Str" + x + "String_Node_Str"+ y+ "String_Node_Str"+ width+ "String_Node_Str"+ height+ "String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str" + imageName + "String_Node_Str"+ imageTitle+ "String_Node_Str");
  println("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  println("String_Node_Str");
}
Program: 68084
Project: 68084
Buggy source:
public void drawImage(String imageId,byte[] imageData,String extension,float imageX,float imageY,float height,float width,String helpText,String link) throws Exception {
  ImageInfo imageInfo=getImageInfo(imageId,imageData,extension);
  exportImageDefn(imageInfo.imageName,imageInfo.imageId,width,height,imageX,imageY,link);
}

Fixed version (ground truth):
public void drawImage(String imageId,byte[] imageData,String extension,float imageX,float imageY,float height,float width,String helpText,HyperlinkDef link) throws Exception {
  ImageInfo imageInfo=getImageInfo(imageId,imageData,extension);
  exportImageDefn(imageInfo.imageName,imageInfo.imageId,width,height,imageX,imageY,link);
}
Program: 68085
Project: 68085
Buggy source:
public void setLink(String link){
  this.link=link;
}

Fixed version (ground truth):
public void setLink(HyperlinkDef link){
  this.link=link;
}
Program: 68086
Project: 68086
Buggy source:
public static String getHyperlink(IArea area,IEmitterServices services,IReportRunnable reportRunnable,IReportContext context){
  IHyperlinkAction hyperlinkAction=area.getAction();
  if (hyperlinkAction != null) {
    try {
      if (hyperlinkAction.getType() != IHyperlinkAction.ACTION_BOOKMARK) {
        String link=hyperlinkAction.getHyperlink();
        Object handler=services.getOption(RenderOption.ACTION_HANDLER);
        if (handler != null && handler instanceof IHTMLActionHandler) {
          IHTMLActionHandler actionHandler=(IHTMLActionHandler)handler;
          String systemId=reportRunnable == null ? null : reportRunnable.getReportName();
          Action action=new Action(systemId,hyperlinkAction);
          link=actionHandler.getURL(action,context);
        }
        return link;
      }
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
    }
  }
  return null;
}

Fixed version (ground truth):
public static HyperlinkDef getHyperlink(IArea area,IEmitterServices services,IReportRunnable reportRunnable,IReportContext context){
  IHyperlinkAction hyperlinkAction=area.getAction();
  if (hyperlinkAction != null) {
    try {
      if (hyperlinkAction.getType() != IHyperlinkAction.ACTION_BOOKMARK) {
        String link=hyperlinkAction.getHyperlink();
        String tooltip=hyperlinkAction.getTooltip();
        Object handler=services.getOption(RenderOption.ACTION_HANDLER);
        if (handler != null && handler instanceof IHTMLActionHandler) {
          IHTMLActionHandler actionHandler=(IHTMLActionHandler)handler;
          String systemId=reportRunnable == null ? null : reportRunnable.getReportName();
          Action action=new Action(systemId,hyperlinkAction);
          link=actionHandler.getURL(action,context);
        }
        return new HyperlinkDef(link,tooltip);
      }
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
    }
  }
  return null;
}
Program: 68087
Project: 68087
Buggy source:
private void outputData(int type,Object value,StyleEntry style,int column,int colSpan,int rowSpan,int styleId,HyperlinkDef hyperLink,BookmarkDef linkedBookmark){
  startCell(column,colSpan,rowSpan,styleId,hyperLink,linkedBookmark);
  writeText(type,value,style);
  if (hyperLink != null && hyperLink.getToolTip() != null) {
    writeComments(hyperLink);
  }
  endCell();
}

Fixed version (ground truth):
private void outputData(int type,Object value,StyleEntry style,int column,int colSpan,int rowSpan,int styleId,HyperlinkDef hyperLink,BookmarkDef linkedBookmark){
  startCell(column,colSpan,rowSpan,styleId,hyperLink,linkedBookmark);
  writeText(type,value,style);
  endCell();
}
Program: 68088
Project: 68088
Buggy source:
private void startCell(int cellIndex,int colspan,int rowspan,int styleId,HyperlinkDef hyperLink,BookmarkDef linkedBookmark){
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",cellIndex);
  if (styleId > 0) {
    writer.attribute("String_Node_Str",styleId);
  }
  if (hyperLink != null) {
    String urlAddress=hyperLink.getUrl();
    if (hyperLink.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
      if (linkedBookmark != null)       urlAddress="String_Node_Str" + linkedBookmark.getValidName();
 else {
        logger.log(Level.WARNING,"String_Node_Str" + urlAddress + "String_Node_Str");
      }
    }
    if (urlAddress != null && urlAddress.length() >= 255) {
      logger.log(Level.WARNING,"String_Node_Str" + urlAddress + "String_Node_Str");
      urlAddress=urlAddress.substring(0,254);
    }
    writer.attribute("String_Node_Str",urlAddress);
  }
  if (colspan > 0) {
    writer.attribute("String_Node_Str",colspan);
  }
  if (rowspan > 0) {
    writer.attribute("String_Node_Str",rowspan);
  }
}

Fixed version (ground truth):
private void startCell(int cellIndex,int colspan,int rowspan,int styleId,HyperlinkDef hyperLink,BookmarkDef linkedBookmark){
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",cellIndex);
  if (styleId > 0) {
    writer.attribute("String_Node_Str",styleId);
  }
  if (hyperLink != null) {
    String urlAddress=hyperLink.getUrl();
    if (hyperLink.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
      if (linkedBookmark != null)       urlAddress="String_Node_Str" + linkedBookmark.getValidName();
 else {
        logger.log(Level.WARNING,"String_Node_Str" + urlAddress + "String_Node_Str");
      }
    }
    if (urlAddress != null && urlAddress.length() >= 255) {
      logger.log(Level.WARNING,"String_Node_Str" + urlAddress + "String_Node_Str");
      urlAddress=urlAddress.substring(0,254);
    }
    writer.attribute("String_Node_Str",urlAddress);
    if (hyperLink.getToolTip() != null) {
      writer.attribute("String_Node_Str",hyperLink.getToolTip());
    }
  }
  if (colspan > 0) {
    writer.attribute("String_Node_Str",colspan);
  }
  if (rowspan > 0) {
    writer.attribute("String_Node_Str",rowspan);
  }
}
Program: 68089
Project: 68089
Buggy source:
public DataExtractionTaskV1(ReportEngine engine,IReportDocument reader) throws EngineException {
  super(engine,IEngineTask.TASK_DATAEXTRACTION);
  IReportRunnable runnable=getOnPreparedRunnable(reader);
  setReportRunnable(runnable);
  ReportDocumentReader reportDocReaderImpl=(ReportDocumentReader)reader;
  Report reportIR=reportDocReaderImpl.getReportIR(executionContext.getReportDesign());
  executionContext.setReport(reportIR);
  this.report=executionContext.getReport();
  this.reportDocReader=reader;
  executionContext.setReportDocument(reportDocReader);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
  ClassLoader classLoader=executionContext.getApplicationClassLoader();
  ReportDocumentCoreInfo docInfo=reportDocReaderImpl.loadParametersAndVariables(classLoader);
  setParameters(docInfo.parameters);
  executionContext.registerGlobalBeans(docInfo.globalVariables);
}

Fixed version (ground truth):
public DataExtractionTaskV1(ReportEngine engine,IReportDocument reader) throws EngineException {
  super(engine,IEngineTask.TASK_DATAEXTRACTION);
  IReportRunnable runnable=getOnPreparedRunnable(reader);
  setReportRunnable(runnable);
  ReportDocumentReader reportDocReaderImpl=(ReportDocumentReader)reader;
  Report reportIR=reportDocReaderImpl.getReportIR(executionContext.getReportDesign());
  executionContext.setReport(reportIR);
  this.report=executionContext.getReport();
  this.reportDocReader=reader;
  executionContext.setReportDocument(reportDocReader);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
  ClassLoader classLoader=executionContext.getApplicationClassLoader();
  ReportDocumentCoreInfo docInfo=reportDocReaderImpl.loadParametersAndVariables(classLoader);
  setParameters(docInfo.parameters);
  usingParameterValues();
  executionContext.registerGlobalBeans(docInfo.globalVariables);
}
Program: 68090
Project: 68090
Buggy source:
public ReportDocumentCoreInfo loadParametersAndVariables(ClassLoader loader){
  ReportDocumentCoreInfo reportDocInfo=null;
  if (bodyData == null) {
    reportDocInfo=loadCoreStream(loader);
  }
 else {
    try {
      reportDocInfo=new ReportDocumentCoreInfo();
      readCoreStreamBodyFromBuffer(reportDocInfo,loader);
    }
 catch (    IOException ee) {
      logger.log(Level.SEVERE,ee.getLocalizedMessage(),ee);
      return null;
    }
  }
  return reportDocInfo;
}

Fixed version (ground truth):
public ReportDocumentCoreInfo loadParametersAndVariables(ClassLoader loader){
  ReportDocumentCoreInfo reportDocInfo=null;
  if (bodyData == null) {
    reportDocInfo=loadCoreStream(loader);
  }
 else {
    try {
      reportDocInfo=new ReportDocumentCoreInfo();
      reportDocInfo.checkpoint=CHECKPOINT_END;
      readCoreStreamBodyFromBuffer(reportDocInfo,loader);
    }
 catch (    IOException ee) {
      logger.log(Level.SEVERE,ee.getLocalizedMessage(),ee);
      return null;
    }
  }
  return reportDocInfo;
}
Program: 68091
Project: 68091
Buggy source:
public ITreeNode getTOCTree(ClassLoader loader) throws EngineException {
  try {
    TOCReader tocReader=new TOCReader(archive,loader);
    return tocReader.readTree();
  }
 catch (  IOException ex) {
    throw new EngineException("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
public ITreeNode getTOCTree(ClassLoader loader) throws EngineException {
  ReportDocumentCoreInfo documentInfo=loadParametersAndVariables(loader);
  ITOCReader tocReader=null;
  try {
    if (documentInfo.tocReader != null) {
      tocReader=documentInfo.tocReader;
    }
 else {
      tocReader=new TOCReader(archive,loader);
    }
    if (tocReader != null) {
      return tocReader.readTree();
    }
  }
 catch (  IOException ex) {
    throw new EngineException("String_Node_Str",ex);
  }
 finally {
    if (tocReader != null) {
      try {
        tocReader.close();
      }
 catch (      IOException ignored) {
      }
    }
  }
  return null;
}
Program: 68092
Project: 68092
Buggy source:
/** 
 * Pivots a measure in the given position to the specified position.
 * @param fromIndex
 * @param toIndex
 * @throws SemanticException
 */
public void pivotMeasure(int fromIndex,int toIndex) throws SemanticException {
  MeasureViewHandle measureView=getMeasure(fromIndex);
  if (measureView == null) {
    logger.log(Level.INFO,MessageConstants.CROSSTAB_EXCEPTION_MEASURE_NOT_FOUND,new Object[]{String.valueOf(fromIndex),handle.getElement().getIdentifier()});
    return;
  }
  measureView.handle.moveTo(toIndex);
}

Fixed version (ground truth):
/** 
 * Pivots a measure in the given position to the specified position.
 * @param fromIndex
 * @param toIndex
 * @throws SemanticException
 */
public void pivotMeasure(int fromIndex,int toIndex) throws SemanticException {
  MeasureViewHandle measureView=getMeasure(fromIndex);
  if (measureView == null) {
    logger.log(Level.INFO,MessageConstants.CROSSTAB_EXCEPTION_MEASURE_NOT_FOUND,String.valueOf(fromIndex));
    return;
  }
  measureView.handle.moveTo(toIndex);
}
Program: 68093
Project: 68093
Buggy source:
/** 
 * Inserts a measure into the given position. Position index is 0-based integer.
 * @param measureHandle the OLAP measure handle to use
 * @param index insert position, a 0-based integer
 * @return
 * @throws SemanticException
 */
public MeasureViewHandle insertMeasure(MeasureHandle measureHandle,int index) throws SemanticException {
  if (measureHandle != null && getMeasure(measureHandle.getQualifiedName()) != null) {
    logger.log(Level.SEVERE,MessageConstants.CROSSTAB_EXCEPTION_DUPLICATE_MEASURE,measureHandle.getQualifiedName());
    throw new CrosstabException(handle.getElement(),new String[]{measureHandle.getQualifiedName(),handle.getElement().getIdentifier()},MessageConstants.CROSSTAB_EXCEPTION_DUPLICATE_MEASURE);
  }
  CommandStack stack=getCommandStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  MeasureViewHandle mv=null;
  try {
    ExtendedItemHandle extendedItemHandle=CrosstabExtendedItemFactory.createMeasureView(moduleHandle,measureHandle);
    if (extendedItemHandle != null) {
      getMeasuresProperty().add(extendedItemHandle,index);
      new CrosstabReportItemTask(this).validateCrosstab();
      mv=(MeasureViewHandle)CrosstabUtil.getReportItem(extendedItemHandle);
    }
  }
 catch (  SemanticException e) {
    stack.rollback();
    throw e;
  }
  stack.commit();
  return mv;
}

Fixed version (ground truth):
/** 
 * Inserts a measure into the given position. Position index is 0-based integer.
 * @param measureHandle the OLAP measure handle to use
 * @param index insert position, a 0-based integer
 * @return
 * @throws SemanticException
 */
public MeasureViewHandle insertMeasure(MeasureHandle measureHandle,int index) throws SemanticException {
  if (measureHandle != null && getMeasure(measureHandle.getQualifiedName()) != null) {
    logger.log(Level.SEVERE,MessageConstants.CROSSTAB_EXCEPTION_DUPLICATE_MEASURE,measureHandle.getQualifiedName());
    throw new CrosstabException(handle.getElement(),Messages.getString(MessageConstants.CROSSTAB_EXCEPTION_DUPLICATE_MEASURE,measureHandle.getQualifiedName()));
  }
  CommandStack stack=getCommandStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  MeasureViewHandle mv=null;
  try {
    ExtendedItemHandle extendedItemHandle=CrosstabExtendedItemFactory.createMeasureView(moduleHandle,measureHandle);
    if (extendedItemHandle != null) {
      getMeasuresProperty().add(extendedItemHandle,index);
      new CrosstabReportItemTask(this).validateCrosstab();
      mv=(MeasureViewHandle)CrosstabUtil.getReportItem(extendedItemHandle);
    }
  }
 catch (  SemanticException e) {
    stack.rollback();
    throw e;
  }
  stack.commit();
  return mv;
}
Program: 68094
Project: 68094
Buggy source:
/** 
 * Inserts a dimension into the given position. Index is 0-based integer.
 * @param dimensionHandle the OLAP dimension handle to use
 * @param index insert position, a 0-based integer
 * @return
 * @throws SemanticException
 */
public DimensionViewHandle insertDimension(DimensionHandle dimensionHandle,int index) throws SemanticException {
  ExtendedItemHandle extendedItem=CrosstabExtendedItemFactory.createDimensionView(moduleHandle,dimensionHandle);
  if (extendedItem == null)   return null;
  if (dimensionHandle != null && getDimension(dimensionHandle.getQualifiedName()) != null) {
    logger.log(Level.SEVERE,MessageConstants.CROSSTAB_EXCEPTION_DUPLICATE_DIMENSION,dimensionHandle.getQualifiedName());
    throw new CrosstabException(handle.getElement(),new String[]{dimensionHandle.getQualifiedName(),handle.getElement().getIdentifier()},MessageConstants.CROSSTAB_EXCEPTION_DUPLICATE_DIMENSION);
  }
  getViewsProperty().add(extendedItem,index);
  return (DimensionViewHandle)CrosstabUtil.getReportItem(extendedItem);
}

Fixed version (ground truth):
/** 
 * Inserts a dimension into the given position. Index is 0-based integer.
 * @param dimensionHandle the OLAP dimension handle to use
 * @param index insert position, a 0-based integer
 * @return
 * @throws SemanticException
 */
public DimensionViewHandle insertDimension(DimensionHandle dimensionHandle,int index) throws SemanticException {
  ExtendedItemHandle extendedItem=CrosstabExtendedItemFactory.createDimensionView(moduleHandle,dimensionHandle);
  if (extendedItem == null)   return null;
  if (dimensionHandle != null && getDimension(dimensionHandle.getQualifiedName()) != null) {
    logger.log(Level.SEVERE,MessageConstants.CROSSTAB_EXCEPTION_DUPLICATE_DIMENSION,dimensionHandle.getQualifiedName());
    throw new CrosstabException(handle.getElement(),Messages.getString(MessageConstants.CROSSTAB_EXCEPTION_DUPLICATE_DIMENSION,dimensionHandle.getQualifiedName()));
  }
  getViewsProperty().add(extendedItem,index);
  return (DimensionViewHandle)CrosstabUtil.getReportItem(extendedItem);
}
Program: 68095
Project: 68095
Buggy source:
/** 
 * Moves the dimension view in the source position of source row/column to the target index in the target row/column. The axis type can be either <code>ICrosstabConstants.ROW_AXIS_TYPE</code> or <code>ICrosstabConstants.COLUMN_AXIS_TYPE</code>. And index is 0-based integer.
 * @param srcAxisType the source row/column axis type
 * @param srcIndex the source position index
 * @param targetAxisType row/column axis type of the move target
 * @param targetIndex the position index of the move target
 * @throws SemanticException
 */
public void pivotDimension(int srcAxisType,int srcIndex,int targetAxisType,int targetIndex) throws SemanticException {
  DimensionViewHandle dimensionView=crosstab.getDimension(srcAxisType,srcIndex);
  if (dimensionView == null) {
    crosstab.getLogger().log(Level.INFO,MessageConstants.CROSSTAB_EXCEPTION_DIMENSION_NOT_FOUND,new Object[]{String.valueOf(srcAxisType),String.valueOf(srcIndex)});
    return;
  }
  moveDimension(dimensionView,targetAxisType,targetIndex);
}

Fixed version (ground truth):
/** 
 * Moves the dimension view in the source position of source row/column to the target index in the target row/column. The axis type can be either <code>ICrosstabConstants.ROW_AXIS_TYPE</code> or <code>ICrosstabConstants.COLUMN_AXIS_TYPE</code>. And index is 0-based integer.
 * @param srcAxisType the source row/column axis type
 * @param srcIndex the source position index
 * @param targetAxisType row/column axis type of the move target
 * @param targetIndex the position index of the move target
 * @throws SemanticException
 */
public void pivotDimension(int srcAxisType,int srcIndex,int targetAxisType,int targetIndex) throws SemanticException {
  DimensionViewHandle dimensionView=crosstab.getDimension(srcAxisType,srcIndex);
  if (dimensionView == null) {
    crosstab.getLogger().log(Level.INFO,MessageConstants.CROSSTAB_EXCEPTION_DIMENSION_NOT_FOUND,String.valueOf(srcAxisType));
    return;
  }
  moveDimension(dimensionView,targetAxisType,targetIndex);
}
Program: 68096
Project: 68096
Buggy source:
/** 
 * Inserts a row/column dimension into the given position. The axis type can be either <code>ICrosstabConstants.ROW_AXIS_TYPE</code> or <code>ICrosstabConstants.COLUMN_AXIS_TYPE</code>. The index is 0-based integer.
 * @param dimensionHandle the OLAP dimension handle to use
 * @param axisType row/column axis type
 * @param index insert position, a 0-based integer
 * @return
 * @throws SemanticException
 */
public DimensionViewHandle insertDimension(DimensionHandle dimensionHandle,int axisType,int index) throws SemanticException {
  if (dimensionHandle != null && crosstab.getDimension(dimensionHandle.getQualifiedName()) != null) {
    crosstab.getLogger().log(Level.SEVERE,MessageConstants.CROSSTAB_EXCEPTION_DUPLICATE_DIMENSION,dimensionHandle.getQualifiedName());
    throw new CrosstabException(crosstab.getModelHandle().getElement(),new String[]{dimensionHandle.getQualifiedName(),crosstab.getModelHandle().getElement().getIdentifier()},MessageConstants.CROSSTAB_EXCEPTION_DUPLICATE_DIMENSION);
  }
  DimensionViewHandle dimensionView=null;
  CommandStack stack=crosstab.getCommandStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  try {
    CrosstabViewHandle crosstabView=crosstab.getCrosstabView(axisType);
    if (crosstabView == null) {
      crosstabView=crosstab.addCrosstabView(axisType);
    }
    dimensionView=crosstabView.insertDimension(dimensionHandle,index);
  }
 catch (  SemanticException e) {
    stack.rollback();
    throw e;
  }
  stack.commit();
  return dimensionView;
}

Fixed version (ground truth):
/** 
 * Inserts a row/column dimension into the given position. The axis type can be either <code>ICrosstabConstants.ROW_AXIS_TYPE</code> or <code>ICrosstabConstants.COLUMN_AXIS_TYPE</code>. The index is 0-based integer.
 * @param dimensionHandle the OLAP dimension handle to use
 * @param axisType row/column axis type
 * @param index insert position, a 0-based integer
 * @return
 * @throws SemanticException
 */
public DimensionViewHandle insertDimension(DimensionHandle dimensionHandle,int axisType,int index) throws SemanticException {
  if (dimensionHandle != null && crosstab.getDimension(dimensionHandle.getQualifiedName()) != null) {
    crosstab.getLogger().log(Level.SEVERE,MessageConstants.CROSSTAB_EXCEPTION_DUPLICATE_DIMENSION,dimensionHandle.getQualifiedName());
    throw new CrosstabException(crosstab.getModelHandle().getElement(),Messages.getString(MessageConstants.CROSSTAB_EXCEPTION_DUPLICATE_DIMENSION,dimensionHandle.getQualifiedName()));
  }
  DimensionViewHandle dimensionView=null;
  CommandStack stack=crosstab.getCommandStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  try {
    CrosstabViewHandle crosstabView=crosstab.getCrosstabView(axisType);
    if (crosstabView == null) {
      crosstabView=crosstab.addCrosstabView(axisType);
    }
    dimensionView=crosstabView.insertDimension(dimensionHandle,index);
  }
 catch (  SemanticException e) {
    stack.rollback();
    throw e;
  }
  stack.commit();
  return dimensionView;
}
Program: 68098
Project: 68098
Buggy source:
public void testGetParametersAndVariables() throws EngineException {
  String file="String_Node_Str";
  removeFile(REPORT_DOCUMENT);
  copyResource(file,REPORT_DOCUMENT);
  ReportDocumentReader document=(ReportDocumentReader)engine.openReportDocument(REPORT_DOCUMENT);
  IRenderTask renderTask=engine.createRenderTask(document);
  HashMap<String,String> expectedParamters=new HashMap<String,String>();
  expectedParamters.put("String_Node_Str","String_Node_Str");
  expectedParamters.put("String_Node_Str","String_Node_Str");
  Map<String,String> parameters=renderTask.getParameterValues();
  assertEquals(expectedParamters,parameters);
  HashMap<String,String> expectedVariables=new HashMap<String,String>();
  expectedVariables.put("String_Node_Str","String_Node_Str");
  expectedVariables.put("String_Node_Str","String_Node_Str");
  Map<String,String> globalVariables=document.getGlobalVariables(null,null);
  assertEquals(expectedVariables,globalVariables);
  renderTask.close();
}

Fixed version (ground truth):
public void testGetParametersAndVariables() throws EngineException {
  String file="String_Node_Str";
  removeFile(REPORT_DOCUMENT);
  copyResource(file,REPORT_DOCUMENT);
  ReportDocumentReader document=(ReportDocumentReader)engine.openReportDocument(REPORT_DOCUMENT);
  IRenderTask renderTask=engine.createRenderTask(document);
  HashMap<String,String> expectedParamters=new HashMap<String,String>();
  expectedParamters.put("String_Node_Str","String_Node_Str");
  expectedParamters.put("String_Node_Str","String_Node_Str");
  Map<String,String> parameters=renderTask.getParameterValues();
  assertEquals(expectedParamters,parameters);
  HashMap<String,String> expectedVariables=new HashMap<String,String>();
  renderTask.close();
}
Program: 68099
Project: 68099
Buggy source:
/** 
 * Loads parameters and global variables from report document. Since the application context is not available and application class loader can't be created when render task is initialized, loading parameters and global variables from document must be deferred until application context is available.
 */
protected void loadDocument(){
  if (!variablesLoaded) {
    ReportDocumentReader documentReader=(ReportDocumentReader)reportDocument;
    ClassLoader classLoader=executionContext.getApplicationClassLoader();
    ReportDocumentCoreInfo docInfo=documentReader.loadParametersAndVariables(classLoader);
    setParameters(docInfo.parameters);
    usingParameterValues();
    executionContext.registerGlobalBeans(docInfo.globalVariables);
    variablesLoaded=true;
  }
}

Fixed version (ground truth):
/** 
 * Loads parameters and global variables from report document. Since the application context is not available and application class loader can't be created when render task is initialized, loading parameters and global variables from document must be deferred until application context is available.
 */
protected void loadDocument(){
  if (!variablesLoaded) {
    ReportDocumentReader documentReader=(ReportDocumentReader)reportDocument;
    ClassLoader classLoader=executionContext.getApplicationClassLoader();
    ReportDocumentCoreInfo docInfo=documentReader.loadParametersAndVariables(classLoader);
    setParameters(docInfo.parameters);
    usingParameterValues();
    executionContext.registerGlobalBeans(docInfo.globalVariables);
    try {
      tocReader=documentReader.getTOCReader(classLoader);
    }
 catch (    EngineException e) {
      log.log(Level.SEVERE,e.getLocalizedMessage(),e);
    }
    variablesLoaded=true;
  }
}
Program: 68100
Project: 68100
Buggy source:
public ITOCTree getTOCTree() throws EngineException {
  loadDocument();
  IReportDocument document=executionContext.getReportDocument();
  String format=IRenderOption.OUTPUT_FORMAT_HTML;
  if (renderOptions != null) {
    String renderFormat=renderOptions.getOutputFormat();
    if (renderFormat != null) {
      format=renderFormat;
    }
  }
  ULocale ulocale=getULocale();
  TimeZone timeZone=getTimeZone();
  ReportDesignHandle design=executionContext.getReportDesign();
  if (document instanceof IInternalReportDocument) {
    ITreeNode tocTree=((IInternalReportDocument)document).getTOCTree(executionContext.getApplicationClassLoader());
    if (tocTree != null) {
      LogicalPageSequence visiblePages=loadVisiblePages();
      if (visiblePages != null) {
        return new TOCView(tocTree,design,ulocale,timeZone,format,new VisiblePageFilter(document,visiblePages));
      }
 else {
        return new TOCView(tocTree,design,ulocale,timeZone,format);
      }
    }
  }
  return TOCView.EMPTY_TOC_VIEW;
}

Fixed version (ground truth):
public ITOCTree getTOCTree() throws EngineException {
  loadDocument();
  IReportDocument document=executionContext.getReportDocument();
  String format=IRenderOption.OUTPUT_FORMAT_HTML;
  if (renderOptions != null) {
    String renderFormat=renderOptions.getOutputFormat();
    if (renderFormat != null) {
      format=renderFormat;
    }
  }
  ULocale ulocale=getULocale();
  TimeZone timeZone=getTimeZone();
  ReportDesignHandle design=executionContext.getReportDesign();
  if (document instanceof IInternalReportDocument) {
    ITreeNode tocTree=null;
    if (tocReader != null) {
      try {
        tocTree=tocReader.readTree();
      }
 catch (      IOException e) {
        throw new EngineException("String_Node_Str",e);
      }
    }
    if (tocTree != null) {
      LogicalPageSequence visiblePages=loadVisiblePages();
      if (visiblePages != null) {
        return new TOCView(tocTree,design,ulocale,timeZone,format,new VisiblePageFilter(document,visiblePages));
      }
 else {
        return new TOCView(tocTree,design,ulocale,timeZone,format);
      }
    }
  }
  return TOCView.EMPTY_TOC_VIEW;
}
Program: 68102
Project: 68102
Buggy source:
protected Data addDataContent(IDataContent data){
  float height=getContentHeight(data);
  HyperlinkDef url=parseHyperLink(data);
  BookmarkDef bookmark=getBookmark(data);
  Data excelData=null;
  Object generateBy=data.getGenerateBy();
  IStyle style=data.getComputedStyle();
  DataFormatValue dataformat=style.getDataFormat();
  MapDesign map=null;
  if (generateBy instanceof DataItemDesign) {
    DataItemDesign design=(DataItemDesign)generateBy;
    map=design.getMap();
  }
  if (map != null && map.getRuleCount() > 0 && data.getLabelText() != null) {
    excelData=engine.addData(data.getLabelText().trim(),style,url,bookmark,height);
  }
 else {
    String locale=null;
    int type=ExcelUtil.getType(data.getValue());
    if (type == SheetData.STRING) {
      if (dataformat != null) {
        locale=dataformat.getStringLocale();
      }
      excelData=engine.addData(data.getText(),style,url,bookmark,locale,height);
    }
 else     if (type == Data.NUMBER) {
      if (dataformat != null) {
        locale=dataformat.getNumberLocale();
      }
      excelData=engine.addData(data.getValue(),style,url,bookmark,locale,height);
    }
 else {
      if (dataformat != null) {
        locale=dataformat.getDateTimeLocale();
      }
      excelData=engine.addDateTime(data,style,url,bookmark,locale,height);
    }
  }
  return excelData;
}

Fixed version (ground truth):
protected Data addDataContent(IDataContent data){
  float height=getContentHeight(data);
  HyperlinkDef url=parseHyperLink(data);
  BookmarkDef bookmark=getBookmark(data);
  Data excelData=null;
  Object generateBy=data.getGenerateBy();
  IStyle style=data.getComputedStyle();
  DataFormatValue dataformat=style.getDataFormat();
  MapDesign map=null;
  if (generateBy instanceof DataItemDesign) {
    DataItemDesign design=(DataItemDesign)generateBy;
    map=design.getMap();
  }
  if (map != null && map.getRuleCount() > 0 && data.getLabelText() != null) {
    excelData=engine.addData(data.getText(),style,url,bookmark,height);
  }
 else {
    String locale=null;
    int type=ExcelUtil.getType(data.getValue());
    if (type == SheetData.STRING) {
      if (dataformat != null) {
        locale=dataformat.getStringLocale();
      }
      excelData=engine.addData(data.getText(),style,url,bookmark,locale,height);
    }
 else     if (type == Data.NUMBER) {
      if (dataformat != null) {
        locale=dataformat.getNumberLocale();
      }
      excelData=engine.addData(data.getValue(),style,url,bookmark,locale,height);
    }
 else {
      if (dataformat != null) {
        locale=dataformat.getDateTimeLocale();
      }
      excelData=engine.addDateTime(data,style,url,bookmark,locale,height);
    }
  }
  return excelData;
}