nus-yam/ex-repair huggingface dataset:
Program: 76178
Project: 76178
Buggy source:
/** 
 * Creates the table in custom page.
 * @param parent Parent contains the table.
 */
private void createTable(Composite parent){
  if (!isFormStyle())   table=new Table(parent,SWT.FULL_SELECTION | SWT.HIDE_SELECTION | SWT.BORDER);
 else   table=FormWidgetFactory.getInstance().createTable(parent,SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
  GridData data=new GridData(GridData.FILL_BOTH);
  data.horizontalSpan=2;
  if (pageAlignment == PAGE_ALIGN_HORIZONTAL) {
    data.widthHint=240;
  }
  table.setLayoutData(data);
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  table.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      formatCode.setText(provider.getPattern(((TableItem)e.item).getText(FORMAT_TYPE_INDEX)));
      updatePreview();
      notifyFormatChange();
    }
  }
);
  TableColumn tableColumValue=new TableColumn(table,SWT.NONE);
  tableColumValue.setText(LABEL_TABLE_COLUMN_EXAMPLE_FORMAT_CODE);
  tableColumValue.setWidth(120);
  tableColumValue.setResizable(true);
  TableColumn tableColumnDisplay=new TableColumn(table,SWT.NONE);
  tableColumnDisplay.setText(LABEL_TABLE_COLUMN_EXAMPLE_FORMAT_RESULT);
  tableColumnDisplay.setWidth(115);
  tableColumnDisplay.setResizable(true);
  String[][] items=provider.getTableItems();
  for (int i=0; i < items.length; i++) {
    new TableItem(table,SWT.NONE).setText(items[i]);
  }
}

Fixed version (ground truth):
/** 
 * Creates the table in custom page.
 * @param parent Parent contains the table.
 */
private void createTable(Composite parent){
  if (!isFormStyle())   table=new Table(parent,SWT.FULL_SELECTION | SWT.HIDE_SELECTION | SWT.BORDER);
 else   table=FormWidgetFactory.getInstance().createTable(parent,SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
  GridData data=new GridData(GridData.FILL_BOTH);
  data.horizontalSpan=2;
  if (pageAlignment == PAGE_ALIGN_HORIZONTAL) {
    data.widthHint=240;
  }
  table.setLayoutData(data);
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  table.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      formatCode.setText(((TableItem)e.item).getText(FORMAT_CODE_INDEX));
      updatePreview();
      notifyFormatChange();
    }
  }
);
  TableColumn tableColumValue=new TableColumn(table,SWT.NONE);
  tableColumValue.setText(LABEL_TABLE_COLUMN_EXAMPLE_FORMAT_NAME);
  tableColumValue.setWidth(120);
  tableColumValue.setResizable(true);
  TableColumn tableColumnDisplay=new TableColumn(table,SWT.NONE);
  tableColumnDisplay.setText(LABEL_TABLE_COLUMN_EXAMPLE_FORMAT_RESULT);
  tableColumnDisplay.setWidth(115);
  tableColumnDisplay.setResizable(true);
  TableColumn tableColumnFormatCode=new TableColumn(table,SWT.NONE);
  tableColumnFormatCode.setText(LABEL_TABLE_COLUMN_EXAMPLE_FORMAT_CODE);
  tableColumnFormatCode.setWidth(150);
  tableColumnFormatCode.setResizable(true);
  String[][] items=provider.getTableItems();
  for (int i=0; i < items.length; i++) {
    new TableItem(table,SWT.NONE).setText(items[i]);
  }
}
Program: 76179
Project: 76179
Buggy source:
public void widgetSelected(SelectionEvent e){
  formatCode.setText(provider.getPattern(((TableItem)e.item).getText(FORMAT_TYPE_INDEX)));
  updatePreview();
  notifyFormatChange();
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  formatCode.setText(((TableItem)e.item).getText(FORMAT_CODE_INDEX));
  updatePreview();
  notifyFormatChange();
}
Program: 76181
Project: 76181
Buggy source:
public void widgetSelected(SelectionEvent e){
  String displayName=((TableItem)e.item).getText(FORMAT_TYPE_INDEX);
  String category=ChoiceSetFactory.getStructPropValue(DateTimeFormatValue.FORMAT_VALUE_STRUCT,DateTimeFormatValue.CATEGORY_MEMBER,displayName);
  formatCode.setText(FormatDateTimePattern.getFormatCodeForCategory(category));
  updatePreview();
  notifyFormatChange();
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  formatCode.setText(((TableItem)e.item).getText(FORMAT_CODE_INDEX));
  updatePreview();
  notifyFormatChange();
}
Program: 76182
Project: 76182
Buggy source:
/** 
 * @return
 */
protected IModelAdapterHelper getModelAdaptHelper(){
  return helper;
}

Fixed version (ground truth):
/** 
 * @return
 */
public IModelAdapterHelper getModelAdaptHelper(){
  return helper;
}
Program: 76183
Project: 76183
Buggy source:
/** 
 * Remove cached adapter
 * @param obj Key to find the adapter
 */
public void remove(Object obj){
  removeRelated(obj);
  map.remove(obj);
}

Fixed version (ground truth):
/** 
 * Remove cached adapter
 * @param obj Key to find the adapter
 */
public void remove(Object obj){
  remove(obj,null);
}
Program: 76184
Project: 76184
Buggy source:
public void deactivate(){
  if (!isActive())   return;
  removeGuideFeedBack();
  super.deactivate();
  HandleAdapterFactory.getInstance().remove(getModel());
}

Fixed version (ground truth):
public void deactivate(){
  if (!isActive())   return;
  removeGuideFeedBack();
  super.deactivate();
  HandleAdapterFactory.getInstance().remove(getModel(),this);
}
Program: 76185
Project: 76185
Buggy source:
private void clearDefaultValueChooser(boolean isChecked){
  if (isChecked) {
    clearDefaultValueText();
    clearDefaultValueChooserSelections();
  }
 else {
    if (defaultValueChooser.getItemCount() > 0)     return;
    defaultValueChooser.add(CHOICE_NULL_VALUE);
    defaultValueChooser.add(CHOICE_BLANK_VALUE);
  }
}

Fixed version (ground truth):
private void clearDefaultValueChooser(boolean isChecked){
  if (defaultValueChooser == null || defaultValueChooser.isDisposed())   return;
  if (isChecked) {
    clearDefaultValueText();
    clearDefaultValueChooserSelections();
  }
 else {
    if (defaultValueChooser.getItemCount() > 0)     return;
    defaultValueChooser.add(CHOICE_NULL_VALUE);
    defaultValueChooser.add(CHOICE_BLANK_VALUE);
  }
}
Program: 76186
Project: 76186
Buggy source:
private void clearDefaultValueText(){
  if (defaultValueChooser == null)   return;
  String textValue=defaultValueChooser.getText();
  if (textValue != null && textValue.equals(CHOICE_NULL_VALUE) || textValue.equals(CHOICE_BLANK_VALUE)) {
    defaultValueChooser.setText("String_Node_Str");
  }
}

