nus-yam/ex-repair huggingface dataset:
Program: 68993
Project: 68993
Buggy source:
public Data addDateTime(Object txt,IStyle style,HyperlinkDef link,BookmarkDef bookmark,String dateTimeLocale){
  ContainerSizeInfo rule=getCurrentContainer().getSizeInfo();
  StyleEntry entry=engine.getStyle(style,rule);
  Data data=null;
  IDataContent dataContent=(IDataContent)txt;
  Object value=dataContent.getValue();
  Date date=ExcelUtil.getDate(value);
  if (date != null && ((date instanceof Time) || date.getYear() >= 0)) {
    data=createDateData(value,entry,style.getDateTimeFormat(),dateTimeLocale);
    data.setHyperlinkDef(link);
    data.setBookmark(bookmark);
    data.setSizeInfo(rule);
    addData(data);
    return data;
  }
 else {
    return addData(dataContent.getText(),style,link,bookmark,dateTimeLocale);
  }
}

Fixed version (ground truth):
public Data addDateTime(Object txt,IStyle style,HyperlinkDef link,BookmarkDef bookmark,String dateTimeLocale,double height){
  ContainerSizeInfo rule=getCurrentContainer().getSizeInfo();
  StyleEntry entry=engine.getStyle(style,rule);
  Data data=null;
  IDataContent dataContent=(IDataContent)txt;
  Object value=dataContent.getValue();
  Date date=ExcelUtil.getDate(value);
  if (date != null && ((date instanceof Time) || date.getYear() >= 0)) {
    data=createDateData(value,entry,style.getDateTimeFormat(),dateTimeLocale);
    data.setHeight(height);
    data.setHyperlinkDef(link);
    data.setBookmark(bookmark);
    data.setSizeInfo(rule);
    addData(data);
    return data;
  }
 else {
    return addData(dataContent.getText(),style,link,bookmark,dateTimeLocale,height);
  }
}
Program: 68994
Project: 68994
Buggy source:
private void writeDataFormat(StyleEntry style){
  Integer type=(Integer)style.getProperty(StyleConstant.DATA_TYPE_PROP);
  if (type == SheetData.DATE && style.getProperty(StyleConstant.DATE_FORMAT_PROP) != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",style.getProperty(StyleConstant.DATE_FORMAT_PROP));
    writer.closeTag("String_Node_Str");
  }
 else   if (type == Data.NUMBER && style.getProperty(StyleConstant.NUMBER_FORMAT_PROP) != null) {
    writer.openTag("String_Node_Str");
    String numberStyle=(String)style.getProperty(StyleConstant.NUMBER_FORMAT_PROP);
    writer.attribute("String_Node_Str",numberStyle);
    writer.closeTag("String_Node_Str");
  }
}

Fixed version (ground truth):
private void writeDataFormat(StyleEntry style){
  Integer type=(Integer)style.getProperty(StyleConstant.DATA_TYPE_PROP);
  if (type == null)   return;
  if (type == SheetData.DATE && style.getProperty(StyleConstant.DATE_FORMAT_PROP) != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",style.getProperty(StyleConstant.DATE_FORMAT_PROP));
    writer.closeTag("String_Node_Str");
  }
 else   if (type == Data.NUMBER && style.getProperty(StyleConstant.NUMBER_FORMAT_PROP) != null) {
    writer.openTag("String_Node_Str");
    String numberStyle=(String)style.getProperty(StyleConstant.NUMBER_FORMAT_PROP);
    writer.attribute("String_Node_Str",numberStyle);
    writer.closeTag("String_Node_Str");
  }
}
Program: 68995
Project: 68995
Buggy source:
public StyleEntry getStyle(IStyle style,ContainerSizeInfo rule){
  return initStyle(style,rule);
}

Fixed version (ground truth):
public StyleEntry getStyle(IStyle style,ContainerSizeInfo childSizeInfo,ContainerSizeInfo parentSizeInfo){
  return initStyle(style,childSizeInfo,parentSizeInfo);
}
Program: 68996
Project: 68996
Buggy source:
private StyleEntry initStyle(IStyle style,ContainerSizeInfo rule){
  StyleEntry entry=StyleBuilder.createStyleEntry(style);
  ;
  if (!containerStyles.isEmpty()) {
    StyleEntry centry=containerStyles.peek();
    StyleBuilder.mergeInheritableProp(centry,entry);
  }
  if (engine.getContainers().size() > 0) {
    XlsContainer container=engine.getCurrentContainer();
    StyleEntry cEntry=container.getStyle();
    StyleBuilder.mergeInheritableProp(cEntry,entry);
    applyHBorders(cEntry,entry,container.getSizeInfo(),rule);
  }
  return entry;
}

Fixed version (ground truth):
private StyleEntry initStyle(IStyle style,ContainerSizeInfo rule){
  return initStyle(style,null,rule);
}
Program: 68997
Project: 68997
Buggy source:
protected Data createData(Object text,StyleEntry s,int dataType,XlsContainer container,int rowSpanOfDesign){
  Data data=createData();
  data.setValue(text);
  data.setStyle(s);
  data.setDataType(dataType);
  data.setContainer(container);
  data.setRowSpanInDesign(rowSpanOfDesign);
  lastData=data;
  return data;
}

Fixed version (ground truth):
protected Data createData(Object text,StyleEntry s,int dataType,XlsContainer container,int rowSpanOfDesign){
  Data data=createData();
  data.setValue(text);
  data.setStyle(s);
  data.setDataType(dataType);
  data.setContainer(container);
  data.setRowSpanInDesign(rowSpanOfDesign);
  return data;
}
Program: 68998
Project: 68998
Buggy source:
protected void addData(SheetData data){
  XlsContainer container=getCurrentContainer();
  container.setEmpty(false);
  int col=axis.getColumnIndexByCoordinate(data.getSizeInfo().getStartCoordinate());
  if (col == -1 || col >= cache.getColumnCount())   return;
  int span=axis.getColumnIndexByCoordinate(data.getSizeInfo().getEndCoordinate()) - col;
  applyTopBorderStyle(data);
  outputDataIfBufferIsFull();
  updataRowIndex(data,container);
  addDatatoCache(col,data);
  for (int i=col + 1; i < col + span; i++) {
    BlankData blankData=new BlankData(data);
    blankData.setType(Type.HORIZONTAL);
    addDatatoCache(i,blankData);
  }
  if (container instanceof XlsCell) {
    XlsCell cell=(XlsCell)container;
    data.setRowSpanInDesign(cell.getRowSpan() - 1);
  }
  lastData=data;
}

