nus-yam/ex-repair huggingface dataset:
Program: 69859
Project: 69859
Buggy source:
private void switchMarkerType(int newMarkerTypeIndex){
  MarkerType newType=MarkerType.getByName(typeNameSet[newMarkerTypeIndex]);
  if (newType == MarkerType.ICON_LITERAL) {
    MarkerIconDialog iconDialog=new MarkerIconDialog(new Shell(),getMarker().getFill());
    if (iconDialog.open() == Window.OK) {
      Fill resultFill=iconDialog.getFill();
      if (resultFill.eAdapters().isEmpty()) {
        resultFill.eAdapters().addAll(getMarker().eAdapters());
      }
      getMarker().setFill(resultFill);
    }
 else {
      return;
    }
  }
  getMarker().setType(newType);
  Control[] children=cmpType.getChildren();
  children[newMarkerTypeIndex].redraw();
  children[markerTypeIndex].redraw();
  updateMarkerPreview();
}

Fixed version (ground truth):
private void switchMarkerType(int newMarkerTypeIndex){
  MarkerType newType=MarkerType.getByName(typeNameSet[newMarkerTypeIndex]);
  if (newType == MarkerType.ICON_LITERAL) {
    MarkerIconDialog iconDialog=new MarkerIconDialog(new Shell(),getMarker().getFill());
    if (iconDialog.open() == Window.OK) {
      Fill resultFill=iconDialog.getFill();
      if (resultFill.eAdapters().isEmpty()) {
        resultFill.eAdapters().addAll(getMarker().eAdapters());
      }
      getMarker().setFill(resultFill);
    }
 else {
      return;
    }
  }
  getMarker().setType(newType);
  updateMarkerPreview();
}
Program: 69860
Project: 69860
Buggy source:
public void initialize() throws BirtException {
  if (content == null) {
    this.maxAvaWidth=width;
    return;
  }
  IStyle style=content.getStyle();
  calculateSpecifiedWidth(content);
  calculateSpecifiedHeight(content);
  if (style == null || style.isEmpty()) {
    hasStyle=false;
    boxStyle=BoxStyle.DEFAULT;
    localProperties=LocalProperties.DEFAULT;
    if (specifiedWidth > 0) {
      this.width=specifiedWidth;
    }
 else {
      if (parent != null) {
        this.width=parent.getMaxAvaWidth();
      }
    }
    this.maxAvaWidth=width;
  }
 else {
    buildProperties(content,context);
    if (specifiedWidth > 0) {
      this.width=specifiedWidth;
    }
 else {
      if (parent != null) {
        setAllocatedWidth(parent.getMaxAvaWidth());
      }
    }
    maxAvaWidth=getContentWidth();
  }
  textAlign=content.getComputedStyle().getProperty(IStyle.STYLE_TEXT_ALIGN);
  this.bookmark=content.getBookmark();
  this.action=content.getHyperlinkAction();
  parent.add(this);
}

Fixed version (ground truth):
public void initialize() throws BirtException {
  if (content == null) {
    this.maxAvaWidth=width;
    return;
  }
  IStyle style=content.getStyle();
  calculateSpecifiedWidth(content);
  calculateSpecifiedHeight(content);
  if (style == null || style.isEmpty()) {
    hasStyle=false;
    boxStyle=BoxStyle.DEFAULT;
    localProperties=LocalProperties.DEFAULT;
    if (specifiedWidth > 0) {
      setContentWidth(specifiedWidth);
    }
 else {
      if (parent != null) {
        this.width=parent.getMaxAvaWidth();
      }
    }
    this.maxAvaWidth=width;
  }
 else {
    buildProperties(content,context);
    if (specifiedWidth > 0) {
      setContentWidth(specifiedWidth);
    }
 else {
      if (parent != null) {
        setAllocatedWidth(parent.getMaxAvaWidth());
      }
    }
    maxAvaWidth=getContentWidth();
  }
  textAlign=content.getComputedStyle().getProperty(IStyle.STYLE_TEXT_ALIGN);
  this.bookmark=content.getBookmark();
  this.action=content.getHyperlinkAction();
  parent.add(this);
}
Program: 69862
Project: 69862
Buggy source:
/** 
 * @param dataSetDesign
 * @param appContext 
 * @return
 * @throws DataException
 */
private static IBaseDataSetDesign cloneDataSetDesign(IBaseDataSetDesign dataSetDesign,Map appContext) throws DataException {
  if (dataSetDesign instanceof IScriptDataSetDesign) {
    return new ScriptDataSetAdapter(dataSetDesign);
  }
 else   if (dataSetDesign instanceof IOdaDataSetDesign) {
    return adaptOdaDataSetDesign(dataSetDesign,appContext);
  }
 else   if (dataSetDesign instanceof IJointDataSetDesign) {
    return new JointDataSetAdapter(dataSetDesign);
  }
 else {
    IBaseDataSetDesign design=DataSetDesignHelper.createAdapter(dataSetDesign);
    if (design == null)     throw new DataException(ResourceConstants.UNSUPPORTED_DATASET_TYPE,dataSetDesign.getName());
 else     return design;
  }
}

Fixed version (ground truth):
/** 
 * @param dataSetDesign
 * @param appContext 
 * @return
 * @throws DataException
 */
private static IBaseDataSetDesign cloneDataSetDesign(IBaseDataSetDesign dataSetDesign,Map appContext) throws DataException {
  if (dataSetDesign instanceof IScriptDataSetDesign) {
    return new ScriptDataSetAdapter(dataSetDesign);
  }
 else   if (dataSetDesign instanceof IOdaDataSetDesign) {
    return adaptOdaDataSetDesign(dataSetDesign,appContext);
  }
 else   if (dataSetDesign instanceof IJointDataSetDesign) {
    return new JointDataSetAdapter(dataSetDesign);
  }
 else {
    IBaseDataSetDesign design=DataSetDesignHelper.createAdapter(dataSetDesign);
    return design;
  }
}
Program: 69863
Project: 69863
Buggy source:
public static void defineDataSourceAndDataSet(DataSetHandle dataSet,DataEngine dataEngine,IModelAdapter modelAdaptor) throws BirtException {
  DataSourceHandle dataSource=dataSet.getDataSource();
  if (dataSource != null && ((DataEngineImpl)dataEngine).getDataSourceRuntime(dataSource.getName()) == null) {
    dataEngine.defineDataSource(modelAdaptor.adaptDataSource(dataSource));
  }
  if (dataSet instanceof JointDataSetHandle) {
    JointDataSetHandle jointDataSet=(JointDataSetHandle)dataSet;
    Iterator iter=jointDataSet.dataSetsIterator();
    while (iter.hasNext()) {
      DataSetHandle childDataSet=(DataSetHandle)iter.next();
      if (childDataSet != null) {
        DataSourceHandle childDataSource=childDataSet.getDataSource();
        if (childDataSource != null) {
          dataEngine.defineDataSource(modelAdaptor.adaptDataSource(childDataSource));
        }
        defineDataSourceAndDataSet(childDataSet,dataEngine,modelAdaptor);
      }
    }
  }
  if (dataSet instanceof DerivedDataSetHandle) {
    List inputDataSet=((DerivedDataSetHandle)dataSet).getInputDataSets();
    for (int i=0; i < inputDataSet.size(); i++) {
      defineDataSourceAndDataSet((DataSetHandle)inputDataSet.get(i),dataEngine,modelAdaptor);
    }
  }
  if (((DataEngineImpl)dataEngine).getDataSetDesign(dataSet.getQualifiedName()) == null)   dataEngine.defineDataSet(modelAdaptor.adaptDataSet(dataSet));
}