Fixed version (ground truth):
private void clearDefaultValueText(){
  String textValue=defaultValueChooser.getText();
  if (textValue != null && textValue.equals(CHOICE_NULL_VALUE) || textValue.equals(CHOICE_BLANK_VALUE)) {
    defaultValueChooser.setText("String_Node_Str");
  }
}
Program: 76187
Project: 76187
Buggy source:
private void clearDefaultValueChooserSelections(){
  if (defaultValueChooser == null)   return;
  if (defaultValueChooser.getItemCount() > 1) {
    defaultValueChooser.remove(1,defaultValueChooser.getItemCount() - 1);
  }
}

Fixed version (ground truth):
private void clearDefaultValueChooserSelections(){
  if (defaultValueChooser.getItemCount() > 1) {
    defaultValueChooser.remove(1,defaultValueChooser.getItemCount() - 1);
  }
}
Program: 76188
Project: 76188
Buggy source:
private void updateMessageLine(){
  String errorMessage=validateName();
  if (errorMessage == null) {
    if (!isStatic() && columnChooser != null && columnChooser.getItemCount() == 0) {
      errorMessage=ERROR_MSG_NO_AVAILABLE_COLUMN;
    }
 else     if (defaultValue == null && (PARAM_CONTROL_COMBO.equals(getSelectedControlType()) || DesignChoiceConstants.PARAM_CONTROL_RADIO_BUTTON.equals(getSelectedControlType()))) {
      if (!canBeNull() || !containValue(null,null,COLUMN_VALUE)) {
        errorMessage=ERROR_MSG_NO_DEFAULT_VALUE;
      }
    }
  }
  if (errorMessage != null) {
    errorMessageLine.setText(errorMessage);
    errorMessageLine.setImage(ERROR_ICON);
  }
 else {
    errorMessageLine.setText("String_Node_Str");
    errorMessageLine.setImage(null);
  }
  if (promptMessageLine != null && !promptMessageLine.isDisposed()) {
    if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(getSelectedDataType())) {
      promptMessageLine.setText(LABEL_DATETIME_PROMPT);
    }
 else {
      promptMessageLine.setText("String_Node_Str");
    }
  }
  updateButtons();
}

Fixed version (ground truth):
private void updateMessageLine(){
  String errorMessage=validateName();
  if (errorMessage == null) {
    if (!isStatic() && columnChooser != null && columnChooser.getItemCount() == 0) {
      errorMessage=ERROR_MSG_NO_AVAILABLE_COLUMN;
    }
    if (defaultValue == null && (PARAM_CONTROL_COMBO.equals(getSelectedControlType()) || DesignChoiceConstants.PARAM_CONTROL_RADIO_BUTTON.equals(getSelectedControlType()))) {
      errorMessage=canBeNull() ? null : ERROR_MSG_NO_DEFAULT_VALUE;
    }
  }
  if (errorMessage != null) {
    errorMessageLine.setText(errorMessage);
    errorMessageLine.setImage(ERROR_ICON);
  }
 else {
    errorMessageLine.setText("String_Node_Str");
    errorMessageLine.setImage(null);
  }
  if (promptMessageLine != null && !promptMessageLine.isDisposed()) {
    if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(getSelectedDataType())) {
      promptMessageLine.setText(LABEL_DATETIME_PROMPT);
    }
 else {
      promptMessageLine.setText("String_Node_Str");
    }
  }
  updateButtons();
}
Program: 76189
Project: 76189
Buggy source:
private void clearDefaultValueChooser(boolean isChecked){
  if (isChecked) {
    clearDefaultValueText();
    clearDefaultValueChooserSelections();
  }
 else {
    if (defaultValueChooser == null || defaultValueChooser.getItemCount() > 1)     return;
    defaultValueChooser.add(CHOICE_NULL_VALUE);
    defaultValueChooser.add(CHOICE_BLANK_VALUE);
  }
}

Fixed version (ground truth):
private void clearDefaultValueChooser(boolean isChecked){
  if (defaultValueChooser == null || defaultValueChooser.isDisposed())   return;
  if (isChecked) {
    clearDefaultValueText();
    clearDefaultValueChooserSelections();
  }
 else {
    if (defaultValueChooser == null || defaultValueChooser.getItemCount() > 1)     return;
    defaultValueChooser.add(CHOICE_NULL_VALUE);
    defaultValueChooser.add(CHOICE_BLANK_VALUE);
  }
}
Program: 76190
Project: 76190
Buggy source:
private void clearDefaultValueText(){
  if (defaultValueChooser == null)   return;
  String textValue=defaultValueChooser.getText();
  if (textValue != null && textValue.equals(CHOICE_NULL_VALUE) || textValue.equals(CHOICE_BLANK_VALUE)) {
    defaultValueChooser.setText("String_Node_Str");
  }
}

Fixed version (ground truth):
private void clearDefaultValueText(){
  String textValue=defaultValueChooser.getText();
  if (textValue != null && textValue.equals(CHOICE_NULL_VALUE) || textValue.equals(CHOICE_BLANK_VALUE)) {
    defaultValueChooser.setText("String_Node_Str");
  }
}
Program: 76191
Project: 76191
Buggy source:
private void clearDefaultValueChooserSelections(){
  if (defaultValueChooser == null)   return;
  if (defaultValueChooser.getItemCount() > 1) {
    defaultValueChooser.remove(CHOICE_NULL_VALUE);
    defaultValueChooser.remove(CHOICE_BLANK_VALUE);
  }
}

Fixed version (ground truth):
private void clearDefaultValueChooserSelections(){
  if (defaultValueChooser.getItemCount() > 1) {
    defaultValueChooser.remove(CHOICE_NULL_VALUE);
    defaultValueChooser.remove(CHOICE_BLANK_VALUE);
  }
}
Program: 76192
Project: 76192
Buggy source:
public Object getDefaultValue(String name){
  ReportDesignHandle report=(ReportDesignHandle)runnable.getDesignHandle();
  ScalarParameterHandle parameter=(ScalarParameterHandle)report.findParameter(name);
  if (parameter == null) {
    return null;
  }
  usingParameterValues();
  String expr=parameter.getDefaultValue();
  if (expr == null || expr.length() == 0) {
    return null;
  }
  return convertToType(expr,parameter.getDataType());
}

Fixed version (ground truth):
public Object getDefaultValue(String name){
  ReportDesignHandle report=(ReportDesignHandle)runnable.getDesignHandle();
  ScalarParameterHandle parameter=(ScalarParameterHandle)report.findParameter(name);
  if (parameter == null) {
    return null;
  }
  usingParameterValues();
  String expr=parameter.getDefaultValue();
  String dataType=parameter.getDataType();
  if (expr == null || (expr.length() == 0 && !DesignChoiceConstants.PARAM_TYPE_STRING.equals(dataType))) {
    return null;
  }
  return convertToType(expr,dataType);
}
Program: 76193
Project: 76193
Buggy source:
/** 
 * Close the container tag.
 */