Fixed version (ground truth):
protected void addData(SheetData data){
  XlsContainer container=getCurrentContainer();
  container.setEmpty(false);
  int col=axis.getColumnIndexByCoordinate(data.getSizeInfo().getStartCoordinate());
  if (col == -1 || col >= cache.getColumnCount())   return;
  int span=axis.getColumnIndexByCoordinate(data.getSizeInfo().getEndCoordinate()) - col;
  applyTopBorderStyle(data);
  outputDataIfBufferIsFull();
  updataRowIndex(data,container);
  addDatatoCache(col,data);
  for (int i=col + 1; i < col + span; i++) {
    BlankData blankData=new BlankData(data);
    blankData.setType(Type.HORIZONTAL);
    addDatatoCache(i,blankData);
  }
  if (data.getDataType() == SheetData.IMAGE) {
    addEmptyData(data,container);
  }
  if (container instanceof XlsCell) {
    XlsCell cell=(XlsCell)container;
    data.setRowSpanInDesign(cell.getRowSpan() - 1);
  }
}
Program: 68999
Project: 68999
Buggy source:
public void addImageData(IImageContent image,IStyle style,HyperlinkDef link,BookmarkDef bookmark){
  XlsContainer container=getCurrentContainer();
  ContainerSizeInfo parentSizeInfo=container.getSizeInfo();
  ColumnsInfo imageColumnsInfo=LayoutUtil.createImage(image,parentSizeInfo.getWidth());
  splitColumns(imageColumnsInfo,parentSizeInfo);
  StyleEntry entry=engine.getStyle(style,parentSizeInfo);
  SheetData data=createImageData(image,entry,container);
  data.setHyperlinkDef(link);
  data.setBookmark(bookmark);
  ContainerSizeInfo imageSizeInfo=new ContainerSizeInfo(parentSizeInfo.getStartCoordinate(),imageColumnsInfo.getTotalWidth());
  data.setSizeInfo(imageSizeInfo);
  addData(data);
}

Fixed version (ground truth):
public void addImageData(IImageContent image,IStyle style,HyperlinkDef link,BookmarkDef bookmark){
  XlsContainer container=getCurrentContainer();
  ContainerSizeInfo parentSizeInfo=container.getSizeInfo();
  ColumnsInfo imageColumnsInfo=LayoutUtil.createImage(image,parentSizeInfo.getWidth());
  splitColumns(imageColumnsInfo,parentSizeInfo);
  ContainerSizeInfo imageSizeInfo=new ContainerSizeInfo(parentSizeInfo.getStartCoordinate(),imageColumnsInfo.getTotalWidth());
  StyleEntry entry=engine.getStyle(style,imageSizeInfo,parentSizeInfo);
  SheetData data=createImageData(image,entry,container);
  data.setHyperlinkDef(link);
  data.setBookmark(bookmark);
  data.setSizeInfo(imageSizeInfo);
  addData(data);
}
Program: 69000
Project: 69000
Buggy source:
private void addEmptyDataToContainer(StyleEntry style,XlsContainer parent,int startCoordinate,int width){
  Data data=createData(EMPTY,style,Data.STRING,parent);
  data.setSizeInfo(new ContainerSizeInfo(startCoordinate,width));
  addData(data);
}

Fixed version (ground truth):
private void addEmptyDataToContainer(StyleEntry style,XlsContainer parent,int startCoordinate,int width){
  Data data=createEmptyData(parent,style);
  data.setSizeInfo(new ContainerSizeInfo(startCoordinate,width));
  addData(data);
}
Program: 69001
Project: 69001
Buggy source:
protected void setMarginTopAndBottom(IStyle style,float margin){
  style.setProperty(IStyle.STYLE_MARGIN_TOP,createEmValue(margin));
  style.setProperty(IStyle.STYLE_MARGIN_BOTTOM,createEmValue(margin));
}

Fixed version (ground truth):
protected void setMarginTopAndBottom(IStyle style,float margin){
  setProperty(style,IStyle.STYLE_MARGIN_TOP,createEmValue(margin));
  setProperty(style,IStyle.STYLE_MARGIN_BOTTOM,createEmValue(margin));
}
Program: 69002
Project: 69002
Buggy source:
protected void setHStyle(IStyle style,float fontSize,float margin){
  setMarginTopAndBottom(style,margin);
  style.setProperty(IStyle.STYLE_FONT_SIZE,createEmValue(fontSize));
  style.setProperty(IStyle.STYLE_FONT_WEIGHT,IStyle.BOLD_VALUE);
  style.setProperty(IStyle.STYLE_PAGE_BREAK_AFTER,IStyle.AVOID_VALUE);
}

Fixed version (ground truth):
protected void setHStyle(IStyle style,float fontSize,float margin){
  setMarginTopAndBottom(style,margin);
  setProperty(style,IStyle.STYLE_FONT_SIZE,createEmValue(fontSize));
  setProperty(style,IStyle.STYLE_FONT_WEIGHT,IStyle.BOLD_VALUE);
  setProperty(style,IStyle.STYLE_PAGE_BREAK_AFTER,IStyle.AVOID_VALUE);
}
Program: 69003
Project: 69003
Buggy source:
protected void setFontStyle(IStyle style,Value fontStyle){
  style.setProperty(IStyle.STYLE_FONT_STYLE,fontStyle);
}

Fixed version (ground truth):
protected void setFontStyle(IStyle style,Value fontStyle){
  setProperty(style,IStyle.STYLE_FONT_STYLE,fontStyle);
}
Program: 69004
Project: 69004
Buggy source:
protected void setFontFamily(IStyle style,Value font){
  ListValue fonts=new ListValue();
  fonts.append(font);
  style.setProperty(IStyle.STYLE_FONT_FAMILY,fonts);
}

Fixed version (ground truth):
protected void setFontFamily(IStyle style,Value font){
  ListValue fonts=new ListValue();
  fonts.append(font);
  setProperty(style,IStyle.STYLE_FONT_FAMILY,fonts);
}
Program: 69005
Project: 69005
Buggy source:
protected void setBlockDisplay(IStyle style){
  style.setProperty(IStyle.STYLE_DISPLAY,IStyle.BLOCK_VALUE);
}

Fixed version (ground truth):
protected void setBlockDisplay(IStyle style){
  setProperty(style,IStyle.STYLE_DISPLAY,IStyle.BLOCK_VALUE);
}
Program: 69006
Project: 69006
Buggy source:
protected void setFontWeight(IStyle style,Value fontWeight){
  style.setProperty(IStyle.STYLE_FONT_WEIGHT,fontWeight);
}