Fixed version (ground truth):
public static void defineDataSourceAndDataSet(DataSetHandle dataSet,DataEngine dataEngine,IModelAdapter modelAdaptor) throws BirtException {
  if (dataSet == null)   return;
  DataSourceHandle dataSource=dataSet.getDataSource();
  if (dataSource != null && ((DataEngineImpl)dataEngine).getDataSourceRuntime(dataSource.getName()) == null) {
    dataEngine.defineDataSource(modelAdaptor.adaptDataSource(dataSource));
  }
  if (dataSet instanceof JointDataSetHandle) {
    JointDataSetHandle jointDataSet=(JointDataSetHandle)dataSet;
    Iterator iter=jointDataSet.dataSetsIterator();
    while (iter.hasNext()) {
      DataSetHandle childDataSet=(DataSetHandle)iter.next();
      if (childDataSet != null) {
        DataSourceHandle childDataSource=childDataSet.getDataSource();
        if (childDataSource != null) {
          dataEngine.defineDataSource(modelAdaptor.adaptDataSource(childDataSource));
        }
        defineDataSourceAndDataSet(childDataSet,dataEngine,modelAdaptor);
      }
    }
  }
  if (dataSet instanceof DerivedDataSetHandle) {
    List inputDataSet=((DerivedDataSetHandle)dataSet).getInputDataSets();
    for (int i=0; i < inputDataSet.size(); i++) {
      defineDataSourceAndDataSet((DataSetHandle)inputDataSet.get(i),dataEngine,modelAdaptor);
    }
  }
  if (((DataEngineImpl)dataEngine).getDataSetDesign(dataSet.getQualifiedName()) == null)   dataEngine.defineDataSet(modelAdaptor.adaptDataSet(dataSet));
}
Program: 69864
Project: 69864
Buggy source:
public int getBaseLine(){
  if (baseLine == 0 && children.size() > 0) {
    Iterator iter=children.iterator();
    while (iter.hasNext()) {
      AbstractArea child=(AbstractArea)iter.next();
      baseLine=Math.max(baseLine,child.getBaseLine());
    }
  }
  return baseLine;
}

Fixed version (ground truth):
public int getBaseLine(){
  if (baseLine == 0 && children.size() > 0) {
    Iterator iter=children.iterator();
    while (iter.hasNext()) {
      AbstractArea child=(AbstractArea)iter.next();
      baseLine=Math.max(baseLine,child.getY() + child.getBaseLine());
    }
  }
  return baseLine;
}
Program: 69865
Project: 69865
Buggy source:
protected void verticalAlign(){
  Iterator iter=getChildren();
  while (iter.hasNext()) {
    AbstractArea child=(AbstractArea)iter.next();
    CSSValue vAlign=child.getVerticalAlign();
    if (IStyle.TOP_VALUE.equals(vAlign)) {
      continue;
    }
    int spacing=getContentHeight() - child.getAllocatedHeight();
    if (spacing < 0) {
      spacing=0;
    }
    if (vAlign == null || IStyle.BASELINE_VALUE.equals(vAlign)) {
      int lineHeight=parent.getLineHeight();
      if (lineHeight > 0) {
        child.setPosition(child.getX(),child.getY() + getBaseLine() - child.getBaseLine() + spacing / 2);
      }
 else {
        child.setPosition(child.getX(),child.getY() + getBaseLine() - child.getBaseLine());
      }
    }
 else     if (IStyle.BOTTOM_VALUE.equals(vAlign)) {
      child.setPosition(child.getX(),child.getY() + spacing);
    }
 else     if (IStyle.MIDDLE_VALUE.equals(vAlign)) {
      child.setPosition(child.getX(),child.getY() + spacing / 2);
    }
  }
}

Fixed version (ground truth):
protected void verticalAlign(){
  Iterator iter=getChildren();
  while (iter.hasNext()) {
    AbstractArea child=(AbstractArea)iter.next();
    CSSValue vAlign=child.getVerticalAlign();
    if (IStyle.TOP_VALUE.equals(vAlign)) {
      continue;
    }
    int spacing=getContentHeight() - child.getAllocatedHeight();
    if (spacing < 0) {
      spacing=0;
    }
    if (vAlign == null || IStyle.BASELINE_VALUE.equals(vAlign)) {
      int lineHeight=parent.getLineHeight();
      if (lineHeight > 0) {
        child.setPosition(child.getX(),getBaseLine() - child.getBaseLine() + spacing / 2);
      }
 else {
        child.setPosition(child.getX(),getBaseLine() - child.getBaseLine());
      }
    }
 else     if (IStyle.BOTTOM_VALUE.equals(vAlign)) {
      child.setPosition(child.getX(),child.getY() + spacing);
    }
 else     if (IStyle.MIDDLE_VALUE.equals(vAlign)) {
      child.setPosition(child.getX(),child.getY() + spacing / 2);
    }
  }
}
Program: 69866
Project: 69866
Buggy source:
public List validate(){
  List list=new ArrayList();
  if (!(this.getModelHandle().isInTemplateParameter()) && this.getCube() == null) {
    ExtendedElementException extendedException=new ExtendedElementException(this.getModelHandle().getElement(),"String_Node_Str","String_Node_Str",new Object[]{"String_Node_Str"},Messages.getResourceBundle());
    list.add(extendedException);
  }
  return list;
}