public void closeContainerTag(){
  writer.openTag(HTMLTags.TAG_DIV);
}

Fixed version (ground truth):
/** 
 * Close the container tag.
 */
public void closeContainerTag(){
  writer.closeTag(HTMLTags.TAG_DIV);
}
Program: 76194
Project: 76194
Buggy source:
/** 
 * Close the container tag.
 */
public void closeContainerTag(){
  writer.openTag(HTMLTags.TAG_DIV);
  int display=((Integer)cellDisplayStack.pop()).intValue();
  if (((display & HTMLEmitterUtil.DISPLAY_INLINE) > 0) || ((display & HTMLEmitterUtil.DISPLAY_INLINE_BLOCK) > 0)) {
    closeInlineBoxTag();
  }
}

Fixed version (ground truth):
/** 
 * Close the container tag.
 */
public void closeContainerTag(){
  writer.closeTag(HTMLTags.TAG_DIV);
  int display=((Integer)cellDisplayStack.pop()).intValue();
  if (((display & HTMLEmitterUtil.DISPLAY_INLINE) > 0) || ((display & HTMLEmitterUtil.DISPLAY_INLINE_BLOCK) > 0)) {
    closeInlineBoxTag();
  }
}
Program: 76195
Project: 76195
Buggy source:
public void drawTotalPage(String text,float textX,float textY,float width,float height,TextStyle textInfo){
  drawText(text,textX,textY,width,height,textInfo.getFontInfo(),textInfo.getCharacterSpacing(),textInfo.getWordSpacing(),textInfo.getColor(),textInfo.isLinethrough(),textInfo.isOverline(),textInfo.isUnderline(),textInfo.getAlign(),true);
}

Fixed version (ground truth):
public void drawTotalPage(String text,float textX,float textY,float width,float height,TextStyle textInfo){
  if (totalPageTemplate != null)   drawText(text,textX,textY,width,height,textInfo.getFontInfo(),textInfo.getCharacterSpacing(),textInfo.getWordSpacing(),textInfo.getColor(),textInfo.isLinethrough(),textInfo.isOverline(),textInfo.isUnderline(),textInfo.getAlign(),true);
}
Program: 76197
Project: 76197
Buggy source:
public void startLabel(ILabelContent label){
  Object design=label.getGenerateBy();
  IContent container=label;
  while (design == null) {
    container=(IContent)container.getParent();
    design=((IContent)container).getGenerateBy();
  }
  String url=parseHyperLink(label);
  addData(design,label.getComputedStyle(),url,label.getText());
}

Fixed version (ground truth):
public void startLabel(ILabelContent label){
  Object design=label.getGenerateBy();
  IContent container=label;
  while (design == null) {
    container=(IContent)container.getParent();
    design=((IContent)container).getGenerateBy();
  }
  HyperlinkDef url=parseHyperLink(label);
  addData(design,label.getComputedStyle(),url,label.getText());
}
Program: 76198
Project: 76198
Buggy source:
public void startData(IDataContent data){
  String url=parseHyperLink(data);
  addData(data.getGenerateBy(),data.getComputedStyle(),url,data.getText());
}

Fixed version (ground truth):
public void startData(IDataContent data){
  HyperlinkDef url=parseHyperLink(data);
  addData(data.getGenerateBy(),data.getComputedStyle(),url,data.getText());
}
Program: 76199
Project: 76199
Buggy source:
public void startCell(ICellContent cell){
  CellDesign design=(CellDesign)cell.getGenerateBy();
  if (design.getContentCount() == 0) {
    addData(design,cell.getComputedStyle(),null,EMPTY);
  }
}

Fixed version (ground truth):
public void startCell(ICellContent cell){
  CellDesign design=(CellDesign)cell.getGenerateBy();
  if (design.getContentCount() == 0) {
    HyperlinkDef url=parseHyperLink(cell);
    addData(design,cell.getComputedStyle(),url,EMPTY);
  }
}
Program: 76200
Project: 76200
Buggy source:
/** 
 * Add an element's data to container.
 * @param design element's design
 * @param style element's style
 * @param url url defined on element
 * @param txt element's value
 */
private void addData(Object design,IStyle style,String url,String txt){
  Span span=(Span)design2ExcelSpan.get(design);
  if (span == null) {
    return;
  }
  StyleEntry entry=engine.getStyle(style,span);
  Data data=new Data(txt,INVALID,span,url,entry);
  for (int col=span.getCol(); col < span.getCol() + span.getColSpan() + 1; col++) {
    lb.add(col,data);
  }
  if (design instanceof DataItemDesign && tableBindings.size() > 0) {
    TableBinding tb=(TableBinding)tableBindings.peek();
    if (tb.isAggregateData(design)) {
      tb.add2DataList(design,data);
    }
 else {
      GroupInfo groupInfo=(GroupInfo)groupInfos.peek();
      int index=tb.getDataItemDesignIndex(design);
      groupInfo.addPosition(index,span.getCol(),lb.getListSize(span.getCol()));
    }
  }
  if (design instanceof DynamicTextItemDesign) {
    engine.calculateTopStyles();
  }
}

Fixed version (ground truth):
/** 
 * Add an element's data to container.
 * @param design element's design
 * @param style element's style
 * @param url url defined on element
 * @param txt element's value
 */
private void addData(Object design,IStyle style,HyperlinkDef url,String txt){
  Span span=(Span)design2ExcelSpan.get(design);
  if (span == null) {
    return;
  }
  StyleEntry entry=engine.getStyle(style,span);
  Data data=new Data(txt,INVALID,span,url,entry);
  for (int col=span.getCol(); col < span.getCol() + span.getColSpan() + 1; col++) {
    if (url != null && url.getBookmark() != null) {
      String cellID=convertCharacter(col) + (lb.getListSize(col) + 1);
      if (bookmarkList.get(url.getBookmark()) == null) {
        bookmarkList.put(url.getBookmark(),cellID);
      }
    }
    lb.add(col,data);
  }
  if (design instanceof DataItemDesign && tableBindings.size() > 0) {
    TableBinding tb=(TableBinding)tableBindings.peek();
    if (tb.isAggregateData(design)) {
      tb.add2DataList(design,data);
    }
 else {
      GroupInfo groupInfo=(GroupInfo)groupInfos.peek();
      int index=tb.getDataItemDesignIndex(design);
      groupInfo.addPosition(index,span.getCol(),lb.getListSize(span.getCol()));
    }
  }
  if (design instanceof DynamicTextItemDesign) {
    engine.calculateTopStyles();
  }
}
Program: 76201
Project: 76201
Buggy source:
public void startAutoText(IAutoTextContent autoText){
  String url=parseHyperLink(autoText);
  addData(autoText.getGenerateBy(),autoText.getComputedStyle(),url,autoText.getText());
}