Fixed version (ground truth):
protected void setFontWeight(IStyle style,Value fontWeight){
  setProperty(style,IStyle.STYLE_FONT_WEIGHT,fontWeight);
}
Program: 69007
Project: 69007
Buggy source:
protected void setInlineDisplay(IStyle style){
  style.setProperty(IStyle.STYLE_DISPLAY,IStyle.INLINE_VALUE);
}

Fixed version (ground truth):
protected void setInlineDisplay(IStyle style){
  setProperty(style,IStyle.STYLE_DISPLAY,IStyle.INLINE_VALUE);
}
Program: 69008
Project: 69008
Buggy source:
private void processCellStyle(Element element,Map<Element,StyleProperties> cssStyles){
  String border=element.getAttribute(PROPERTY_BORDER);
  String padding=element.getAttribute(PROPERTY_CELLPADDING);
  boolean hasBorder=border != null && border.length() > 0;
  boolean hasPadding=padding != null && padding.length() > 0;
  if (hasBorder || hasPadding) {
    for (Node node=element.getFirstChild(); node != null; node=node.getNextSibling()) {
      Element r=(Element)node;
      if (TAG_TR.equals(r.getTagName()) || TAG_TH.equals(r.getTagName())) {
        for (Node n=r.getFirstChild(); n != null; n=n.getNextSibling()) {
          Element c=(Element)n;
          if (TAG_TD.equals(c.getTagName())) {
            StyleProperties sp=cssStyles.get(c);
            if (sp == null) {
              sp=new StyleProperties(new StyleDeclaration(content.getCSSEngine()));
              cssStyles.put(c,sp);
            }
            if (hasBorder) {
              PropertiesProcessor.process(PROPERTY_BORDER,border,sp);
            }
            if (hasPadding) {
              PropertiesProcessor.process(PROPERTY_CELLPADDING,border,sp);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void processCellStyle(Element element,Map<Element,StyleProperties> cssStyles){
  String border=element.getAttribute(PROPERTY_BORDER);
  String padding=element.getAttribute(PROPERTY_CELLPADDING);
  boolean hasBorder=border != null && border.length() > 0;
  boolean hasPadding=padding != null && padding.length() > 0;
  if (hasBorder || hasPadding) {
    for (Node node=element.getFirstChild(); node != null; node=node.getNextSibling()) {
      Element r=(Element)node;
      if (TAG_TR.equals(r.getTagName())) {
        for (Node n=r.getFirstChild(); n != null; n=n.getNextSibling()) {
          Element c=(Element)n;
          if (TAG_TD.equals(c.getTagName()) || TAG_TH.equals(c.getTagName())) {
            StyleProperties sp=cssStyles.get(c);
            if (sp == null) {
              sp=new StyleProperties(new StyleDeclaration(content.getCSSEngine()));
              cssStyles.put(c,sp);
            }
            if (hasBorder) {
              PropertiesProcessor.process(PROPERTY_BORDER,border,sp);
            }
            if (hasPadding) {
              PropertiesProcessor.process(PROPERTY_CELLPADDING,border,sp);
            }
          }
        }
      }
    }
  }
}
Program: 69010
Project: 69010
Buggy source:
protected void _splitSpanCell(int height,boolean force) throws BirtException {
  if (cells.length != children.size()) {
    for (int i=0; i < cells.length; i++) {
      if (cells[i] instanceof DummyCell) {
        int oh=((DummyCell)cells[i]).getCell().getHeight();
        int ch=((DummyCell)cells[i]).getDelta();
        int rowSpan=((DummyCell)cells[i]).getRowSpan();
        if (ch >= oh) {
          CellArea cell=cells[i].cloneArea();
          cell.setHeight(0);
          cell.setRowSpan(rowSpan);
          cell.setParent(this);
          addChildByColumnId(cell);
        }
 else {
          SplitResult splitCell=cells[i].split(height,force);
          CellArea cell=(CellArea)splitCell.getResult();
          if (cell != null) {
            CellArea oc=((DummyCell)cells[i]).getCell();
            ArrayList temp=cell.children;
            cell.children=oc.children;
            oc.children=temp;
            oc.updateChildrenPosition();
            cell.updateChildrenPosition();
            cell.setRowSpan(rowSpan);
            cell.setParent(this);
            addChildByColumnId(cell);
          }
 else {
            cell=cells[i].cloneArea();
            cell.setHeight(0);
            cell.setRowSpan(rowSpan);
            cell.setParent(this);
            addChildByColumnId(cell);
          }
        }
        i=i + cells[i].getColSpan() - 1;
      }
    }
  }
}

Fixed version (ground truth):
protected void _splitSpanCell(int height,boolean force) throws BirtException {
  if (cells.length != children.size()) {
    for (int i=0; i < cells.length; i++) {
      if (cells[i] instanceof DummyCell) {
        int oh=((DummyCell)cells[i]).getCell().getHeight();
        int ch=((DummyCell)cells[i]).getDelta();
        int rowSpan=((DummyCell)cells[i]).getRowSpan();
        if (ch >= oh) {
          CellArea cell=cells[i].cloneArea();
          cell.setHeight(0);
          cell.setRowSpan(rowSpan);
          cell.setParent(this);
          cell.isDummy=true;
          addChildByColumnId(cell);
        }
 else {
          SplitResult splitCell=cells[i].split(height,force);
          CellArea cell=(CellArea)splitCell.getResult();
          if (cell != null) {
            CellArea oc=((DummyCell)cells[i]).getCell();
            ArrayList temp=cell.children;
            cell.children=oc.children;
            oc.children=temp;
            oc.updateChildrenPosition();
            cell.updateChildrenPosition();
            cell.setRowSpan(rowSpan);
            cell.setParent(this);
            addChildByColumnId(cell);
          }
 else {
            cell=cells[i].cloneArea();
            cell.setHeight(0);
            cell.setRowSpan(rowSpan);
            cell.setParent(this);
            addChildByColumnId(cell);
          }
        }
        i=i + cells[i].getColSpan() - 1;
      }
    }
  }
}
Program: 69012
Project: 69012
Buggy source:
private void updateQuery(String queryType,Query query,String expr,SeriesDefinition seriesDefinition){
  String actualExpr=expr;
  if (dataProvider.checkState(IDataServiceProvider.SHARE_QUERY) || dataProvider.checkState(IDataServiceProvider.INHERIT_COLUMNS_GROUPS)) {
    boolean isGroupOrAggr=false;
    Object obj=getCurrentColumnHeadObject();
    if (obj instanceof ColumnBindingInfo) {
      ColumnBindingInfo cbi=(ColumnBindingInfo)obj;
      int type=cbi.getColumnType();
      if (type == ColumnBindingInfo.GROUP_COLUMN || type == ColumnBindingInfo.AGGREGATE_COLUMN) {
        actualExpr=cbi.getExpression();
        isGroupOrAggr=true;
      }
    }
    if (seriesDefinition != null && (queryType.equals(ChartUIConstants.QUERY_CATEGORY) || queryType.equals(ChartUIConstants.QUERY_VALUE))) {
      seriesDefinition.getGrouping().setEnabled(isGroupOrAggr);
    }
  }
  query.setDefinition(actualExpr);
}

Fixed version (ground truth):
private void updateQuery(String queryType,Query query,String expr,SeriesDefinition seriesDefinition){
  String actualExpr=expr;
  if (dataProvider.checkState(IDataServiceProvider.SHARE_QUERY) || dataProvider.checkState(IDataServiceProvider.INHERIT_COLUMNS_GROUPS)) {
    boolean isGroupOrAggr=false;
    Object obj=getCurrentColumnHeadObject();
    if (obj instanceof ColumnBindingInfo) {
      ColumnBindingInfo cbi=(ColumnBindingInfo)obj;
      int type=cbi.getColumnType();
      if (type == ColumnBindingInfo.GROUP_COLUMN || type == ColumnBindingInfo.AGGREGATE_COLUMN) {
        actualExpr=cbi.getExpression();
        isGroupOrAggr=true;
      }
    }
    if (seriesDefinition != null && (queryType.equals(ChartUIConstants.QUERY_CATEGORY) || queryType.equals(ChartUIConstants.QUERY_VALUE))) {
      seriesDefinition.getGrouping().setEnabled(isGroupOrAggr);
    }
  }
  if (ChartUIConstants.QUERY_VALUE.equals(queryType)) {
    if (!dataProvider.checkState(IDataServiceProvider.SHARE_QUERY) && dataProvider.checkState(IDataServiceProvider.HAS_DATA_SET)) {
      if (dataProvider.getDataType(actualExpr) == DataType.DATE_TIME_LITERAL) {
        ChartAdapter.beginIgnoreNotifications();
        if (query.getGrouping() == null) {
          query.setGrouping(DataFactoryImpl.init().createSeriesGrouping());
        }
        SeriesGrouping group=query.getGrouping();
        group.setEnabled(true);
        group.setAggregateExpression("String_Node_Str");
        ChartAdapter.endIgnoreNotifications();
      }
    }
  }
  query.setDefinition(actualExpr);
}
Program: 69013
Project: 69013
Buggy source:
public void initialize(IEmitterServices service) throws BirtException {
  if (emitter != null) {
    emitter.initialize(service);
  }
  ReportDesignHandle designHandle=(ReportDesignHandle)service.getReportRunnable().getDesignHandle();
  if (designHandle != null) {
    String reportLayoutPreference=designHandle.getLayoutPreference();
    context.setFixedLayout(DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_FIXED_LAYOUT.equals(reportLayoutPreference));
  }
}

Fixed version (ground truth):
public void initialize(IEmitterServices service) throws BirtException {
  if (emitter != null) {
    emitter.initialize(service);
  }
  ReportDesignHandle designHandle=(ReportDesignHandle)service.getReportRunnable().getDesignHandle();
  if (designHandle != null) {
    String reportLayoutPreference=designHandle.getLayoutPreference();
    context.setFixedLayout(DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_FIXED_LAYOUT.equals(reportLayoutPreference));
  }
  if (context.getHtmlLayoutContext() != null) {
    if (context.isFixedLayout()) {
      context.setAutoPageBreak(context.getHtmlLayoutContext().allowPageBreak());
    }
  }
}
Program: 69014
Project: 69014
Buggy source:
public TextAreaLayout(ContainerArea parent,LayoutContext context,IContent content){
  parentLM=(InlineStackingArea)parent;
  ITextContent textContent=(ITextContent)content;
  parentLM.setTextIndent(textContent);
  String text=textContent.getText();
  if (text != null && text.length() != 0)   transform(textContent);
 else   textContent.setText("String_Node_Str");
  this.textContent=textContent;
  comp=new TextCompositor(textContent,context.getFontManager(),context);
  LineArea lineParent=getLineParent();
  boolean isEmptyLine=isEmtpy(lineParent);
  comp.setNewLineStatus(isEmptyLine);
}

Fixed version (ground truth):
public TextAreaLayout(ContainerArea parent,LayoutContext context,IContent content){
  parentLM=(InlineStackingArea)parent;
  ITextContent textContent=(ITextContent)content;
  parentLM.setTextIndent(textContent);
  String text=textContent.getText();
  if (text != null && text.length() != 0)   transform(textContent);
 else   textContent.setText("String_Node_Str");
  this.textContent=textContent;
  comp=new TextCompositor(textContent,context.getFontManager(),context);
  boolean isEmptyLine=isEmptyLine();
  comp.setNewLineStatus(isEmptyLine);
}
Program: 69015
Project: 69015
Buggy source:
/** 
 * Creates iText BaseFont with the given font family name.
 * @param ffn the specified font family name.
 * @return the created BaseFont.
 */
public BaseFont createFont(String familyName,int fontStyle){
  String key=familyName + fontStyle;
synchronized (baseFonts) {
    BaseFont font=(BaseFont)baseFonts.get(key);
    if (font == null) {
      try {
        String fontEncoding=(String)fontEncodings.get(familyName);
        if (fontEncoding == null) {
          fontEncoding=BaseFont.IDENTITY_H;
        }
        font=FontFactory.getFont(familyName,fontEncoding,BaseFont.EMBEDDED,14,fontStyle).getBaseFont();
        if (font != null) {
          baseFonts.put(key,font);
        }
      }
 catch (      Throwable de) {
        return null;
      }
    }
    return font;
  }
}

Fixed version (ground truth):
/** 
 * Creates iText BaseFont with the given font family name.
 * @param ffn the specified font family name.
 * @return the created BaseFont.
 */
public BaseFont createFont(String familyName,int fontStyle){
  String key=familyName + fontStyle;
synchronized (baseFonts) {
    BaseFont font=(BaseFont)baseFonts.get(key);
    if (font == null) {
      if (baseFonts.containsKey(key)) {
        return null;
      }
      try {
        String fontEncoding=(String)fontEncodings.get(familyName);
        if (fontEncoding == null) {
          fontEncoding=BaseFont.IDENTITY_H;
        }
        font=FontFactory.getFont(familyName,fontEncoding,BaseFont.EMBEDDED,14,fontStyle).getBaseFont();
        baseFonts.put(key,font);
      }
 catch (      Throwable de) {
        baseFonts.put(key,font);
        return null;
      }
    }
    return font;
  }
}
Program: 69016
Project: 69016
Buggy source:
private void processCellStyle(Element element,Map<Element,StyleProperties> cssStyles){
  String border=element.getAttribute(PROPERTY_BORDER);
  String padding=element.getAttribute(PROPERTY_CELLPADDING);
  boolean hasBorder=border != null && border.length() > 0;
  boolean hasPadding=padding != null && padding.length() > 0;
  if (hasBorder || hasPadding) {
    for (Node node=element.getFirstChild(); node != null; node=node.getNextSibling()) {
      Element r=(Element)node;
      if (TAG_TR.equals(r.getTagName())) {
        for (Node n=r.getFirstChild(); n != null; n=n.getNextSibling()) {
          Element c=(Element)n;
          if (TAG_TD.equals(c.getTagName())) {
            StyleProperties sp=cssStyles.get(c);
            if (sp == null) {
              sp=new StyleProperties(new StyleDeclaration(content.getCSSEngine()));
              cssStyles.put(c,sp);
            }
            if (hasBorder) {
              PropertiesProcessor.process(PROPERTY_BORDER,border,sp);
            }
            if (hasPadding) {
              PropertiesProcessor.process(PROPERTY_CELLPADDING,border,sp);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void processCellStyle(Element element,Map<Element,StyleProperties> cssStyles){
  String border=element.getAttribute(PROPERTY_BORDER);
  String padding=element.getAttribute(PROPERTY_CELLPADDING);
  boolean hasBorder=border != null && border.length() > 0;
  boolean hasPadding=padding != null && padding.length() > 0;
  if (hasBorder || hasPadding) {
    for (Node node=element.getFirstChild(); node != null; node=node.getNextSibling()) {
      Element r=(Element)node;
      if (TAG_TR.equals(r.getTagName()) || TAG_TH.equals(r.getTagName())) {
        for (Node n=r.getFirstChild(); n != null; n=n.getNextSibling()) {
          Element c=(Element)n;
          if (TAG_TD.equals(c.getTagName())) {
            StyleProperties sp=cssStyles.get(c);
            if (sp == null) {
              sp=new StyleProperties(new StyleDeclaration(content.getCSSEngine()));
              cssStyles.put(c,sp);
            }
            if (hasBorder) {
              PropertiesProcessor.process(PROPERTY_BORDER,border,sp);
            }
            if (hasPadding) {
              PropertiesProcessor.process(PROPERTY_CELLPADDING,border,sp);
            }
          }
        }
      }
    }
  }
}
Program: 69017
Project: 69017
Buggy source:
/** 
 * Updates UI selection according to Chart type
 */
protected void updateSelection(){
  boolean bOutXtab=!getDataServiceProvider().checkState(IDataServiceProvider.PART_CHART);
  if (chartModel instanceof ChartWithAxes) {
    if (cbMultipleY != null) {
      lblMultipleY.setEnabled(bOutXtab && !is3D());
      cbMultipleY.setEnabled(bOutXtab && !is3D());
    }
    if (cbSeriesType != null) {
      lblSeriesType.setEnabled(bOutXtab && isTwoAxesEnabled());
      cbSeriesType.setEnabled(bOutXtab && isTwoAxesEnabled());
    }
  }
 else {
    if (cbMultipleY != null) {
      cbMultipleY.select(0);
      ((ChartWizardContext)getContext()).setMoreAxesSupported(false);
      lblMultipleY.setEnabled(false);
      cbMultipleY.setEnabled(false);
    }
    if (cbSeriesType != null) {
      lblSeriesType.setEnabled(false);
      cbSeriesType.setEnabled(false);
    }
  }
  if (cbOrientation != null) {
    lblOrientation.setEnabled(bOutXtab && lblOrientation.isEnabled());
    cbOrientation.setEnabled(bOutXtab && cbOrientation.isEnabled());
  }
}

Fixed version (ground truth):
/** 
 * Updates UI selection according to Chart type
 */
protected void updateSelection(){
  boolean bOutXtab=!getDataServiceProvider().checkState(IDataServiceProvider.PART_CHART);
  if (chartModel instanceof ChartWithAxes) {
    if (cbMultipleY != null) {
      lblMultipleY.setEnabled(isMultiAxisSupported());
      cbMultipleY.setEnabled(isMultiAxisSupported());
    }
    if (cbSeriesType != null) {
      lblSeriesType.setEnabled(bOutXtab && isTwoAxesEnabled());
      cbSeriesType.setEnabled(bOutXtab && isTwoAxesEnabled());
    }
  }
 else {
    if (cbMultipleY != null) {
      cbMultipleY.select(0);
      ((ChartWizardContext)getContext()).setMoreAxesSupported(false);
      lblMultipleY.setEnabled(false);
      cbMultipleY.setEnabled(false);
    }
    if (cbSeriesType != null) {
      lblSeriesType.setEnabled(false);
      cbSeriesType.setEnabled(false);
    }
  }
  if (cbOrientation != null) {
    lblOrientation.setEnabled(bOutXtab && lblOrientation.isEnabled());
    cbOrientation.setEnabled(bOutXtab && cbOrientation.isEnabled());
  }
}
Program: 69019
Project: 69019
Buggy source:
protected boolean isValidResult(List result){
  if (repeatList != null && !inHeaderBand) {
    return result.size() > repeatList.size();
  }
  return super.isValidResult(result);
}

Fixed version (ground truth):
protected boolean isValidResult(List result){
}
Program: 69020
Project: 69020
Buggy source:
protected Control createContents(Composite parent){
  getShell().setText(Messages.getString("String_Node_Str"));
  Control c=super.createContents(parent);
  if (icon instanceof EmbeddedImage) {
    btnEmbeddedImage.setSelection(true);
    switchTo(EMBEDDED_TYPE);
  }
  c.pack();
  preview();
  Point size=getShell().computeSize(SWT.DEFAULT,SWT.DEFAULT);
  getShell().setSize(size.x,size.y);
  UIHelper.centerOnScreen(getShell());
  return c;
}

Fixed version (ground truth):
protected Control createContents(Composite parent){
  ChartUIUtil.bindHelp(parent,ChartHelpContextIds.DIALOG_MARKER_ICON);
  getShell().setText(Messages.getString("String_Node_Str"));
  Control c=super.createContents(parent);
  if (icon instanceof EmbeddedImage) {
    btnEmbeddedImage.setSelection(true);
    switchTo(EMBEDDED_TYPE);
  }
  c.pack();
  preview();
  Point size=getShell().computeSize(SWT.DEFAULT,SWT.DEFAULT);
  getShell().setSize(size.x,size.y);
  UIHelper.centerOnScreen(getShell());
  return c;
}
Program: 69022
Project: 69022
Buggy source:
private void addToExtension(BlockTextArea area){
  if (context.isFixedLayout() && context.getEngineTaskType() == IEngineTask.TASK_RUN) {
    ArrayList<BlockTextArea> list=(ArrayList<BlockTextArea>)content.getExtension(IContent.LAYOUT_EXTENSION);
    if (list == null) {
      list=new ArrayList<BlockTextArea>();
      content.setExtension(IContent.LAYOUT_EXTENSION,list);
    }
    if (area.finished) {
      list.add(area);
    }
 else {
      if (list.size() > 0 && list.get(list.size() - 1).finished) {
        list.add(list.size() - 1,area);
      }
 else {
        list.add(area);
      }
    }
  }
}

Fixed version (ground truth):
private void addToExtension(BlockTextArea area){
  if (context.isFixedLayout() && context.getEngineTaskType() == IEngineTask.TASK_RUN) {
    ArrayList<BlockTextArea> list=(ArrayList<BlockTextArea>)content.getExtension(IContent.LAYOUT_EXTENSION);
    if (list == null) {
      list=new ArrayList<BlockTextArea>();
      content.setExtension(IContent.LAYOUT_EXTENSION,list);
    }
    if (area.finished) {
      if (list.isEmpty() || (list.size() > 0 && !list.get(list.size() - 1).finished)) {
        list.add(area);
      }
    }
 else {
      if (list.size() > 0 && list.get(list.size() - 1).finished) {
        list.add(list.size() - 1,area);
      }
 else {
        list.add(area);
      }
    }
  }
}
Program: 69024
Project: 69024
Buggy source:
private void writeBorder(String position,String lineStyle,String weight,String color){
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",position);
  if (isValid(lineStyle)) {
    writer.attribute("String_Node_Str",lineStyle);
  }
  if (isValid(weight)) {
    writer.attribute("String_Node_Str",weight);
  }
  if (isValid(color)) {
    writer.attribute("String_Node_Str",color);
  }
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
private void writeBorder(String position,String lineStyle,String weight,Color color){
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",position);
  if (isValid(lineStyle)) {
    writer.attribute("String_Node_Str",lineStyle);
  }
  if (isValid(weight)) {
    writer.attribute("String_Node_Str",weight);
  }
  if (color != null) {
    writer.attribute("String_Node_Str",toString(color));
  }
  writer.closeTag("String_Node_Str");
}
Program: 69025
Project: 69025
Buggy source:
private void declareHyperlinkStyle(){
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writeFont(null,null,null,null,null,true,"String_Node_Str");
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
private void declareHyperlinkStyle(){
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
}
Program: 69026
Project: 69026
Buggy source:
private void writeFont(String fontName,Integer size,Boolean bold,Boolean italic,Boolean strikeThrough,Boolean underline,String color){
  writer.openTag("String_Node_Str");
  if (isValid(fontName)) {
    writer.attribute("String_Node_Str",fontName);
  }
  if (size != null) {
    writer.attribute("String_Node_Str",size);
  }
  if (bold != null && bold) {
    writer.attribute("String_Node_Str",1);
  }
  if (italic != null && italic) {
    writer.attribute("String_Node_Str",1);
  }
  if (strikeThrough != null && strikeThrough) {
    writer.attribute("String_Node_Str",1);
  }
  if (underline != null && underline) {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
  if (isValid(color)) {
    writer.attribute("String_Node_Str",color);
  }
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
private void writeFont(String fontName,Integer size,Boolean bold,Boolean italic,Boolean strikeThrough,Boolean underline,Color color){
  writer.openTag("String_Node_Str");
  if (isValid(fontName)) {
    writer.attribute("String_Node_Str",fontName);
  }
  if (size != null) {
    writer.attribute("String_Node_Str",size);
  }
  if (bold != null && bold) {
    writer.attribute("String_Node_Str",1);
  }
  if (italic != null && italic) {
    writer.attribute("String_Node_Str",1);
  }
  if (strikeThrough != null && strikeThrough) {
    writer.attribute("String_Node_Str",1);
  }
  if (underline != null && underline) {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
  if (color != null) {
    writer.attribute("String_Node_Str",toString(color));
  }
  writer.closeTag("String_Node_Str");
}
Program: 69027
Project: 69027
Buggy source:
private void writeBackGroudColor(String bgColor){
  if (isValid(bgColor)) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",bgColor);
    writer.attribute("String_Node_Str","String_Node_Str");
    writer.closeTag("String_Node_Str");
  }
}

Fixed version (ground truth):
private void writeBackGroudColor(StyleEntry style){
  Color bgColor=(Color)style.getProperty(StyleConstant.BACKGROUND_COLOR_PROP);
  if (bgColor != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",bgColor);
    writer.attribute("String_Node_Str","String_Node_Str");
    writer.closeTag("String_Node_Str");
  }
}
Program: 69028
Project: 69028
Buggy source:
private void writeDataFormat(StyleEntry style){
  String typeString=(String)style.getProperty(StyleConstant.DATA_TYPE_PROP);
  if (typeString == null)   return;
  int type=Integer.parseInt(typeString);
  if (type == SheetData.DATE && style.getProperty(StyleConstant.DATE_FORMAT_PROP) != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",style.getProperty(StyleConstant.DATE_FORMAT_PROP));
    writer.closeTag("String_Node_Str");
  }
  if (type == Data.NUMBER && style.getProperty(StyleConstant.NUMBER_FORMAT_PROP) != null) {
    writer.openTag("String_Node_Str");
    String numberStyle=(String)style.getProperty(StyleConstant.NUMBER_FORMAT_PROP);
    writer.attribute("String_Node_Str",numberStyle);
    writer.closeTag("String_Node_Str");
  }
}

Fixed version (ground truth):
private void writeDataFormat(StyleEntry style){
  Integer type=(Integer)style.getProperty(StyleConstant.DATA_TYPE_PROP);
  if (type == SheetData.DATE && style.getProperty(StyleConstant.DATE_FORMAT_PROP) != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",style.getProperty(StyleConstant.DATE_FORMAT_PROP));
    writer.closeTag("String_Node_Str");
  }
 else   if (type == Data.NUMBER && style.getProperty(StyleConstant.NUMBER_FORMAT_PROP) != null) {
    writer.openTag("String_Node_Str");
    String numberStyle=(String)style.getProperty(StyleConstant.NUMBER_FORMAT_PROP);
    writer.attribute("String_Node_Str",numberStyle);
    writer.closeTag("String_Node_Str");
  }
}
Program: 69031
Project: 69031
Buggy source:
public static StyleEntry applyDiagonalLine(StyleEntry entry,String color,String style,int width){
  if (width > 0) {
    entry.setProperty(StyleConstant.BORDER_DIAGONAL_COLOR_PROP,convertColor(color));
    entry.setProperty(StyleConstant.BORDER_DIAGONAL_STYLE_PROP,convertBorderStyle(style));
    entry.setProperty(StyleConstant.BORDER_DIAGONAL_WIDTH_PROP,convertBorderWeight(width));
  }
  return entry;
}

Fixed version (ground truth):
public static StyleEntry applyDiagonalLine(StyleEntry entry,Color color,String style,int width){
  if (width > 0) {
    entry.setProperty(StyleConstant.BORDER_DIAGONAL_COLOR_PROP,color);
    entry.setProperty(StyleConstant.BORDER_DIAGONAL_STYLE_PROP,convertBorderStyle(style));
    entry.setProperty(StyleConstant.BORDER_DIAGONAL_WIDTH_PROP,convertBorderWeight(width));
  }
  return entry;
}
Program: 69033
Project: 69033
Buggy source:
protected String getBorderWidth(String[] values,CSSEngine engine){
  for (int i=0; i < values.length; i++) {
    LexicalUnit u=getUnit(values[i],engine);
    if (u != null) {
      int type=u.getLexicalUnitType();
      if (type >= LexicalUnit.SAC_EM && type <= LexicalUnit.SAC_PERCENTAGE) {
        return values[i];
      }
 else       if (type == LexicalUnit.SAC_IDENT) {
        if (isIdentifier(values[i],IStyle.STYLE_BORDER_TOP_WIDTH,engine)) {
          return values[i];
        }
      }
    }
  }
  return CSSConstants.CSS_MEDIUM_VALUE;
}

Fixed version (ground truth):
protected String getBorderWidth(String[] values,CSSEngine engine){
  for (int i=0; i < values.length; i++) {
    LexicalUnit u=getUnit(values[i],engine);
    if (u != null) {
      int type=u.getLexicalUnitType();
      if (type >= LexicalUnit.SAC_EM && type <= LexicalUnit.SAC_PERCENTAGE) {
        return values[i];
      }
 else       if (type == LexicalUnit.SAC_IDENT) {
        if (CSSConstants.CSS_MEDIUM_VALUE.equals(values[i]) || CSSConstants.CSS_THICK_VALUE.equals(values[i]) || CSSConstants.CSS_THIN_VALUE.equals(values[i])) {
          return values[i];
        }
      }
    }
  }
  return CSSConstants.CSS_MEDIUM_VALUE;
}
Program: 69034
Project: 69034
Buggy source:
/** 
 * Moves down one segment from its current segment of the iterator.
 * @return
 * @throws IOException
 */
private boolean nextSegment() throws IOException {
  if (stopSign.isStopped()) {
    return false;
  }
  if (!traversalor.next()) {
    return false;
  }
  currentSubDim=traversalor.getIntArray();
  currentSegment=factTable.getDocumentManager().openDocumentObject(FTSUDocumentObjectNamingUtil.getDocumentObjectName(NamingUtil.getFactTableName(factTable.getName()),getSubDimensionIndex()));
  for (int i=0; i < dimensionIndex.length; i++) {
    if (dimensionIndex[i] != -1) {
      SelectedSubDimension selectedSubDimension=((SelectedSubDimension)selectedSubDim[i].get(currentSubDim[i]));
      selectedPosOfCurSegment[i]=new int[selectedSubDimension.end - selectedSubDimension.start + 1];
      for (int j=0; j < selectedSubDimension.end - selectedSubDimension.start + 1; j++) {
        selectedPosOfCurSegment[i][j]=((Integer)selectedPos[dimensionIndex[i]].get(selectedSubDimension.start + j)).intValue();
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Moves down one segment from its current segment of the iterator.
 * @return
 * @throws IOException
 */
private boolean nextSegment() throws IOException {
  while (true) {
    if (stopSign.isStopped()) {
      return false;
    }
    if (!traversalor.next()) {
      return false;
    }
    currentSubDim=traversalor.getIntArray();
    String FTSUDocName=FTSUDocumentObjectNamingUtil.getDocumentObjectName(NamingUtil.getFactTableName(factTable.getName()),getSubDimensionIndex());
    if (!factTable.getDocumentManager().exist(FTSUDocName)) {
      continue;
    }
    currentSegment=factTable.getDocumentManager().openDocumentObject(FTSUDocName);
    for (int i=0; i < dimensionIndex.length; i++) {
      if (dimensionIndex[i] != -1) {
        SelectedSubDimension selectedSubDimension=((SelectedSubDimension)selectedSubDim[i].get(currentSubDim[i]));
        selectedPosOfCurSegment[i]=new int[selectedSubDimension.end - selectedSubDimension.start + 1];
        for (int j=0; j < selectedSubDimension.end - selectedSubDimension.start + 1; j++) {
          selectedPosOfCurSegment[i][j]=((Integer)selectedPos[dimensionIndex[i]].get(selectedSubDimension.start + j)).intValue();
        }
      }
    }
    break;
  }
  return true;
}
Program: 69035
Project: 69035
Buggy source:
public String getName(){
  return name;
}

Fixed version (ground truth):
public String getName(){
  if (name != null) {
    return name;
  }
 else   if (generateBy instanceof ReportElementDesign) {
    return ((ReportElementDesign)generateBy).getName();
  }
  return null;
}
Program: 69039
Project: 69039
Buggy source:
public String getColumnText(Object element,int columnIndex){
  if (element == dummyChoice) {
    if (columnIndex == 1) {
      return INPUT_PROPMT;
    }
    return "String_Node_Str";
  }
  ComputedColumnHandle handle=((ComputedColumnHandle)element);
  String text=null;
switch (columnIndex) {
case 1:
    text=handle.getName();
  break;
case 2:
text=handle.getDisplayNameID();
break;
case 3:
text=handle.getDisplayName();
break;
case 4:
text=ChoiceSetFactory.getDisplayNameFromChoiceSet(handle.getDataType(),DATA_TYPE_CHOICE_SET);
break;
case 5:
text=org.eclipse.birt.report.designer.data.ui.util.DataUtil.getAggregationExpression(handle);
break;
case 6:
try {
String function=handle.getAggregateFunction();
if (function != null) {
if (org.eclipse.birt.report.designer.data.ui.util.DataUtil.getAggregationManager().getAggregation(function) != null) text=org.eclipse.birt.report.designer.data.ui.util.DataUtil.getAggregationManager().getAggregation(function).getDisplayName();
}
}
 catch (BirtException e) {
ExceptionHandler.handle(e);
}
case 7:
text=handle.getFilterExpression();
break;
case 8:
String value=DEUtil.getAggregateOn(handle);
if (value == null) {
if (handle.getAggregateFunction() != null) {
text=ALL;
}
 else text=NONE_AGGREGATEON;
}
 else {
text=value;
}
break;
}
if (text == null) {
text="String_Node_Str";
}
return text;
}

Fixed version (ground truth):
public String getColumnText(Object element,int columnIndex){
  if (element == dummyChoice) {
    if (columnIndex == 1) {
      return INPUT_PROPMT;
    }
    return "String_Node_Str";
  }
  ComputedColumnHandle handle=((ComputedColumnHandle)element);
  String text=null;
switch (columnIndex) {
case 1:
    text=handle.getName();
  break;
case 2:
text=handle.getDisplayNameID();
break;
case 3:
text=handle.getDisplayName();
break;
case 4:
text=ChoiceSetFactory.getDisplayNameFromChoiceSet(handle.getDataType(),DATA_TYPE_CHOICE_SET);
break;
case 5:
text=org.eclipse.birt.report.designer.data.ui.util.DataUtil.getAggregationExpression(handle);
break;
case 6:
try {
String function=handle.getAggregateFunction();
if (function != null) {
if (org.eclipse.birt.report.designer.data.ui.util.DataUtil.getAggregationManager().getAggregation(function) != null) text=org.eclipse.birt.report.designer.data.ui.util.DataUtil.getAggregationManager().getAggregation(function).getDisplayName();
}
}
 catch (BirtException e) {
ExceptionHandler.handle(e);
}
break;
case 7:
text=handle.getFilterExpression();
break;
case 8:
String value=DEUtil.getAggregateOn(handle);
if (value == null) {
if (handle.getAggregateFunction() != null) {
text=ALL;
}
 else text=NONE_AGGREGATEON;
}
 else {
text=value;
}
break;
}
if (text == null) {
text="String_Node_Str";
}
return text;
}
Program: 69040
Project: 69040
Buggy source:
private void createAggregationItem(Composite composite){
  SeriesDefinition baseSD=ChartUIUtil.getBaseSeriesDefinitions(context.getModel()).get(0);
  boolean enabled=ChartUIUtil.isGroupingSupported(context) && (PluginSettings.instance().inEclipseEnv() || baseSD.getGrouping().isEnabled());
  if (query.getGrouping() == null) {
    SeriesGrouping aggGrouping=SeriesGroupingImpl.create();
    aggGrouping.setAggregateExpression(seriesdefinition.getGrouping().getAggregateExpression());
    query.setGrouping(aggGrouping);
  }
  fAggEditorComposite=new AggregateEditorComposite(composite,seriesdefinition,context,enabled,query);
}

Fixed version (ground truth):
private void createAggregationItem(Composite composite){
  SeriesDefinition baseSD=ChartUIUtil.getBaseSeriesDefinitions(context.getModel()).get(0);
  boolean enabled=ChartUIUtil.isGroupingSupported(context) && (PluginSettings.instance().inEclipseEnv() || baseSD.getGrouping().isEnabled());
  if (query.getGrouping() == null) {
    SeriesGrouping aggGrouping=SeriesGroupingImpl.create();
    if (seriesdefinition.getGrouping() != null) {
      aggGrouping.setAggregateExpression(seriesdefinition.getGrouping().getAggregateExpression());
    }
    query.setGrouping(aggGrouping);
  }
  fAggEditorComposite=new AggregateEditorComposite(composite,seriesdefinition,context,enabled,query);
}
Program: 69041
Project: 69041
Buggy source:
private int transferDimensions(int srcAxis,int offset) throws SemanticException {
  int transfered=0;
  int dimCount=crosstab.getDimensionCount(srcAxis) - offset;
  if (dimCount > 0) {
    int targetAxis=CrosstabModelUtil.getOppositeAxisType(srcAxis);
    CrosstabViewHandle targetCrosstabView=crosstab.getCrosstabView(targetAxis);
    if (targetCrosstabView == null) {
      targetCrosstabView=crosstab.addCrosstabView(targetAxis);
    }
    DesignElementHandle targetViewHandle=targetCrosstabView.getModelHandle();
    for (int i=0; i < dimCount; i++) {
      DimensionViewHandle dv=crosstab.getDimension(srcAxis,offset + i);
      dv.getModelHandle().moveTo(targetViewHandle,ICrosstabViewConstants.VIEWS_PROP,i);
      transfered++;
    }
  }
  return transfered;
}

Fixed version (ground truth):
private int transferDimensions(int srcAxis,int offset) throws SemanticException {
  int transfered=0;
  int dimCount=crosstab.getDimensionCount(srcAxis) - offset;
  if (dimCount > 0) {
    int targetAxis=CrosstabModelUtil.getOppositeAxisType(srcAxis);
    CrosstabViewHandle targetCrosstabView=crosstab.getCrosstabView(targetAxis);
    if (targetCrosstabView == null) {
      targetCrosstabView=crosstab.addCrosstabView(targetAxis);
    }
    DesignElementHandle targetViewHandle=targetCrosstabView.getModelHandle();
    for (int i=0; i < dimCount; i++) {
      DimensionViewHandle dv=crosstab.getDimension(srcAxis,offset);
      dv.getModelHandle().moveTo(targetViewHandle,ICrosstabViewConstants.VIEWS_PROP,i);
      transfered++;
    }
  }
  return transfered;
}