Fixed version (ground truth):
public List validate(){
  List list=new ArrayList();
  if (!(this.getModelHandle().isInTemplateParameter()) && this.getCube() == null && !(this.getModelHandle().getRoot() instanceof LibraryHandle)) {
    ExtendedElementException extendedException=new ExtendedElementException(this.getModelHandle().getElement(),"String_Node_Str","String_Node_Str",new Object[]{"String_Node_Str"},Messages.getResourceBundle());
    list.add(extendedException);
  }
  return list;
}
Program: 69867
Project: 69867
Buggy source:
private void drawDiagonalLine(ICellContent cell,double cellWidth){
  if (cellWidth == 0)   return;
  int cellHeight=WordUtil.convertTo(getCellHeight(cell),0) / 20;
  if (cellHeight == 0)   return;
  DiagonalLineInfo diagonalLineInfo=new DiagonalLineInfo();
  int diagonalWidth=PropertyUtil.getDimensionValue(cell,cell.getDiagonalWidth(),(int)cellWidth) / 1000;
  diagonalLineInfo.setDiagonalLine(cell.getDiagonalNumber(),cell.getDiagonalStyle(),diagonalWidth);
  diagonalLineInfo.setAntidiagonalLine(0,null,0);
  diagonalLineInfo.setCoordinateSize(cellWidth,cellHeight);
  String lineColor=WordUtil.parseColor(cell.getComputedStyle().getColor());
  diagonalLineInfo.setColor(lineColor);
  wordWriter.drawDiagonalLine(diagonalLineInfo);
}

Fixed version (ground truth):
private void drawDiagonalLine(ICellContent cell,double cellWidth){
  if (cellWidth == 0)   return;
  int cellHeight=WordUtil.convertTo(getCellHeight(cell),0) / 20;
  if (cellHeight == 0)   return;
  DiagonalLineInfo diagonalLineInfo=new DiagonalLineInfo();
  int diagonalWidth=PropertyUtil.getDimensionValue(cell,cell.getDiagonalWidth(),(int)cellWidth) / 1000;
  diagonalLineInfo.setDiagonalLine(cell.getDiagonalNumber(),cell.getDiagonalStyle(),diagonalWidth);
  diagonalLineInfo.setAntidiagonalLine(0,null,0);
  diagonalLineInfo.setCoordinateSize(cellWidth,cellHeight);
  String lineColor=null;
  if (cell.getDiagonalColor() != null) {
    lineColor=WordUtil.parseColor(cell.getDiagonalColor());
  }
 else {
    lineColor=WordUtil.parseColor(cell.getComputedStyle().getColor());
  }
  diagonalLineInfo.setColor(lineColor);
  wordWriter.drawDiagonalLine(diagonalLineInfo);
}
Program: 69868
Project: 69868
Buggy source:
public static String parseColor(String color){
  if ("String_Node_Str".equalsIgnoreCase(color) || color == null) {
    return null;
  }
  String[] values=color.substring(color.indexOf("String_Node_Str") + 1,color.length() - 1).split("String_Node_Str");
  String value="String_Node_Str";
  for (int i=0; i < values.length; i++) {
    try {
      String s=Integer.toHexString((Integer.parseInt(values[i].trim())));
      if (s.length() == 1) {
        s="String_Node_Str" + s;
      }
      value+=s;
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      value=null;
    }
  }
  return value;
}

Fixed version (ground truth):
public static String parseColor(String color){
  if ("String_Node_Str".equalsIgnoreCase(color) || color == null) {
    return null;
  }
 else   if (color.equalsIgnoreCase("String_Node_Str"))   return "String_Node_Str";
 else   if (color.equalsIgnoreCase("String_Node_Str"))   return "String_Node_Str";
 else   if (color.equalsIgnoreCase("String_Node_Str"))   return "String_Node_Str";
 else   if (color.equalsIgnoreCase("String_Node_Str"))   return "String_Node_Str";
 else   if (color.equalsIgnoreCase("String_Node_Str"))   return "String_Node_Str";
 else   if (color.equalsIgnoreCase("String_Node_Str"))   return "String_Node_Str";
 else   if (color.equalsIgnoreCase("String_Node_Str"))   return "String_Node_Str";
 else   if (color.equalsIgnoreCase("String_Node_Str"))   return "String_Node_Str";
 else   if (color.equalsIgnoreCase("String_Node_Str"))   return "String_Node_Str";
 else   if (color.equalsIgnoreCase("String_Node_Str"))   return "String_Node_Str";
 else   if (color.equalsIgnoreCase("String_Node_Str"))   return "String_Node_Str";
 else   if (color.equalsIgnoreCase("String_Node_Str"))   return "String_Node_Str";
 else   if (color.equalsIgnoreCase("String_Node_Str"))   return "String_Node_Str";
 else   if (color.equalsIgnoreCase("String_Node_Str"))   return "String_Node_Str";
 else   if (color.equalsIgnoreCase("String_Node_Str"))   return "String_Node_Str";
 else   if (color.equalsIgnoreCase("String_Node_Str"))   return "String_Node_Str";
  String[] values=color.substring(color.indexOf("String_Node_Str") + 1,color.length() - 1).split("String_Node_Str");
  String value="String_Node_Str";
  for (int i=0; i < values.length; i++) {
    try {
      String s=Integer.toHexString((Integer.parseInt(values[i].trim())));
      if (s.length() == 1) {
        s="String_Node_Str" + s;
      }
      value+=s;
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      value=null;
    }
  }
  return value;
}
Program: 69871
Project: 69871
Buggy source:
/** 
 * Makes one pass over the odiResult and calculates values for all aggregate expressions. odiResult must be open, and cursor placed at first row. Upon return, odiResult is rewinded to first row. Before calling this method, a Javascript "row" object must be set up in the passed-in JS context and bound to the passed in odiResult.
 */
private void calculate() throws DataException {
}

Fixed version (ground truth):
/** 
 * Makes one pass over the odiResult and calculates values for all aggregate expressions. odiResult must be open, and cursor placed at first row. Upon return, odiResult is rewinded to first row. Before calling this method, a Javascript "row" object must be set up in the passed-in JS context and bound to the passed in odiResult.
 */