Fixed version (ground truth):
public void startAutoText(IAutoTextContent autoText){
  HyperlinkDef url=parseHyperLink(autoText);
  addData(autoText.getGenerateBy(),autoText.getComputedStyle(),url,autoText.getText());
}
Program: 76202
Project: 76202
Buggy source:
private String parseHyperLink(IContent content){
  IHyperlinkAction linkaction=content.getHyperlinkAction();
  if (linkaction != null) {
    if (linkaction.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
      return linkaction.getBookmark().replaceAll("String_Node_Str","String_Node_Str");
    }
 else     if (linkaction.getType() == IHyperlinkAction.ACTION_HYPERLINK) {
      return linkaction.getHyperlink();
    }
 else     if (linkaction.getType() == IHyperlinkAction.ACTION_DRILLTHROUGH) {
      Action act=new Action(linkaction);
      IHTMLActionHandler actionHandler=null;
      Object ac=eservice.getOption(RenderOptionBase.ACTION_HANDLER);
      if (ac != null && ac instanceof IHTMLActionHandler) {
        actionHandler=(IHTMLActionHandler)ac;
        actionHandler.getURL(act,null);
        return actionHandler.getURL(act,eservice.getReportContext());
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private HyperlinkDef parseHyperLink(IContent content){
  IHyperlinkAction linkaction=content.getHyperlinkAction();
  if (linkaction != null) {
    if (linkaction.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
      return new HyperlinkDef(linkaction.getBookmark().replaceAll("String_Node_Str","String_Node_Str"),IHyperlinkAction.ACTION_BOOKMARK,null);
    }
 else     if (linkaction.getType() == IHyperlinkAction.ACTION_HYPERLINK) {
      return new HyperlinkDef(linkaction.getHyperlink(),IHyperlinkAction.ACTION_HYPERLINK,null);
    }
 else     if (linkaction.getType() == IHyperlinkAction.ACTION_DRILLTHROUGH) {
      Action act=new Action(linkaction);
      IHTMLActionHandler actionHandler=null;
      Object ac=eservice.getOption(RenderOptionBase.ACTION_HANDLER);
      if (ac != null && ac instanceof IHTMLActionHandler) {
        actionHandler=(IHTMLActionHandler)ac;
        actionHandler.getURL(act,null);
        return new HyperlinkDef(actionHandler.getURL(act,eservice.getReportContext()),IHyperlinkAction.ACTION_DRILLTHROUGH,null);
      }
    }
  }
 else   if (getBookMark(content) != null) {
    return getBookMark(content);
  }
  return null;
}
Program: 76203
Project: 76203
Buggy source:
private void writeDatas(ExcelWriter writer){
  try {
    Object[] os;
    lb.open();
    writer.startRow();
    writer.endRow();
    while (lb.more()) {
      writer.startRow();
      os=lb.readLine();
      for (int i=0; i < os.length; i++) {
        Data d=(Data)os[i];
        Object o=formulaDatas.get(d);
        if (o != null) {
          Data x=(Data)o;
          d.isTxtData=x.isTxtData;
          d.txt=x.txt;
        }
        if (d.isTxtData) {
          writer.writeTxtData(d);
        }
 else {
          writer.writeFormulaData(d);
        }
        i+=d.span.getColSpan();
      }
      writer.endRow();
    }
    lb.close();
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void writeDatas(ExcelWriter writer){
  try {
    Object[] os;
    lb.open();
    while (lb.more()) {
      writer.startRow();
      os=lb.readLine();
      for (int i=0; i < os.length; i++) {
        Data d=(Data)os[i];
        HyperlinkDef def=d.getHyperlinkDef();
        if (def != null && def.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
          def.setUrl((String)bookmarkList.get(def.getUrl()));
        }
        Object o=formulaDatas.get(d);
        if (o != null) {
          Data x=(Data)o;
          d.isTxtData=x.isTxtData;
          d.txt=x.txt;
        }
        if (d.isTxtData) {
          writer.writeTxtData(d);
        }
 else {
          writer.writeFormulaData(d);
        }
        i+=d.span.getColSpan();
      }
      writer.endRow();
    }
    lb.close();
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 76205
Project: 76205
Buggy source:
protected void dropSourceElementHandle(DesignElementHandle handle) throws SemanticException {
  if (handle.getContainer() != null) {
    if (DesignerConstants.TRACING_COMMANDS) {
      System.out.println("String_Node_Str" + DEUtil.getDisplayLabel(handle));
    }
    if (handle instanceof CellHandle) {
      dropSourceSlotHandle(((CellHandle)handle).getContent());
    }
 else     if (handle instanceof RowHandle) {
      new DeleteRowCommand(handle).execute();
    }
 else     if (handle instanceof ColumnHandle) {
      new DeleteColumnCommand(handle).execute();
    }
 else {
      handle.drop();
    }
  }
}

Fixed version (ground truth):
protected void dropSourceElementHandle(DesignElementHandle handle) throws SemanticException {
  if (handle.getContainer() != null) {
    if (DesignerConstants.TRACING_COMMANDS) {
      System.out.println("String_Node_Str" + DEUtil.getDisplayLabel(handle));
    }
    if (handle instanceof CellHandle) {
      dropSourceSlotHandle(((CellHandle)handle).getContent());
    }
 else     if (handle instanceof RowHandle) {
      new DeleteRowCommand(handle).execute();
    }
 else     if (handle instanceof ColumnHandle) {
      new DeleteColumnCommand(handle).execute();
    }
 else {
      handle.dropAndClear();
    }
  }
}
Program: 76206
Project: 76206
Buggy source:
Data(final String txt,final int styleId,final Span span,final String url,final StyleEntry s){
  this.txt=txt;
  this.span=span;
  this.styleId=styleId;
  this.url=url;
  this.style=s;
  id=ID++;
}

Fixed version (ground truth):
Data(final String txt,final int styleId,final Span span,final HyperlinkDef url,final StyleEntry s){
  this.txt=txt;
  this.span=span;
  this.styleId=styleId;
  this.url=url;
  this.style=s;
  id=ID++;
}
Program: 76207
Project: 76207
Buggy source:
public void startCell(int index,int colSpan,int rowSpan,int id,String hyperLink){
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",index);
  writer.attribute("String_Node_Str",id);
  if (hyperLink != null) {
    writer.attribute("String_Node_Str",hyperLink);
  }
  writer.attribute("String_Node_Str",colSpan);
  writer.attribute("String_Node_Str",rowSpan);
}

Fixed version (ground truth):
public void startCell(int index,int colSpan,int rowSpan,int id,HyperlinkDef hyperLink){
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",index);
  writer.attribute("String_Node_Str",id);
  if (hyperLink != null) {
    if (hyperLink.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
      writer.attribute("String_Node_Str","String_Node_Str" + hyperLink.getUrl());
    }
 else {
      writer.attribute("String_Node_Str",hyperLink.getUrl());
    }
  }
  writer.attribute("String_Node_Str",colSpan);
  writer.attribute("String_Node_Str",rowSpan);
}
Program: 76208
Project: 76208
Buggy source:
public Object[] getChildren(Object model){
  if (model instanceof ThemeHandle) {
    ThemeHandle theme=(ThemeHandle)model;
    int count, styleCount=0;
    styleCount+=(super.getChildrenBySlotHandle(((ThemeHandle)model).getStyles())).length;
    count=styleCount;
    count+=theme.getAllCssStyleSheets().size();
    Object obj[]=new Object[count];
    for (int i=0; i < styleCount; i++) {
      obj[i]=(super.getChildrenBySlotHandle(((ThemeHandle)model).getStyles()))[i];
    }
    for (int i=0; i < theme.getAllCssStyleSheets().size(); i++) {
      obj[styleCount + i]=(CssStyleSheetHandle)theme.getAllCssStyleSheets().get(i);
    }
    return obj;
  }
  return super.getChildren(model);
}

Fixed version (ground truth):
public Object[] getChildren(Object model){
  if (model instanceof ThemeHandle) {
    ThemeHandle theme=(ThemeHandle)model;
    int count, styleCount=0;
    styleCount+=(super.getChildrenBySlotHandle(((ThemeHandle)model).getStyles())).length;
    count=styleCount;
    count+=theme.getAllCssStyleSheets().size();
    Object obj[]=new Object[count];
    for (int i=0; i < styleCount; i++) {
      obj[i]=(super.getChildrenBySlotHandle(((ThemeHandle)model).getStyles()))[i];
    }
    for (int i=0; i < theme.getAllCssStyleSheets().size(); i++) {
      obj[styleCount + i]=(CssStyleSheetHandle)theme.getAllCssStyleSheets().get(i);
    }
    Arrays.sort(obj,new AlphabeticallyComparator());
    return obj;
  }
  return super.getChildren(model);
}
Program: 76209
Project: 76209
Buggy source:
/** 
 * Constructor. If config is null, engine derives BIRT_HOME from the location of the engine jar file, and derives data driver directory as $BIRT_HOME/drivers. For a simple report with no images and links, engine will run without complaining. If the report has image/chart defined, the engine has to be configured with relevant image and chart handlers.
 * @param config an engine configuration object used to configure the engine
 */
public ReportEngine(EngineConfig config){
  logger=intializeLogger();
  logger.log(Level.FINE,"String_Node_Str",config);
  this.config=config;
  this.helper=new ReportEngineHelper(this);
  setupScriptScope();
}

Fixed version (ground truth):
/** 
 * Constructor. If config is null, engine derives BIRT_HOME from the location of the engine jar file, and derives data driver directory as $BIRT_HOME/drivers. For a simple report with no images and links, engine will run without complaining. If the report has image/chart defined, the engine has to be configured with relevant image and chart handlers.
 * @param config an engine configuration object used to configure the engine
 */
public ReportEngine(EngineConfig config){
  this.config=config;
  logger=intializeLogger();
  logger.log(Level.FINE,"String_Node_Str",config);
  this.helper=new ReportEngineHelper(this);
  setupScriptScope();
}
Program: 76211
Project: 76211
Buggy source:
public HTMLEmitter(HTMLReportEmitter parentEmitter,HTMLWriter writer,boolean isEmbeddable,String layoutPreference){
  this.parentEmitter=parentEmitter;
  this.writer=writer;
  this.isEmbeddable=isEmbeddable;
  this.layoutPreference=layoutPreference;
}

Fixed version (ground truth):
public HTMLEmitter(HTMLReportEmitter parentEmitter,HTMLWriter writer,boolean isEmbeddable){
  this.parentEmitter=parentEmitter;
  this.writer=writer;
  this.isEmbeddable=isEmbeddable;
}
Program: 76212
Project: 76212
Buggy source:
public abstract void buildTableStyle(ITableContent table,StringBuffer styleBuffer);

Fixed version (ground truth):
public abstract void buildTableStyle(ITableContent table,StringBuffer styleBuffer,String layoutPreference);
Program: 76213
Project: 76213
Buggy source:
public HTMLPerformanceOptimize(HTMLReportEmitter parentEmitter,HTMLWriter writer,boolean isEmbeddable,String layoutPreference){
  super(parentEmitter,writer,isEmbeddable,layoutPreference);
}

Fixed version (ground truth):
public HTMLPerformanceOptimize(HTMLReportEmitter parentEmitter,HTMLWriter writer,boolean isEmbeddable){
  super(parentEmitter,writer,isEmbeddable);
}
Program: 76214
Project: 76214
Buggy source:
/** 
 * Build the style of table content
 */
public void buildTableStyle(ITableContent table,StringBuffer styleBuffer){
  IStyle style=table.getStyle();
  addDefaultTableStyles(styleBuffer);
  handleShrink(HTMLEmitterUtil.DISPLAY_BLOCK,style,table.getHeight(),table.getWidth(),styleBuffer);
  if (HTMLRenderOption.LAYOUT_PREFERENCE_FIXED.equals(layoutPreference)) {
    if ((null == style) || !"String_Node_Str".equalsIgnoreCase(style.getCanShrink())) {
      styleBuffer.append("String_Node_Str");
    }
  }
  buildStyle(table,styleBuffer);
}

Fixed version (ground truth):
/** 
 * Build the style of table content
 */
public void buildTableStyle(ITableContent table,StringBuffer styleBuffer,String layoutPreference){
  IStyle style=table.getStyle();
  addDefaultTableStyles(styleBuffer);
  handleShrink(HTMLEmitterUtil.DISPLAY_BLOCK,style,table.getHeight(),table.getWidth(),styleBuffer);
  if (HTMLRenderOption.LAYOUT_PREFERENCE_FIXED.equals(layoutPreference)) {
    if ((null == style) || !"String_Node_Str".equalsIgnoreCase(style.getCanShrink())) {
      styleBuffer.append("String_Node_Str");
    }
  }
  buildStyle(table,styleBuffer);
}
Program: 76216
Project: 76216
Buggy source:
/** 
 * Build the style of table content
 */
public void buildTableStyle(ITableContent table,StringBuffer styleBuffer){
  IStyle style=table.getStyle();
  addDefaultTableStyles(styleBuffer);
  DimensionType x=table.getX();
  DimensionType y=table.getY();
  int display=getElementType(x,y,null,null,style);
  setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_INLINE,styleBuffer);
  handleShrink(HTMLEmitterUtil.DISPLAY_BLOCK,style,table.getHeight(),table.getWidth(),styleBuffer);
  if (HTMLRenderOption.LAYOUT_PREFERENCE_FIXED.equals(layoutPreference)) {
    if ((null == style) || !"String_Node_Str".equalsIgnoreCase(style.getCanShrink())) {
      styleBuffer.append("String_Node_Str");
    }
  }
  buildStyle(table,styleBuffer);
}

Fixed version (ground truth):
/** 
 * Build the style of table content
 */
public void buildTableStyle(ITableContent table,StringBuffer styleBuffer,String layoutPreference){
  IStyle style=table.getStyle();
  addDefaultTableStyles(styleBuffer);
  DimensionType x=table.getX();
  DimensionType y=table.getY();
  int display=getElementType(x,y,null,null,style);
  setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_INLINE,styleBuffer);
  handleShrink(HTMLEmitterUtil.DISPLAY_BLOCK,style,table.getHeight(),table.getWidth(),styleBuffer);
  if (HTMLRenderOption.LAYOUT_PREFERENCE_FIXED.equals(layoutPreference)) {
    if ((null == style) || !"String_Node_Str".equalsIgnoreCase(style.getCanShrink())) {
      styleBuffer.append("String_Node_Str");
    }
  }
  buildStyle(table,styleBuffer);
}
Program: 76217
Project: 76217
Buggy source:
public HTMLVisionOptimize(HTMLReportEmitter parentEmitter,HTMLWriter writer,boolean isEmbeddable,String layoutPreference){
  super(parentEmitter,writer,isEmbeddable,layoutPreference);
}

Fixed version (ground truth):
public HTMLVisionOptimize(HTMLReportEmitter parentEmitter,HTMLWriter writer,boolean isEmbeddable){
  super(parentEmitter,writer,isEmbeddable);
}
Program: 76218
Project: 76218
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(AttributeBuilderTest.class);
  suite.addTestSuite(HTMLWriterTest.class);
  suite.addTestSuite(HTMLReportEmitterTest.class);
  suite.addTestSuite(MetadataEmitterTest.class);
  suite.addTestSuite(TableLayoutTest.class);
  suite.addTestSuite(ScriptTest.class);
  suite.addTestSuite(DrillThroughActionScriptTest.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(AttributeBuilderTest.class);
  suite.addTestSuite(HTMLWriterTest.class);
  suite.addTestSuite(HTMLReportEmitterTest.class);
  suite.addTestSuite(MetadataEmitterTest.class);
  suite.addTestSuite(TableLayoutTest.class);
  suite.addTestSuite(ScriptTest.class);
  suite.addTestSuite(DrillThroughActionScriptTest.class);
  suite.addTestSuite(HTMLEmitterOptimizeTest.class);
  return suite;
}
Program: 76219
Project: 76219
Buggy source:
/** 
 * @param dataType
 * @return
 */
private static boolean isDate(int dataType){
  return (dataType == DataType.DATE_TYPE);
}

Fixed version (ground truth):
/** 
 * @param dataType
 * @return
 */
private static boolean isDate(int dataType){
  return (dataType == DataType.DATE_TYPE || dataType == DataType.SQL_DATE_TYPE || dataType == DataType.SQL_TIME_TYPE);
}
Program: 76220
Project: 76220
Buggy source:
/** 
 * sets configuration for a specific extension to engine, i.e., an emitter extension
 * @param extensionID identifier for the emitter
 * @param extensionConfig configuration object for the emitter
 */
public void setEmitterConfiguration(String format,Object emitterConfig){
  getEmitterConfigs().put(format,emitterConfig);
}

Fixed version (ground truth):
/** 
 * sets configuration for a specific extension to engine, i.e., an emitter extension
 * @param extensionID identifier for the emitter
 * @param extensionConfig configuration object for the emitter, which must be an instance of HashMap or IRenderOption
 */
public void setEmitterConfiguration(String format,Object emitterConfig){
  if (emitterConfig instanceof HashMap) {
    getEmitterConfigs().put(format,new RenderOption((HashMap)emitterConfig));
  }
 else   if (emitterConfig instanceof IRenderOption) {
    getEmitterConfigs().put(format,emitterConfig);
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
}
Program: 76221
Project: 76221
Buggy source:
private static String convertApiTypeToROMColumnType(int apiDataType){
switch (apiDataType) {
case DataType.ANY_TYPE:
    return DesignChoiceConstants.COLUMN_DATA_TYPE_ANY;
case DataType.INTEGER_TYPE:
  return DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER;
case DataType.STRING_TYPE:
return DesignChoiceConstants.COLUMN_DATA_TYPE_STRING;
case DataType.DATE_TYPE:
return DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME;
case DataType.DECIMAL_TYPE:
return DesignChoiceConstants.COLUMN_DATA_TYPE_DECIMAL;
case DataType.DOUBLE_TYPE:
return DesignChoiceConstants.COLUMN_DATA_TYPE_FLOAT;
case DataType.BOOLEAN_TYPE:
return DesignChoiceConstants.COLUMN_DATA_TYPE_BOOLEAN;
case DataType.BLOB_TYPE:
case DataType.BINARY_TYPE:
default :
return DesignChoiceConstants.COLUMN_DATA_TYPE_ANY;
}
}

Fixed version (ground truth):
private static String convertApiTypeToROMColumnType(int apiDataType){
switch (apiDataType) {
case DataType.ANY_TYPE:
    return DesignChoiceConstants.COLUMN_DATA_TYPE_ANY;
case DataType.INTEGER_TYPE:
  return DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER;
case DataType.STRING_TYPE:
return DesignChoiceConstants.COLUMN_DATA_TYPE_STRING;
case DataType.DATE_TYPE:
return DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME;
case DataType.SQL_DATE_TYPE:
return DesignChoiceConstants.COLUMN_DATA_TYPE_DATE;
case DataType.SQL_TIME_TYPE:
return DesignChoiceConstants.COLUMN_DATA_TYPE_TIME;
case DataType.DECIMAL_TYPE:
return DesignChoiceConstants.COLUMN_DATA_TYPE_DECIMAL;
case DataType.DOUBLE_TYPE:
return DesignChoiceConstants.COLUMN_DATA_TYPE_FLOAT;
case DataType.BOOLEAN_TYPE:
return DesignChoiceConstants.COLUMN_DATA_TYPE_BOOLEAN;
case DataType.BLOB_TYPE:
case DataType.BINARY_TYPE:
default :
return DesignChoiceConstants.COLUMN_DATA_TYPE_ANY;
}
}
Program: 76222
Project: 76222
Buggy source:
private static String convertApiTypeToROMParameterType(int apiDataType){
switch (apiDataType) {
case DataType.INTEGER_TYPE:
    return DesignChoiceConstants.PARAM_TYPE_INTEGER;
case DataType.STRING_TYPE:
  return DesignChoiceConstants.PARAM_TYPE_STRING;
case DataType.DATE_TYPE:
return DesignChoiceConstants.PARAM_TYPE_DATETIME;
case DataType.DECIMAL_TYPE:
return DesignChoiceConstants.PARAM_TYPE_DECIMAL;
case DataType.DOUBLE_TYPE:
return DesignChoiceConstants.PARAM_TYPE_FLOAT;
case DataType.BOOLEAN_TYPE:
return DesignChoiceConstants.PARAM_TYPE_BOOLEAN;
case DataType.ANY_TYPE:
return DesignChoiceConstants.PARAM_TYPE_ANY;
case DataType.BLOB_TYPE:
case DataType.BINARY_TYPE:
default :
return DesignChoiceConstants.PARAM_TYPE_ANY;
}
}

Fixed version (ground truth):
private static String convertApiTypeToROMParameterType(int apiDataType){
switch (apiDataType) {
case DataType.INTEGER_TYPE:
    return DesignChoiceConstants.PARAM_TYPE_INTEGER;
case DataType.STRING_TYPE:
  return DesignChoiceConstants.PARAM_TYPE_STRING;
case DataType.DATE_TYPE:
return DesignChoiceConstants.PARAM_TYPE_DATETIME;
case DataType.SQL_DATE_TYPE:
return DesignChoiceConstants.PARAM_TYPE_DATE;
case DataType.SQL_TIME_TYPE:
return DesignChoiceConstants.PARAM_TYPE_TIME;
case DataType.DECIMAL_TYPE:
return DesignChoiceConstants.PARAM_TYPE_DECIMAL;
case DataType.DOUBLE_TYPE:
return DesignChoiceConstants.PARAM_TYPE_FLOAT;
case DataType.BOOLEAN_TYPE:
return DesignChoiceConstants.PARAM_TYPE_BOOLEAN;
case DataType.ANY_TYPE:
return DesignChoiceConstants.PARAM_TYPE_ANY;
case DataType.BLOB_TYPE:
case DataType.BINARY_TYPE:
default :
return DesignChoiceConstants.PARAM_TYPE_ANY;
}
}
Program: 76223
Project: 76223
Buggy source:
static public void startContent(IContent content,IContentEmitter emitter){
  starter.visit(content,emitter);
}

Fixed version (ground truth):
static public void startContent(IContent content,IContentEmitter emitter){
  if (content.getStyle().getVisibleFormat().toLowerCase().indexOf(emitter.getOutputFormat().toLowerCase()) > 0) {
    starter.visit(content,emitter);
  }
}
Program: 76224
Project: 76224
Buggy source:
static public void endContent(IContent content,IContentEmitter emitter){
  ender.visit(content,emitter);
}

Fixed version (ground truth):
static public void endContent(IContent content,IContentEmitter emitter){
  if (content.getStyle().getVisibleFormat().toLowerCase().indexOf(emitter.getOutputFormat().toLowerCase()) > 0) {
    ender.visit(content,emitter);
  }
}
Program: 76225
Project: 76225
Buggy source:
public void execute(){
  transStart(NAME);
  CrosstabReportItemHandle reportHandle=(CrosstabReportItemHandle)handleAdpter.getCrosstabItemHandle();
  try {
    MeasureViewHandle measureViewHandle=reportHandle.insertMeasure(measureHandle,0);
    measureViewHandle.addHeader();
    ComputedColumn bindingColumn=CrosstabAdaptUtil.createComputedColumn((ExtendedItemHandle)reportHandle.getModelHandle(),measureHandle);
    ComputedColumnHandle bindingHandle=((ExtendedItemHandle)reportHandle.getModelHandle()).addColumnBinding(bindingColumn,false);
    CrosstabCellHandle cellHandle=measureViewHandle.getCell();
    DataItemHandle dataHandle=DesignElementFactory.getInstance().newDataItem(measureHandle.getName());
    dataHandle.setResultSetColumn(bindingHandle.getName());
    cellHandle.addContent(dataHandle);
    LabelHandle labelHandle=DesignElementFactory.getInstance().newLabel(null);
    labelHandle.setText(measureHandle.getName());
    measureViewHandle.getHeader().addContent(labelHandle);
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
  }
  transEnd();
}

Fixed version (ground truth):
public void execute(){
  transStart(NAME);
  CrosstabReportItemHandle reportHandle=(CrosstabReportItemHandle)handleAdpter.getCrosstabItemHandle();
  try {
    if (reportHandle.getCube() == null) {
      reportHandle.setCube(CrosstabAdaptUtil.getCubeHandle(measureHandle));
    }
    MeasureViewHandle measureViewHandle=reportHandle.insertMeasure(measureHandle,0);
    measureViewHandle.addHeader();
    ComputedColumn bindingColumn=CrosstabAdaptUtil.createComputedColumn((ExtendedItemHandle)reportHandle.getModelHandle(),measureHandle);
    ComputedColumnHandle bindingHandle=((ExtendedItemHandle)reportHandle.getModelHandle()).addColumnBinding(bindingColumn,false);
    CrosstabCellHandle cellHandle=measureViewHandle.getCell();
    DataItemHandle dataHandle=DesignElementFactory.getInstance().newDataItem(measureHandle.getName());
    dataHandle.setResultSetColumn(bindingHandle.getName());
    cellHandle.addContent(dataHandle);
    LabelHandle labelHandle=DesignElementFactory.getInstance().newLabel(null);
    labelHandle.setText(measureHandle.getName());
    measureViewHandle.getHeader().addContent(labelHandle);
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
  }
  transEnd();
}
Program: 76227
Project: 76227
Buggy source:
protected Command createAddCommand(EditPart parent,EditPart child,EditPart after){
  Object parentObj=parent.getModel();
  Object afterObj=after == null ? null : after.getModel();
  Object childParent=child.getParent().getModel();
  if (parentObj instanceof VirtualCrosstabCellAdapter && childParent instanceof CrosstabCellAdapter) {
    CrosstabCellAdapter childAdapter=(CrosstabCellAdapter)childParent;
    VirtualCrosstabCellAdapter parentAdapter=(VirtualCrosstabCellAdapter)parentObj;
    if (parentAdapter.getType() == VirtualCrosstabCellAdapter.IMMACULATE_TYPE || parentAdapter.getType() == VirtualCrosstabCellAdapter.MEASURE_TYPE) {
      return UnexecutableCommand.INSTANCE;
    }
    if (ICrosstabCellAdapterFactory.CELL_FIRST_LEVEL_HANDLE.equals(childAdapter.getPositionType())) {
      if (!(after instanceof FirstLevelHandleDataItemEditPart)) {
        afterObj=null;
      }
      ChangeAreaCommand command=new ChangeAreaCommand(parentAdapter.getDesignElementHandle(),childAdapter.getDesignElementHandle(),(DesignElementHandle)DNDUtil.unwrapToModel(afterObj));
      command.setType(parentAdapter.getType());
      return command;
    }
  }
  return UnexecutableCommand.INSTANCE;
}

Fixed version (ground truth):
protected Command createAddCommand(EditPart parent,EditPart child,EditPart after){
  Object parentObj=parent.getModel();
  Object afterObj=after == null ? null : after.getModel();
  Object childParent=child.getParent().getModel();
  if (parentObj instanceof VirtualCrosstabCellAdapter && childParent instanceof CrosstabCellAdapter) {
    CrosstabCellAdapter childAdapter=(CrosstabCellAdapter)childParent;
    VirtualCrosstabCellAdapter parentAdapter=(VirtualCrosstabCellAdapter)parentObj;
    if (parentAdapter.getType() == VirtualCrosstabCellAdapter.IMMACULATE_TYPE || parentAdapter.getType() == VirtualCrosstabCellAdapter.MEASURE_TYPE) {
      return UnexecutableCommand.INSTANCE;
    }
    if (ICrosstabCellAdapterFactory.CELL_FIRST_LEVEL_HANDLE.equals(childAdapter.getPositionType())) {
      if (!(after instanceof FirstLevelHandleDataItemEditPart)) {
        afterObj=null;
      }
      if (parent.getParent() == child.getParent().getParent()) {
        ChangeAreaCommand command=new ChangeAreaCommand(parentAdapter.getDesignElementHandle(),childAdapter.getDesignElementHandle(),(DesignElementHandle)DNDUtil.unwrapToModel(afterObj));
        command.setType(parentAdapter.getType());
        return command;
      }
 else {
        return UnexecutableCommand.INSTANCE;
      }
    }
  }
  return UnexecutableCommand.INSTANCE;
}
Program: 76228
Project: 76228
Buggy source:
public static CubeHandle getCubeHandle(DimensionHandle levelHandle){
  DesignElementHandle parent=levelHandle;
  while (parent != null) {
    if (parent instanceof CubeHandle) {
      return (CubeHandle)parent;
    }
    parent=parent.getContainer();
  }
  return null;
}

Fixed version (ground truth):
public static CubeHandle getCubeHandle(DesignElementHandle levelHandle){
  DesignElementHandle parent=levelHandle;
  while (parent != null) {
    if (parent instanceof CubeHandle) {
      return (CubeHandle)parent;
    }
    parent=parent.getContainer();
  }
  return null;
}
Program: 76230
Project: 76230
Buggy source:
static public void startContent(IContent content,IContentEmitter emitter){
  if (content.getStyle().getVisibleFormat().toLowerCase().indexOf(emitter.getOutputFormat().toLowerCase()) > 0) {
    starter.visit(content,emitter);
  }
}

Fixed version (ground truth):
static public void startContent(IContent content,IContentEmitter emitter){
  String vformat=content.getStyle().getVisibleFormat();
  if (vformat == null) {
    starter.visit(content,emitter);
  }
 else {
    if (vformat.toLowerCase().indexOf(emitter.getOutputFormat().toLowerCase()) > 0 || vformat.toLowerCase().indexOf("String_Node_Str") > 0) {
      starter.visit(content,emitter);
    }
  }
}
Program: 76231
Project: 76231
Buggy source:
static public void endContent(IContent content,IContentEmitter emitter){
  if (content.getStyle().getVisibleFormat().toLowerCase().indexOf(emitter.getOutputFormat().toLowerCase()) > 0) {
    ender.visit(content,emitter);
  }
}

Fixed version (ground truth):
static public void endContent(IContent content,IContentEmitter emitter){
  String vformat=content.getStyle().getVisibleFormat();
  String format=emitter.getOutputFormat();
  if (vformat == null) {
    ender.visit(content,emitter);
  }
 else {
    if (vformat.toLowerCase().indexOf(emitter.getOutputFormat().toLowerCase()) > 0 || vformat.toLowerCase().indexOf("String_Node_Str") > 0) {
      ender.visit(content,emitter);
    }
  }
}
Program: 76232
Project: 76232
Buggy source:
public String getReturnType(){
  return method.getDeclaringClass().getSimpleName();
}

Fixed version (ground truth):
public String getReturnType(){
  return method.getName();
}
Program: 76233
Project: 76233
Buggy source:
public void execute(){
  transStart(NAME);
  CrosstabReportItemHandle reportHandle=(CrosstabReportItemHandle)handleAdpter.getCrosstabItemHandle();
  try {
    DimensionViewHandle viewHandle=reportHandle.insertDimension(getDimensionHandle(),getType(),0);
    LevelHandle levelHandle=getLevelHandle();
    if (levelHandle == null) {
      rollBack();
      return;
    }
    ComputedColumn bindingColumn=CrosstabAdaptUtil.createComputedColumn((ExtendedItemHandle)reportHandle.getModelHandle(),levelHandle);
    ComputedColumnHandle bindingHandle=((ExtendedItemHandle)reportHandle.getModelHandle()).addColumnBinding(bindingColumn,false);
    LevelViewHandle levelViewHandle=CrosstabUtil.insertLevel(viewHandle,levelHandle,0);
    CrosstabCellHandle cellHandle=levelViewHandle.getCell();
    DataItemHandle dataHandle=DesignElementFactory.getInstance().newDataItem(levelHandle.getName());
    dataHandle.setResultSetColumn(bindingHandle.getName());
    cellHandle.addContent(dataHandle);
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
  }
  transEnd();
}

Fixed version (ground truth):
public void execute(){
  transStart(NAME);
  CrosstabReportItemHandle reportHandle=(CrosstabReportItemHandle)handleAdpter.getCrosstabItemHandle();
  try {
    if (reportHandle.getCube() == null) {
      reportHandle.setCube(CrosstabAdaptUtil.getCubeHandle(getDimensionHandle()));
    }
    DimensionViewHandle viewHandle=reportHandle.insertDimension(getDimensionHandle(),getType(),0);
    LevelHandle levelHandle=getLevelHandle();
    if (levelHandle == null) {
      rollBack();
      return;
    }
    ComputedColumn bindingColumn=CrosstabAdaptUtil.createComputedColumn((ExtendedItemHandle)reportHandle.getModelHandle(),levelHandle);
    ComputedColumnHandle bindingHandle=((ExtendedItemHandle)reportHandle.getModelHandle()).addColumnBinding(bindingColumn,false);
    LevelViewHandle levelViewHandle=CrosstabUtil.insertLevel(viewHandle,levelHandle,0);
    CrosstabCellHandle cellHandle=levelViewHandle.getCell();
    DataItemHandle dataHandle=DesignElementFactory.getInstance().newDataItem(levelHandle.getName());
    dataHandle.setResultSetColumn(bindingHandle.getName());
    cellHandle.addContent(dataHandle);
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
  }
  transEnd();
}