private void calculate() throws DataException {
  List validAggregations=new ArrayList();
  boolean[] populateAggrValue=new boolean[this.currentAggrCount];
  int count=1;
  for (int i=0; i < this.currentAggrCount; i++) {
    validAggregations.add(new Integer(i));
    if (this.getAggrInfo(i).getAggregation().getNumberOfPasses() > 1)     populateAggrValue[i]=false;
 else     populateAggrValue[i]=true;
    accumulatorManagers[i]=new AccumulatorManager(this.getAggrInfo(i).getAggregation());
  }
  while (validAggregations.size() > 0) {
    int[] validAggregationArray=new int[validAggregations.size()];
    for (int i=0; i < validAggregations.size(); i++) {
      validAggregationArray[i]=((Integer)validAggregations.get(i)).intValue();
    }
    assert(this.getCurrentResult() == null || this.getCurrentResultIndex() == 0);
    if (this.getCurrentResult() == null) {
      return;
    }
    pass(populateAggrValue,validAggregationArray);
    this.first(0);
    count++;
    prepareNextIteration(validAggregations,populateAggrValue,count);
  }
}
Program: 69872
Project: 69872
Buggy source:
private void drawDiagonalLine(ICellContent cell,double cellWidth){
  if (cellWidth == 0)   return;
  int cellHeight=WordUtil.convertTo(getCellHeight(cell),0) / 20;
  if (cellHeight == 0)   return;
  DiagonalLineInfo diagonalLineInfo=new DiagonalLineInfo();
  int diagonalWidth=PropertyUtil.getDimensionValue(cell,cell.getDiagonalWidth(),(int)cellWidth) / 1000;
  diagonalLineInfo.setDiagonalLine(cell.getDiagonalNumber(),cell.getDiagonalStyle(),diagonalWidth);
  int antidiagonalWidth=PropertyUtil.getDimensionValue(cell,cell.getAntidiagonalWidth(),(int)cellWidth) / 1000;
  diagonalLineInfo.setAntidiagonalLine(cell.getAntidiagonalNumber(),cell.getAntidiagonalStyle(),antidiagonalWidth);
  diagonalLineInfo.setCoordinateSize(cellWidth,cellHeight);
  String lineColor=WordUtil.parseColor(cell.getComputedStyle().getColor());
  diagonalLineInfo.setColor(lineColor);
  wordWriter.drawDiagonalLine(diagonalLineInfo);
}

Fixed version (ground truth):
private void drawDiagonalLine(ICellContent cell,double cellWidth){
  if (cellWidth == 0)   return;
  int cellHeight=WordUtil.convertTo(getCellHeight(cell),0) / 20;
  if (cellHeight == 0)   return;
  DiagonalLineInfo diagonalLineInfo=new DiagonalLineInfo();
  int diagonalWidth=PropertyUtil.getDimensionValue(cell,cell.getDiagonalWidth(),(int)cellWidth) / 1000;
  diagonalLineInfo.setDiagonalLine(cell.getDiagonalNumber(),cell.getDiagonalStyle(),diagonalWidth);
  diagonalLineInfo.setAntidiagonalLine(0,null,0);
  diagonalLineInfo.setCoordinateSize(cellWidth,cellHeight);
  String lineColor=WordUtil.parseColor(cell.getComputedStyle().getColor());
  diagonalLineInfo.setColor(lineColor);
  wordWriter.drawDiagonalLine(diagonalLineInfo);
}
Program: 69873
Project: 69873
Buggy source:
public void startCell(ICellContent cell){
  rowFilledFlag=true;
  context.startCell();
  int columnId=cell.getColumn();
  List<SpanInfo> spans=context.getSpans(columnId);
  if (spans != null) {
    for (int i=0; i < spans.size(); i++) {
      wordWriter.writeSpanCell(spans.get(i));
    }
  }
  int columnSpan=cell.getColSpan();
  int rowSpan=cell.getRowSpan();
  int cellWidth=context.getCellWidth(columnId,columnSpan);
  IStyle style=computeStyle(cell.getComputedStyle());
  if (rowSpan > 1) {
    context.addSpan(columnId,columnSpan,cellWidth,rowSpan,style);
  }
  SpanInfo info=null;
  if (columnSpan > 1 || rowSpan > 1) {
    info=new SpanInfo(columnId,columnSpan,cellWidth,true,style);
  }
  wordWriter.startTableCell(cellWidth,style,info);
  context.addWidth(getCellWidth(cellWidth,style));
  writeTableToc();
  if (cell.getDiagonalNumber() != 0 || cell.getAntidiagonalNumber() != 0) {
    drawDiagonalLine(cell,WordUtil.twipToPt(cellWidth));
  }
}

Fixed version (ground truth):
public void startCell(ICellContent cell){
  rowFilledFlag=true;
  context.startCell();
  int columnId=cell.getColumn();
  List<SpanInfo> spans=context.getSpans(columnId);
  if (spans != null) {
    for (int i=0; i < spans.size(); i++) {
      wordWriter.writeSpanCell(spans.get(i));
    }
  }
  int columnSpan=cell.getColSpan();
  int rowSpan=cell.getRowSpan();
  int cellWidth=context.getCellWidth(columnId,columnSpan);
  IStyle style=computeStyle(cell.getComputedStyle());
  if (rowSpan > 1) {
    context.addSpan(columnId,columnSpan,cellWidth,rowSpan,style);
  }
  SpanInfo info=null;
  if (columnSpan > 1 || rowSpan > 1) {
    info=new SpanInfo(columnId,columnSpan,cellWidth,true,style);
  }
  wordWriter.startTableCell(cellWidth,style,info);
  context.addWidth(getCellWidth(cellWidth,style));
  writeTableToc();
  if (cell.getDiagonalNumber() != 0) {
    drawDiagonalLine(cell,WordUtil.twipToPt(cellWidth));
  }
}
Program: 69874
Project: 69874
Buggy source:
public void setDiagonalLine(int diagonalCount,String diagonalStyle,int diagonalWidth){
  this.diagonalCount=diagonalCount;
  this.diagonalStyle=diagonalStyle;
  this.diagonalWidth=diagonalWidth;
}

Fixed version (ground truth):
public void setDiagonalLine(int diagonalCount,String diagonalStyle,int diagonalWidth){
  if (diagonalCount > 3) {
    this.diagonalCount=3;
  }
 else {
    this.diagonalCount=diagonalCount;
  }
  this.diagonalStyle=diagonalStyle;
  this.diagonalWidth=diagonalWidth;
}
Program: 69875
Project: 69875
Buggy source:
public boolean performOk(){
  if (doSaveEmptyParameter(parameters)) {
    refreshPositions();
    if (this.modelChanged && this.getContainer() != null && this.getContainer() instanceof DataSetEditor) {
      this.modelChanged=false;
      ((DataSetHandle)getContainer().getModel()).removeListener(this);
      ((DataSetEditor)getContainer()).updateDataSetDesign(this);
    }
    return super.performOk();
  }
 else {
    String name=getNoneValuedParameterName();
    TestDialog a=new TestDialog(null,"String_Node_Str");
    if (a.open() == Dialog.OK)     return true;
 else     return false;
  }
}

Fixed version (ground truth):
public boolean performOk(){
  if (doSaveEmptyParameter(parameters)) {
    refreshPositions();
    if (this.modelChanged && this.getContainer() != null && this.getContainer() instanceof DataSetEditor) {
      this.modelChanged=false;
      ((DataSetHandle)getContainer().getModel()).removeListener(this);
      ((DataSetEditor)getContainer()).updateDataSetDesign(this);
    }
    return super.performOk();
  }
 else {
    String name=getNoneValuedParameterName();
    boolean confirm=MessageDialog.openConfirm(null,Messages.getString("String_Node_Str"),Messages.getFormattedString("String_Node_Str",new Object[]{name}));
    if (confirm)     ((DataSetEditor)getContainer()).updateDataSetDesign(this);
    return confirm;
  }
}
Program: 69876
Project: 69876
Buggy source:
void mouseDown(MouseEvent e){
  if (e.widget instanceof Canvas) {
    int markerIndex=((Integer)e.widget.getData()).intValue();
    switchMarkerType(markerIndex);
    if (!this.getShell().isDisposed()) {
      this.getShell().close();
    }
  }
}

Fixed version (ground truth):
void mouseDown(MouseEvent e){
  if (e.widget instanceof Canvas) {
    int markerIndex=((Integer)e.widget.getData()).intValue();
    switchMarkerType(markerIndex);
    if (!this.isDisposed() && !this.getShell().isDisposed()) {
      this.getShell().close();
    }
  }
}
Program: 69877
Project: 69877
Buggy source:
private void switchMarkerType(int newMarkerTypeIndex){
  MarkerType newType=MarkerType.getByName(typeNameSet[newMarkerTypeIndex]);
  if (newType == MarkerType.ICON_LITERAL) {
    MarkerIconDialog iconDialog=new MarkerIconDialog(this.getShell(),getMarker().getFill());
    if (iconDialog.open() == Window.OK) {
      Fill resultFill=iconDialog.getFill();
      if (resultFill.eAdapters().isEmpty()) {
        resultFill.eAdapters().addAll(getMarker().eAdapters());
      }
      getMarker().setFill(resultFill);
    }
 else {
      return;
    }
  }
  getMarker().setType(newType);
  Control[] children=cmpType.getChildren();
  children[newMarkerTypeIndex].redraw();
  children[markerTypeIndex].redraw();
  updateMarkerPreview();
}

Fixed version (ground truth):
private void switchMarkerType(int newMarkerTypeIndex){
  MarkerType newType=MarkerType.getByName(typeNameSet[newMarkerTypeIndex]);
  if (newType == MarkerType.ICON_LITERAL) {
    MarkerIconDialog iconDialog=new MarkerIconDialog(new Shell(),getMarker().getFill());
    if (iconDialog.open() == Window.OK) {
      Fill resultFill=iconDialog.getFill();
      if (resultFill.eAdapters().isEmpty()) {
        resultFill.eAdapters().addAll(getMarker().eAdapters());
      }
      getMarker().setFill(resultFill);
    }
 else {
      return;
    }
  }
  getMarker().setType(newType);
  Control[] children=cmpType.getChildren();
  children[newMarkerTypeIndex].redraw();
  children[markerTypeIndex].redraw();
  updateMarkerPreview();
}
Program: 69878
Project: 69878
Buggy source:
protected Control createContents(Composite parent){
  getShell().setText(Messages.getString("String_Node_Str"));
  getShell().setSize(600,435);
  UIHelper.centerOnScreen(getShell());
  Control c=super.createContents(parent);
  if (icon instanceof EmbeddedImage) {
    btnEmbeddedImage.setSelection(true);
    switchTo(EMBEDDED_TYPE);
  }
  c.pack();
  preview();
  return c;
}

Fixed version (ground truth):
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;
}
Program: 69879
Project: 69879
Buggy source:
private void swtichToLocalType(){
  Composite buttonBar=new Composite(inputArea,SWT.NONE);
  GridLayout gl=new GridLayout();
  gl.marginWidth=0;
  gl.marginHeight=0;
  buttonBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  buttonBar.setLayout(gl);
  Label description=new Label(buttonBar,SWT.NONE);
  description.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
  description.setText(Messages.getString("String_Node_Str"));
  btnBrowse=new Button(buttonBar,SWT.PUSH);
  btnBrowse.setText(Messages.getString("String_Node_Str"));
  GridData gd=new GridData(GridData.HORIZONTAL_ALIGN_END);
  gd.grabExcessHorizontalSpace=true;
  btnBrowse.setLayoutData(gd);
  btnBrowse.addSelectionListener(this);
}

Fixed version (ground truth):
private void swtichToLocalType(){
  Composite buttonBar=new Composite(inputArea,SWT.NONE);
  GridLayout gl=new GridLayout();
  gl.marginWidth=0;
  gl.marginHeight=0;
  buttonBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  buttonBar.setLayout(gl);
  Label description=new Label(buttonBar,SWT.WRAP);
  description.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING));
  description.setText(Messages.getString("String_Node_Str"));
  btnBrowse=new Button(buttonBar,SWT.PUSH);
  btnBrowse.setText(Messages.getString("String_Node_Str"));
  GridData gd=new GridData(GridData.HORIZONTAL_ALIGN_END);
  gd.grabExcessHorizontalSpace=true;
  btnBrowse.setLayoutData(gd);
  btnBrowse.addSelectionListener(this);
}
Program: 69880
Project: 69880
Buggy source:
public boolean onBroughtToTop(IReportEditorPage prePage){
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  if (getStaleType() == IPageStaleType.MODEL_RELOAD) {
    reloadEditorInput();
    doSave(null);
  }
 else   if (prePage != this && (prePage.isDirty() || prePage.getStaleType() != IPageStaleType.NONE)) {
    ModuleHandle model=getProvider().getReportModuleHandle(getEditorInput(),false);
    if (ModuleUtil.compareReportVersion(ModuleUtil.getReportVersion(),model.getVersion()) > 0) {
      if (!MessageDialog.openConfirm(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"))) {
        return false;
      }
    }
    prePage.doSave(null);
    UIUtil.doFinishSava(getModel());
    prePage.markPageStale(IPageStaleType.NONE);
    refreshDocument();
    markPageStale(IPageStaleType.NONE);
  }
  hookModelEventManager(getModel());
  ReportRequest request=new ReportRequest(ReportXMLSourceEditorFormPage.this);
  List list=new ArrayList();
  request.setSelectionObject(list);
  request.setType(ReportRequest.SELECTION);
  SessionHandleAdapter.getInstance().getMediator(getModel()).notifyRequest(request);
  reportXMLEditor.setFocus();
  return true;
}

Fixed version (ground truth):
public boolean onBroughtToTop(IReportEditorPage prePage){
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  if (getStaleType() == IPageStaleType.MODEL_RELOAD) {
    reloadEditorInput();
    doSave(null);
  }
 else   if (prePage != this && (prePage.isDirty() || prePage.getStaleType() != IPageStaleType.NONE)) {
    ModuleHandle model=getProvider().getReportModuleHandle(getEditorInput(),false);
    if (ModuleUtil.compareReportVersion(ModuleUtil.getReportVersion(),model.getVersion()) > 0) {
      if (!MessageDialog.openConfirm(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"))) {
        return false;
      }
    }
    prePage.doSave(null);
    UIUtil.doFinishSava(getModel());
    prePage.markPageStale(IPageStaleType.NONE);
    refreshDocument();
    markPageStale(IPageStaleType.NONE);
  }
  hookModelEventManager(getModel());
  SessionHandleAdapter.getInstance().getMediator(getProvider().getReportModuleHandle(getEditorInput())).addColleague(this);
  ReportRequest request=new ReportRequest(ReportXMLSourceEditorFormPage.this);
  List list=new ArrayList();
  request.setSelectionObject(list);
  request.setType(ReportRequest.SELECTION);
  SessionHandleAdapter.getInstance().getMediator(getModel()).notifyRequest(request);
  reportXMLEditor.setFocus();
  return true;
}
Program: 69884
Project: 69884
Buggy source:
/** 
 * Sets the <code>'class'</code> property and stores the style to styleMap object.
 * @param styleClass the style name
 */
protected void setStyleName(String styleClass,IContent content){
  StringBuffer classBuffer=new StringBuffer();
  if (enableMetadata) {
    String metadataStyleClass=metadataEmitter.getMetadataStyleClass(content);
    if (null != metadataStyleClass) {
      classBuffer.append(metadataStyleClass);
    }
  }
  if (!enableInlineStyle && styleClass != null) {
    if (classBuffer.length() != 0) {
      classBuffer.append("String_Node_Str");
    }
    if (null != htmlIDNamespace) {
      classBuffer.append(getStyleClassWithNameSpace(styleClass));
    }
 else {
      classBuffer.append(styleClass);
    }
  }
  if (hasCsslinks) {
    Object genBy=content.getGenerateBy();
    if (genBy instanceof StyledElementDesign) {
      DesignElementHandle handle=((StyledElementDesign)genBy).getHandle();
      if (handle != null) {
        String name=handle.getStringProperty(ReportItemHandle.STYLE_PROP);
        if (name != null) {
          if (classBuffer.length() != 0) {
            classBuffer.append("String_Node_Str" + name);
          }
 else {
            classBuffer.append(name);
          }
        }
      }
    }
  }
  if (classBuffer.length() != 0) {
    writer.attribute(HTMLTags.ATTR_CLASS,classBuffer.toString());
  }
}

Fixed version (ground truth):
/** 
 * Sets the <code>'class'</code> property and stores the style to styleMap object.
 * @param styleClass the style name
 */
protected void setStyleName(String styleClass,IContent content){
  StringBuffer classBuffer=new StringBuffer();
  if (enableMetadata) {
    String metadataStyleClass=metadataEmitter.getMetadataStyleClass(content);
    if (null != metadataStyleClass) {
      classBuffer.append(metadataStyleClass);
    }
  }
  if (!enableInlineStyle && styleClass != null && styleClass.length() > 0) {
    String[] strings=styleClass.split("String_Node_Str");
    for (    String string : strings) {
      string=string.trim();
      if (string.length() > 0) {
        if (classBuffer.length() > 0) {
          classBuffer.append(' ');
        }
        if (null != htmlIDNamespace) {
          classBuffer.append(htmlIDNamespace);
        }
        classBuffer.append(string);
      }
    }
  }
  if (hasCsslinks) {
    Object genBy=content.getGenerateBy();
    if (genBy instanceof StyledElementDesign) {
      DesignElementHandle handle=((StyledElementDesign)genBy).getHandle();
      if (handle != null) {
        String name=handle.getStringProperty(ReportItemHandle.STYLE_PROP);
        if (name != null) {
          if (classBuffer.length() != 0) {
            classBuffer.append("String_Node_Str" + name);
          }
 else {
            classBuffer.append(name);
          }
        }
      }
    }
  }
  if (classBuffer.length() != 0) {
    writer.attribute(HTMLTags.ATTR_CLASS,classBuffer.toString());
  }
}
Program: 69886
Project: 69886
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(AttributeBuilderTest.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;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(AttributeBuilderTest.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);
  suite.addTestSuite(StyleTest.class);
  return suite;
}
Program: 69888
Project: 69888
Buggy source:
protected void endDiagonalCell(ICellContent cell){
  writer.closeTag(HTMLTags.TAG_DIV);
}

Fixed version (ground truth):
protected void endDiagonalCell(ICellContent cell){
  DimensionType cellWidth=getCellWidth(cell);
  DimensionType cellHeight=getCellHeight(cell);
  if (cellWidth == null || cellHeight == null)   return;
  writer.closeTag(HTMLTags.TAG_DIV);
}
Program: 69889
Project: 69889
Buggy source:
private void drawDiagonalLine(ICellContent cell,double cellWidth){
  DiagonalLineInfo diagonalLineInfo=new DiagonalLineInfo();
  int diagonalWidth=PropertyUtil.getDimensionValue(cell,cell.getDiagonalWidth(),(int)cellWidth) / 1000;
  diagonalLineInfo.setDiagonalLine(cell.getDiagonalNumber(),cell.getDiagonalStyle(),diagonalWidth);
  int antidiagonalWidth=PropertyUtil.getDimensionValue(cell,cell.getAntidiagonalWidth(),(int)cellWidth) / 1000;
  diagonalLineInfo.setAntidiagonalLine(cell.getAntidiagonalNumber(),cell.getAntidiagonalStyle(),antidiagonalWidth);
  int cellHeight=WordUtil.convertTo(getCellHeight(cell),0) / 20;
  diagonalLineInfo.setCoordinateSize(cellWidth,cellHeight);
  String lineColor=WordUtil.parseColor(cell.getComputedStyle().getColor());
  diagonalLineInfo.setColor(lineColor);
  wordWriter.drawDiagonalLine(diagonalLineInfo);
}

Fixed version (ground truth):
private void drawDiagonalLine(ICellContent cell,double cellWidth){
  if (cellWidth == 0)   return;
  int cellHeight=WordUtil.convertTo(getCellHeight(cell),0) / 20;
  if (cellHeight == 0)   return;
  DiagonalLineInfo diagonalLineInfo=new DiagonalLineInfo();
  int diagonalWidth=PropertyUtil.getDimensionValue(cell,cell.getDiagonalWidth(),(int)cellWidth) / 1000;
  diagonalLineInfo.setDiagonalLine(cell.getDiagonalNumber(),cell.getDiagonalStyle(),diagonalWidth);
  int antidiagonalWidth=PropertyUtil.getDimensionValue(cell,cell.getAntidiagonalWidth(),(int)cellWidth) / 1000;
  diagonalLineInfo.setAntidiagonalLine(cell.getAntidiagonalNumber(),cell.getAntidiagonalStyle(),antidiagonalWidth);
  diagonalLineInfo.setCoordinateSize(cellWidth,cellHeight);
  String lineColor=WordUtil.parseColor(cell.getComputedStyle().getColor());
  diagonalLineInfo.setColor(lineColor);
  wordWriter.drawDiagonalLine(diagonalLineInfo);
}
Program: 69895
Project: 69895
Buggy source:
/** 
 * With filter
 * @throws BirtException
 */
public void testBasic() throws Exception {
  this.GEN_add_filter=true;
  this.genBasicIV();
  this.closeArchiveWriter();
  DataEngineContext deContext2=newContext(DataEngineContext.MODE_UPDATE,fileName,fileName);
  deContext2.setTmpdir(this.getTempDir());
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  this.UPDATE_add_sort=true;
  this.updatePreBasicIV();
  this.closeArchiveReader();
  this.closeArchiveWriter();
  DataEngineContext deContext3=newContext(DataEngineContext.MODE_UPDATE,fileName,fileName);
  myPreDataEngine=DataEngine.newDataEngine(deContext3);
  this.PRE_add_filter=0;
  this.PRE_add_sort=true;
  this.PRE_execute_query=true;
  this.preBasicIV();
  this.checkOutputFile();
}

Fixed version (ground truth):
/** 
 * With filter
 * @throws BirtException
 */
public void testBasic() throws Exception {
  this.GEN_add_filter=true;
  this.GEN_print=true;
  this.genBasicIV();
  this.closeArchiveWriter();
  DataEngineContext deContext2=newContext(DataEngineContext.MODE_UPDATE,fileName,fileName);
  deContext2.setTmpdir(this.getTempDir());
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  this.UPDATE_add_sort=true;
  this.updatePreBasicIV();
  this.closeArchiveReader();
  this.closeArchiveWriter();
  DataEngineContext deContext3=newContext(DataEngineContext.MODE_UPDATE,fileName,fileName);
  myPreDataEngine=DataEngine.newDataEngine(deContext3);
  this.PRE_add_filter=0;
  this.PRE_add_sort=true;
  this.PRE_execute_query=true;
  this.preBasicIV();
  this.checkOutputFile();
}
Program: 69896
Project: 69896
Buggy source:
/** 
 * When the action is invoked, pop up a File Dialog to designate the directory.
 */
public void run(){
  Chart cm=ChartExamples.getChartModel();
  if (cm != null) {
    final FileDialog saveDialog=new FileDialog(cmp.getShell(),SWT.SAVE);
    saveDialog.setFilterExtensions(new String[]{"String_Node_Str"});
    try {
      saveDialog.open();
      String name=saveDialog.getFileName();
      if (name != null && name != "String_Node_Str") {
        Serializer serializer=null;
        final File file=new File(saveDialog.getFilterPath(),name);
        if (file.exists()) {
          MessageBox box=new MessageBox(cmp.getShell(),SWT.ICON_WARNING | SWT.YES | SWT.NO);
          box.setText(Messages.getDescription("String_Node_Str"));
          box.setMessage(Messages.getDescription("String_Node_Str"));
          if (box.open() != SWT.YES) {
            return;
          }
        }
        serializer=SerializerImpl.instance();
        try {
          serializer.write(cm,new FileOutputStream(file));
        }
 catch (        IOException ioe) {
          ioe.printStackTrace();
        }
      }
    }
 catch (    Throwable e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * When the action is invoked, pop up a File Dialog to designate the directory.
 */
public void run(){
  Chart cm=ChartExamples.getChartModel().copyInstance();
  if (cm != null) {
    final FileDialog saveDialog=new FileDialog(cmp.getShell(),SWT.SAVE);
    saveDialog.setFilterExtensions(new String[]{"String_Node_Str"});
    try {
      saveDialog.open();
      String name=saveDialog.getFileName();
      if (name != null && name != "String_Node_Str") {
        Serializer serializer=null;
        final File file=new File(saveDialog.getFilterPath(),name);
        if (file.exists()) {
          MessageBox box=new MessageBox(cmp.getShell(),SWT.ICON_WARNING | SWT.YES | SWT.NO);
          box.setText(Messages.getDescription("String_Node_Str"));
          box.setMessage(Messages.getDescription("String_Node_Str"));
          if (box.open() != SWT.YES) {
            return;
          }
        }
        serializer=SerializerImpl.instance();
        try {
          serializer.write(cm,new FileOutputStream(file));
        }
 catch (        IOException ioe) {
          ioe.printStackTrace();
        }
      }
    }
 catch (    Throwable e) {
      e.printStackTrace();
    }
  }
}
Program: 69897
Project: 69897
Buggy source:
protected void readRowField(DataInputStream in,RowDesign row,short fieldType) throws IOException {
switch (fieldType) {
case FIELD_IS_START_OF_GROUP:
    boolean isStartOfGroup=IOUtil.readBool(in);
  row.setStartOfGroup(isStartOfGroup);
break;
default :
readReportItemField(in,row,fieldType);
}
}

Fixed version (ground truth):
protected void readRowField(DataInputStream in,RowDesign row,short fieldType) throws IOException {
switch (fieldType) {
case FIELD_IS_START_OF_GROUP:
    boolean isStartOfGroup=IOUtil.readBool(in);
  row.setStartOfGroup(isStartOfGroup);
break;
case FIELD_IS_REPEATABLE:
boolean isRepeatable=IOUtil.readBool(in);
row.setRepeatable(isRepeatable);
break;
default :
readReportItemField(in,row,fieldType);
}
}
Program: 69898
Project: 69898
Buggy source:
protected void writeRow(DataOutputStream out,RowDesign row) throws IOException {
  writeReportItem(out,row);
  boolean isStartOfGroup=row.isStartOfGroup();
  if (isStartOfGroup) {
    IOUtil.writeShort(out,FIELD_IS_START_OF_GROUP);
    IOUtil.writeBool(out,isStartOfGroup);
  }
}

Fixed version (ground truth):
protected void writeRow(DataOutputStream out,RowDesign row) throws IOException {
  writeReportItem(out,row);
  boolean isStartOfGroup=row.isStartOfGroup();
  if (isStartOfGroup) {
    IOUtil.writeShort(out,FIELD_IS_START_OF_GROUP);
    IOUtil.writeBool(out,isStartOfGroup);
  }
  boolean repeatable=row.getRepeatable();
  if (!repeatable) {
    IOUtil.writeShort(out,FIELD_IS_REPEATABLE);
    IOUtil.writeBool(out,repeatable);
  }
}
Program: 69901
Project: 69901
Buggy source:
/** 
 * true if succeed to new a line.
 */
public void newLine() throws BirtException {
  parentLM.endLine(true);
}

Fixed version (ground truth):
/** 
 * true if succeed to new a line.
 */
public void newLine(boolean endParagraph) throws BirtException {
  parentLM.endLine(endParagraph);
}
Program: 69902
Project: 69902
Buggy source:
protected void layoutChildren() throws BirtException {
  if (null == textContent)   return;
  while (comp.hasNextArea()) {
    TextArea area=comp.getNextArea(getFreeSpace());
    if (area != null) {
      addTextArea(area);
      comp.setNewLineStatus(false);
      if (area.isLineBreak()) {
        newLine();
        comp.setNewLineStatus(true);
      }
    }
  }
}

Fixed version (ground truth):
protected void layoutChildren() throws BirtException {
  if (null == textContent)   return;
  while (comp.hasNextArea()) {
    TextArea area=comp.getNextArea(getFreeSpace());
    if (area != null) {
      addTextArea(area);
      comp.setNewLineStatus(false);
      if (area.isLineBreak()) {
        newLine(area.blankLine);
        comp.setNewLineStatus(true);
      }
    }
  }
}
Program: 69903
Project: 69903
Buggy source:
/** 
 * Visits the children nodes of the specific node
 * @param visitor the ITextNodeVisitor instance
 * @param ele the specific node
 */
private void processNodes(Element ele,HashMap cssStyles){
  for (Node node=ele.getFirstChild(); node != null; node=node.getNextSibling()) {
    short nodeType=node.getNodeType();
    if (nodeType == Node.TEXT_NODE) {
      if (isScriptText(node)) {
        writer.cdata(node.getNodeValue());
      }
 else {
        writer.text(node.getNodeValue());
      }
    }
 else     if (nodeType == Node.COMMENT_NODE) {
      writer.comment(node.getNodeValue());
    }
 else     if (nodeType == Node.ELEMENT_NODE) {
      if ("String_Node_Str".equalsIgnoreCase(node.getNodeName())) {
        boolean bImplicitCloseTag=writer.isImplicitCloseTag();
        writer.setImplicitCloseTag(true);
        startNode(node,cssStyles);
        processNodes((Element)node,cssStyles);
        endNode(node);
        writer.setImplicitCloseTag(bImplicitCloseTag);
      }
 else {
        startNode(node,cssStyles);
        processNodes((Element)node,cssStyles);
        endNode(node);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Visits the children nodes of the specific node
 * @param visitor the ITextNodeVisitor instance
 * @param ele the specific node
 */
private void processNodes(Element ele,HashMap cssStyles){
  for (Node node=ele.getFirstChild(); node != null; node=node.getNextSibling()) {
    short nodeType=node.getNodeType();
    if (nodeType == Node.TEXT_NODE) {
      if (isScriptText(node)) {
        writer.cdata(node.getNodeValue());
      }
 else {
        writer.text(node.getNodeValue(),false);
      }
    }
 else     if (nodeType == Node.COMMENT_NODE) {
      writer.comment(node.getNodeValue());
    }
 else     if (nodeType == Node.ELEMENT_NODE) {
      if ("String_Node_Str".equalsIgnoreCase(node.getNodeName())) {
        boolean bImplicitCloseTag=writer.isImplicitCloseTag();
        writer.setImplicitCloseTag(true);
        startNode(node,cssStyles);
        processNodes((Element)node,cssStyles);
        endNode(node);
        writer.setImplicitCloseTag(bImplicitCloseTag);
      }
 else {
        startNode(node,cssStyles);
        processNodes((Element)node,cssStyles);
        endNode(node);
      }
    }
  }
}
Program: 69904
Project: 69904
Buggy source:
public void layout() throws BirtException {
  initialize();
  if (content instanceof ITextContent && lineParent.getChildrenCount() == 1) {
    lineParent.setTextIndent((ITextContent)content);
  }
  TextAreaLayout inlineText=new TextAreaLayout(this,context,content);
  inlineText.initialize();
  inlineText.layout();
  inlineText.close();
  close();
}

Fixed version (ground truth):
public void layout() throws BirtException {
  initialize();
  TextAreaLayout inlineText=new TextAreaLayout(this,context,content);
  inlineText.initialize();
  inlineText.layout();
  inlineText.close();
  close();
}
Program: 69905
Project: 69905
Buggy source:
public void endLine(boolean endParagraph) throws BirtException {
  close(false,endParagraph);
  currentIP=0;
}

Fixed version (ground truth):
public void endLine(boolean endParagraph) throws BirtException {
  close(false,endParagraph);
  currentIP=0;
  if (endParagraph) {
    setIndent=false;
  }
}
Program: 69906
Project: 69906
Buggy source:
public void setTextIndent(ITextContent content){
  if (content != null) {
    IStyle contentStyle=content.getComputedStyle();
    currentIP=getDimensionValue(contentStyle.getProperty(StyleConstants.STYLE_TEXT_INDENT),maxAvaWidth);
  }
}

Fixed version (ground truth):
public void setTextIndent(ITextContent content){
  if (!setIndent && content != null) {
    IStyle contentStyle=content.getComputedStyle();
    currentIP=getDimensionValue(contentStyle.getProperty(StyleConstants.STYLE_TEXT_INDENT),maxAvaWidth);
    setIndent=true;
  }
}