nus-yam/ex-repair huggingface dataset:
Program: 69242
Project: 69242
Buggy source:
/** 
 * Compare two object array value.
 * @param arrayOne
 * @param arrayTwo
 * @return
 */
protected boolean equalArray(Object[] arrayOne,Object[] arrayTwo){
  if ((arrayOne == null && arrayTwo != null) || (arrayOne != null && arrayTwo == null))   return false;
  if (arrayOne == null && arrayTwo == null)   return true;
  if (arrayOne.length != arrayTwo.length)   return false;
  for (int i=0; i < arrayOne.length; ++i) {
    Object one=arrayOne[i];
    Object two=arrayTwo[i];
    if ((one != null && !one.equals(two)) || (two != null && !two.equals(one)))     return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Compare two object array value.
 * @param arrayOne
 * @param arrayTwo
 * @return
 */
protected boolean equalArray(Object[] arrayOne,Object[] arrayTwo){
  if (arrayOne == null && arrayTwo == null)   return true;
  if ((arrayOne == null && arrayTwo != null) || (arrayOne != null && arrayTwo == null))   return false;
  if (arrayOne.length != arrayTwo.length)   return false;
  for (int i=0; i < arrayOne.length; ++i) {
    Object one=arrayOne[i];
    Object two=arrayTwo[i];
    if ((one != null && !one.equals(two)) || (two != null && !two.equals(one)))     return false;
  }
  return true;
}
Program: 69243
Project: 69243
Buggy source:
public ModuleOption getOptions(){
  if (options != null)   return this.options;
  Module hostModule=this.host;
  while (hostModule != null) {
    ModuleOption hostOptions=hostModule.getOptions();
    if (hostOptions != null)     return hostOptions;
    if (hostModule instanceof Library)     hostModule=((Library)hostModule).host;
    return null;
  }
  return null;
}

Fixed version (ground truth):
public ModuleOption getOptions(){
  if (options != null)   return options;
  Module hostModule=host;
  while (hostModule != null) {
    ModuleOption hostOptions=hostModule.getOptions();
    if (hostOptions != null)     return hostOptions;
    if (hostModule instanceof Library)     hostModule=((Library)hostModule).host;
    break;
  }
  return null;
}
Program: 69244
Project: 69244
Buggy source:
protected DesignElement getStyleContainer(DesignElement designElement){
}

Fixed version (ground truth):
protected DesignElement getStyleContainer(DesignElement designElement){
  DesignElement tmpContainer=designElement.getContainer();
  if (tmpContainer == null || !(tmpContainer instanceof MultiViews))   return tmpContainer;
  tmpContainer=tmpContainer.getContainer();
  if (tmpContainer == null)   return null;
  return tmpContainer.getContainer();
}
Program: 69245
Project: 69245
Buggy source:
public Object validateValue(Module module,PropertyDefn defn,Object value) throws PropertyValueException {
  if (value == null)   return null;
  int trimOption=defn.getTrimOption();
  if (value instanceof Expression) {
    String expr=((Expression)value).getStringExpression();
    String tmpType=((Expression)value).getUserDefinedType();
    String trimExpr=trimString(expr,trimOption);
    if (trimExpr == null) {
      if (tmpType == null)       return null;
      return new Expression(trimExpr,tmpType);
    }
    return value;
  }
  if (value instanceof String) {
    String expr=trimString((String)value,trimOption);
    if (expr == null)     return null;
    return new Expression(expr,null);
  }
  throw new PropertyValueException(value,PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE,EXPRESSION_TYPE);
}

Fixed version (ground truth):
public Object validateValue(Module module,PropertyDefn defn,Object value) throws PropertyValueException {
  if (value == null)   return null;
  int trimOption=defn.getTrimOption();
  if (value instanceof Expression) {
    String expr=((Expression)value).getStringExpression();
    String tmpType=((Expression)value).getUserDefinedType();
    String trimExpr=trimString(expr,trimOption);
    if (trimExpr == null) {
      if (tmpType == null)       return null;
      return new Expression(null,tmpType);
    }
    return value;
  }
  if (value instanceof String) {
    String expr=trimString((String)value,trimOption);
    if (expr == null)     return null;
    return new Expression(expr,null);
  }
  throw new PropertyValueException(value,PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE,EXPRESSION_TYPE);
}
Program: 69246
Project: 69246
Buggy source:
protected void repeatHeader() throws BirtException {
  if (!isFirstLayout) {
    ITableContent table=(ITableContent)content;
    if (table.isHeaderRepeat()) {
      IBandContent header=table.getHeader();
      if (header != null) {
        refineBandContent((ITableBandContent)header);
        boolean pageBreak=context.allowPageBreak();
        context.setAllowPageBreak(false);
        IPageBuffer buffer=context.getPageBufferManager();
        boolean isRepeated=buffer.isRepeated();
        buffer.setRepeated(true);
        engine.layout(this,header,emitter);
        buffer.setRepeated(isRepeated);
        context.setAllowPageBreak(pageBreak);
      }
    }
  }
  isFirstLayout=false;
}

Fixed version (ground truth):
protected void repeatHeader() throws BirtException {
  if (!isFirstLayout) {
    ITableContent table=(ITableContent)content;
    if (table.isHeaderRepeat()) {
      IBandContent header=table.getHeader();
      if (header != null) {
        refineBandContent((ITableBandContent)header);
        cleanRepeatedLayoutExtension(header);
        boolean pageBreak=context.allowPageBreak();
        context.setAllowPageBreak(false);
        IPageBuffer buffer=context.getPageBufferManager();
        boolean isRepeated=buffer.isRepeated();
        buffer.setRepeated(true);
        engine.layout(this,header,emitter);
        buffer.setRepeated(isRepeated);
        context.setAllowPageBreak(pageBreak);
      }
    }
  }
  isFirstLayout=false;
}
Program: 69248
Project: 69248
Buggy source:
public BlockTextArea cloneArea(){
  BlockTextArea newArea=new BlockTextArea(this);
  addToExtension(newArea);
  return newArea;
}

Fixed version (ground truth):
public BlockTextArea cloneArea(){
  BlockTextArea newArea=new BlockTextArea(this);
  return newArea;
}
Program: 69249
Project: 69249
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);
        list.size();
      }
 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) {
      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: 69250
Project: 69250
Buggy source:
public SplitResult split(int height,boolean force) throws BirtException {
  if (force) {
    InlineTextArea newArea=cloneArea();
    newArea.children.addAll(children);
    children.clear();
    this.height=0;
    replaceLine(this,newArea);
    addLineBreakToExtension(newArea);
    return new SplitResult(newArea,SplitResult.SPLIT_SUCCEED_WITH_PART);
  }
 else {
    addLineBreakToExtension();
    return SplitResult.SUCCEED_WITH_NULL;
  }
}

Fixed version (ground truth):
public SplitResult split(int height,boolean force) throws BirtException {
  if (force) {
    InlineTextArea newArea=(InlineTextArea)cloneArea();
    addLineToExtension(newArea);
    newArea.children.addAll(children);
    children.clear();
    this.height=0;
    replaceLine(this,newArea);
    addLineBreakToExtension(newArea);
    return new SplitResult(newArea,SplitResult.SPLIT_SUCCEED_WITH_PART);
  }
 else {
    addLineBreakToExtension();
    return SplitResult.SUCCEED_WITH_NULL;
  }
}
Program: 69251
Project: 69251
Buggy source:
public InlineTextArea cloneArea(){
  InlineTextArea newArea=new InlineTextArea(this);
  addLineToExtension(newArea);
  return newArea;
}

Fixed version (ground truth):
public InlineTextArea cloneArea(){
  InlineTextArea newArea=new InlineTextArea(this);
  return newArea;
}
Program: 69254
Project: 69254
Buggy source:
/** 
 * Set report basic settings.
 * @param model
 * @throws IOException
 */
void setReportSettings(Object model) throws IOException {
  ReportDesignHandle handle=(ReportDesignHandle)model;
  try {
    handle.setDisplayName(settingPage.getDisplayName());
    handle.setDescription(settingPage.getDescription());
    handle.setIconFile(settingPage.getPreviewImagePath());
  }
 catch (  SemanticException e) {
  }
}

Fixed version (ground truth):
/** 
 * Set report basic settings.
 * @param model
 * @throws IOException
 */
void setReportSettings(Object model) throws IOException {
  ReportDesignHandle handle=(ReportDesignHandle)model;
  try {
    handle.setDisplayName(settingPage.getDisplayName());
    handle.setDescription(settingPage.getDescription());
    handle.setIconFile(settingPage.getPreviewImagePath());
    UIUtil.addCreateBy(handle);
  }
 catch (  SemanticException e) {
  }
}
Program: 69255
Project: 69255
Buggy source:
/** 
 * Set report basic settings.
 * @param model
 * @throws IOException
 */
void setReportSettings(Object model) throws IOException {
  ReportDesignHandle handle=(ReportDesignHandle)model;
  try {
    handle.setDisplayName(settingPage.getDisplayName());
    handle.setDescription(settingPage.getDescription());
    handle.setIconFile(settingPage.getPreviewImagePath());
  }
 catch (  SemanticException e) {
  }
}

Fixed version (ground truth):
/** 
 * Set report basic settings.
 * @param model
 * @throws IOException
 */
void setReportSettings(Object model) throws IOException {
  ReportDesignHandle handle=(ReportDesignHandle)model;
  try {
    handle.setDisplayName(settingPage.getDisplayName());
    handle.setDescription(settingPage.getDescription());
    handle.setIconFile(settingPage.getPreviewImagePath());
    UIUtil.addCreateBy(handle);
  }
 catch (  SemanticException e) {
  }
}
Program: 69258
Project: 69258
Buggy source:
/** 
 * @param handle
 * @return
 */
public int getBackgroundImageHeight(DesignElementHandle handle,Dimension size,Image image){
  DimensionHandle obj=handle.getDimensionProperty(StyleHandle.BACKGROUND_SIZE_HEIGHT);
  if (obj == null || obj.getUnits() == null || obj.getUnits().length() == 0) {
    if (image == null) {
      return 0;
    }
    String str=handle.getStringProperty(StyleHandle.BACKGROUND_SIZE_WIDTH);
    if (DesignChoiceConstants.BACKGROUND_SIZE_CONTAIN.equals(str)) {
      Dimension imageSize=new Dimension(image);
      if (((double)imageSize.width / ((double)imageSize.height)) > ((double)size.width / ((double)size.height))) {
        double value=((double)imageSize.height * ((double)size.width) / ((double)imageSize.width));
        return (int)value;
      }
 else {
        return size.height;
      }
    }
 else     if (DesignChoiceConstants.BACKGROUND_SIZE_COVER.equals(str)) {
      return size.height;
    }
    return 0;
  }
  int fontSize=DEUtil.getFontSizeIntValue(getHandle());
  double py=0;
  py=DEUtil.convertToPixel(obj,fontSize);
  return (int)py;
}

Fixed version (ground truth):
/** 
 * @param handle
 * @return
 */
public int getBackgroundImageHeight(DesignElementHandle handle,Dimension size,Image image){
  DimensionHandle obj=handle.getDimensionProperty(StyleHandle.BACKGROUND_SIZE_HEIGHT);
  if (obj == null || obj.getUnits() == null || obj.getUnits().length() == 0) {
    if (image == null) {
      return 0;
    }
    String str=handle.getStringProperty(StyleHandle.BACKGROUND_SIZE_WIDTH);
    if (DesignChoiceConstants.BACKGROUND_SIZE_CONTAIN.equals(str)) {
      Dimension imageSize=new Dimension(image);
      if (((double)imageSize.width / ((double)imageSize.height)) > ((double)size.width / ((double)size.height))) {
        double value=((double)imageSize.height * ((double)size.width) / ((double)imageSize.width));
        return (int)value;
      }
 else {
        return size.height;
      }
    }
 else     if (DesignChoiceConstants.BACKGROUND_SIZE_COVER.equals(str)) {
      Dimension imageSize=new Dimension(image);
      if (((double)imageSize.width / ((double)imageSize.height)) > ((double)size.width / ((double)size.height))) {
        return size.height;
      }
 else {
        double value=((double)imageSize.height * ((double)size.width) / ((double)imageSize.width));
        return (int)value;
      }
    }
    return 0;
  }
  int fontSize=DEUtil.getFontSizeIntValue(getHandle());
  double py=0;
  py=DEUtil.convertToPixel(obj,fontSize);
  return (int)py;
}
Program: 69259
Project: 69259
Buggy source:
/** 
 * @param handle
 * @return
 */
public int getBackgroundImageWidth(DesignElementHandle handle,Dimension size,Image image){
  DimensionHandle obj=handle.getDimensionProperty(StyleHandle.BACKGROUND_SIZE_WIDTH);
  if (obj == null || obj.getUnits() == null || obj.getUnits().length() == 0) {
    if (image == null) {
      return 0;
    }
    String str=handle.getStringProperty(StyleHandle.BACKGROUND_SIZE_WIDTH);
    if (DesignChoiceConstants.BACKGROUND_SIZE_CONTAIN.equals(str)) {
      Dimension imageSize=new Dimension(image);
      if (((double)imageSize.width / ((double)imageSize.height)) > ((double)size.width / ((double)size.height))) {
        return size.width;
      }
 else {
        double value=((double)imageSize.width * ((double)size.height) / ((double)imageSize.height));
        return (int)value;
      }
    }
 else     if (DesignChoiceConstants.BACKGROUND_SIZE_COVER.equals(str)) {
      return size.width;
    }
    return 0;
  }
  int fontSize=DEUtil.getFontSizeIntValue(getHandle());
  double px=0;
  px=DEUtil.convertToPixel(obj,fontSize);
  return (int)px;
}

Fixed version (ground truth):
/** 
 * @param handle
 * @return
 */
public int getBackgroundImageWidth(DesignElementHandle handle,Dimension size,Image image){
  DimensionHandle obj=handle.getDimensionProperty(StyleHandle.BACKGROUND_SIZE_WIDTH);
  if (obj == null || obj.getUnits() == null || obj.getUnits().length() == 0) {
    if (image == null) {
      return 0;
    }
    String str=handle.getStringProperty(StyleHandle.BACKGROUND_SIZE_WIDTH);
    if (DesignChoiceConstants.BACKGROUND_SIZE_CONTAIN.equals(str)) {
      Dimension imageSize=new Dimension(image);
      if (((double)imageSize.width / ((double)imageSize.height)) > ((double)size.width / ((double)size.height))) {
        return size.width;
      }
 else {
        double value=((double)imageSize.width * ((double)size.height) / ((double)imageSize.height));
        return (int)value;
      }
    }
 else     if (DesignChoiceConstants.BACKGROUND_SIZE_COVER.equals(str)) {
      Dimension imageSize=new Dimension(image);
      if (((double)imageSize.width / ((double)imageSize.height)) > ((double)size.width / ((double)size.height))) {
        double value=((double)imageSize.width * ((double)size.height) / ((double)imageSize.height));
        return (int)value;
      }
 else {
        return size.width;
      }
    }
    return 0;
  }
  int fontSize=DEUtil.getFontSizeIntValue(getHandle());
  double px=0;
  px=DEUtil.convertToPixel(obj,fontSize);
  return (int)px;
}
Program: 69260
Project: 69260
Buggy source:
/** 
 * @param dataSet
 * @param queryDefn
 * @param useColumnHints
 * @return
 * @throws BirtException
 */
public IQueryResults execute(DataSetHandle dataSet,IQueryDefinition queryDefn,boolean useColumnHints,boolean useFilters,boolean clearCache,DataRequestSession session) throws BirtException {
  IBaseDataSetDesign dataSetDesign=session.getModelAdaptor().adaptDataSet(dataSet);
  if (clearCache) {
    IBaseDataSourceDesign dataSourceDesign=session.getModelAdaptor().adaptDataSource(dataSet.getDataSource());
    session.clearCache(dataSourceDesign,dataSetDesign);
  }
  if (!useColumnHints) {
    dataSetDesign.getResultSetHints().clear();
  }
  if (!useFilters) {
    dataSetDesign.getFilters().clear();
  }
  IQueryResults resultSet=executeQuery(session,queryDefn);
  saveResultToDataItems(dataSet,resultSet);
  return resultSet;
}

Fixed version (ground truth):
/** 
 * @param dataSet
 * @param queryDefn
 * @param useColumnHints
 * @return
 * @throws BirtException
 */
public IQueryResults execute(DataSetHandle dataSet,IQueryDefinition queryDefn,boolean useColumnHints,boolean useFilters,boolean clearCache,ExecutionContext context,DataRequestSession session) throws BirtException {
  IBaseDataSetDesign dataSetDesign=session.getModelAdaptor().adaptDataSet(dataSet);
  if (!(dataSet instanceof JointDataSetHandle) && context != null) {
    context.setReportContext(new ReportContextImpl(context));
    dataSetDesign=new ModelDteApiAdapter(context).appendRuntimeInfoToDataSet(dataSet,(BaseDataSetDesign)dataSetDesign);
  }
  if (clearCache) {
    IBaseDataSourceDesign dataSourceDesign=session.getModelAdaptor().adaptDataSource(dataSet.getDataSource());
    session.clearCache(dataSourceDesign,dataSetDesign);
  }
  if (!useColumnHints) {
    dataSetDesign.getResultSetHints().clear();
  }
  if (!useFilters) {
    dataSetDesign.getFilters().clear();
  }
  if (!(dataSet instanceof JointDataSetHandle) && context != null) {
    if (dataSet.getDataSource() != null) {
      session.defineDataSource(session.getModelAdaptor().adaptDataSource(dataSet.getDataSource()));
    }
    session.defineDataSet(dataSetDesign);
  }
  IQueryResults resultSet=executeQuery(session,queryDefn);
  saveResultToDataItems(dataSet,resultSet);
  return resultSet;
}
Program: 69261
Project: 69261
Buggy source:
/** 
 * @param session
 * @param queryDefn
 * @return
 * @throws BirtException
 */
private IQueryResults executeQuery(DataRequestSession session,IQueryDefinition queryDefn) throws BirtException {
  IQueryResults resultSet=session.executeQuery(queryDefn,null,null,null);
  return resultSet;
}

Fixed version (ground truth):
/** 
 * @param session
 * @param queryDefn
 * @return
 * @throws BirtException
 */
private IQueryResults executeQuery(DataRequestSession session,IQueryDefinition queryDefn) throws BirtException {
  IPreparedQuery preparedQuery=session.prepare(queryDefn);
  IQueryResults resultSet=(IQueryResults)session.execute(preparedQuery,null,new ScriptContext());
  return resultSet;
}
Program: 69263
Project: 69263
Buggy source:
public void testToUpper(){
  String script1="String_Node_Str" + str + "String_Node_Str";
  String script2="String_Node_Str" + null + "String_Node_Str";
  assertEquals(((String)cx.evaluateString(scope,script1,"String_Node_Str",1,null)),"String_Node_Str");
  assertEquals(((String)cx.evaluateString(scope,script2,"String_Node_Str",1,null)),null);
}

Fixed version (ground truth):
public void testToUpper(){
  String script1="String_Node_Str" + str + "String_Node_Str";
  String script2="String_Node_Str" + null + "String_Node_Str";
  String script3="String_Node_Str";
  String script4="String_Node_Str";
  String script5="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  assertEquals(((String)cx.evaluateString(scope,script1,"String_Node_Str",1,null)),"String_Node_Str");
  assertEquals(((String)cx.evaluateString(scope,script2,"String_Node_Str",1,null)),null);
  Object result1=cx.evaluateString(scope,script3,"String_Node_Str",1,null);
  if (!(result1 instanceof Object[]))   fail("String_Node_Str");
  assertTrue(eqaulArray((Object[])result1,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  try {
    cx.evaluateString(scope,script4,"String_Node_Str",1,null);
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertTrue(e instanceof IllegalArgumentException);
  }
  try {
    cx.evaluateString(scope,script5,"String_Node_Str",1,null);
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertTrue(e instanceof IllegalArgumentException);
  }
}
Program: 69264
Project: 69264
Buggy source:
public void testToLower(){
  String script1="String_Node_Str" + str + "String_Node_Str";
  String script2="String_Node_Str" + null + "String_Node_Str";
  assertEquals(((String)cx.evaluateString(scope,script1,"String_Node_Str",1,null)),"String_Node_Str");
  assertEquals(((String)cx.evaluateString(scope,script2,"String_Node_Str",1,null)),null);
}

Fixed version (ground truth):
public void testToLower(){
  String script1="String_Node_Str" + str + "String_Node_Str";
  String script2="String_Node_Str" + null + "String_Node_Str";
  String script3="String_Node_Str";
  String script4="String_Node_Str";
  String script5="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  assertEquals(((String)cx.evaluateString(scope,script1,"String_Node_Str",1,null)),"String_Node_Str");
  assertEquals(((String)cx.evaluateString(scope,script2,"String_Node_Str",1,null)),null);
  Object result1=cx.evaluateString(scope,script3,"String_Node_Str",1,null);
  if (!(result1 instanceof Object[]))   fail("String_Node_Str");
  assertTrue(eqaulArray((Object[])result1,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  try {
    cx.evaluateString(scope,script4,"String_Node_Str",1,null);
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertTrue(e instanceof IllegalArgumentException);
  }
  try {
    cx.evaluateString(scope,script5,"String_Node_Str",1,null);
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertTrue(e instanceof IllegalArgumentException);
  }
}
Program: 69265
Project: 69265
Buggy source:
/** 
 * Retrieves all distinct values of a data set column based on searchInfo and return in a Collection.
 * @param dataSet Handle of data set to query
 * @param inputParamBindings An iterator of ParamBindingHandle objects that defines bindings for the data set's input parameters
 * @param columnBindings An iterator of ComputedColumnHandle objects that define all column binding expressions
 * @param boundColumnName Name of the bound column to retrieve values for
 * @param requestInfo Information on result set retrieving(like start index,return row number...)
 * @return
 * @throws BirtException
 */
public abstract Collection getColumnValueSet(DataSetHandle dataSet,Iterator inputParamBindings,Iterator columnBindings,String boundColumnName,IRequestInfo requestInfo) throws BirtException ;

Fixed version (ground truth):
/** 
 * Retrieves all distinct values of a data set column based on searchInfo and return in a Collection.
 * @param dataSet Handle of data set to query
 * @param inputParamBindings An iterator of ParamBindingHandle objects that defines bindings for the data set's input parameters
 * @param columnBindings An iterator of ComputedColumnHandle objects that define all column binding expressions
 * @param groupDefns An iterator of GroupHandle objects that define all group using in this report item
 * @param boundColumnName Name of the bound column to retrieve values for
 * @param requestInfo Information on result set retrieving(like start index,return row number...)
 * @return
 * @throws BirtException
 */
public abstract Collection getColumnValueSet(DataSetHandle dataSet,Iterator inputParamBindings,Iterator columnBindings,Iterator groupDefns,String boundColumnName,IRequestInfo requestInfo) throws BirtException ;
Program: 69266
Project: 69266
Buggy source:
public Collection getColumnValueSet(DataSetHandle dataSet,Iterator inputParamBindings,Iterator columnBindings,String boundColumnName,IRequestInfo requestInfo) throws BirtException {
  IColumnValueIterator columnValueIterator=getColumnValueIterator(dataSet,inputParamBindings,columnBindings,boundColumnName,requestInfo);
  ArrayList values=new ArrayList();
  do {
    if (columnValueIterator.getValue() != null)     values.add(columnValueIterator.getValue());
  }
 while (columnValueIterator.next());
  columnValueIterator.close();
  return values;
}

Fixed version (ground truth):
public Collection getColumnValueSet(DataSetHandle dataSet,Iterator inputParamBindings,Iterator columnBindings,Iterator groupDefns,String boundColumnName,IRequestInfo requestInfo) throws BirtException {
  IColumnValueIterator columnValueIterator=getColumnValueIterator(dataSet,inputParamBindings,columnBindings,groupDefns,boundColumnName,requestInfo);
  ArrayList values=new ArrayList();
  do {
    if (columnValueIterator.getValue() != null)     values.add(columnValueIterator.getValue());
  }
 while (columnValueIterator.next());
  columnValueIterator.close();
  return values;
}
Program: 69267
Project: 69267
Buggy source:
/** 
 * @param dataSet
 * @param inputParamBindings
 * @param columnBindings
 * @param boundColumnName
 * @param requestInfo
 * @return
 * @throws BirtException
 */
private IColumnValueIterator getColumnValueIterator(DataSetHandle dataSet,Iterator inputParamBindings,Iterator columnBindings,String boundColumnName,IRequestInfo requestInfo) throws BirtException {
  ArrayList temp=new ArrayList();
  while (columnBindings != null && columnBindings.hasNext()) {
    Object nextBinding=columnBindings.next();
    IBinding binding=this.modelAdaptor.adaptBinding((ComputedColumnHandle)nextBinding);
    if (binding.getAggrFunction() == null || binding.getAggregatOns() == null || binding.getAggregatOns().size() == 0)     temp.add(nextBinding);
  }
  IQueryResults queryResults=getQueryResults(dataSet,inputParamBindings,temp.iterator(),boundColumnName);
  return new ColumnValueIterator(queryResults,boundColumnName,requestInfo);
}

Fixed version (ground truth):
/** 
 * @param dataSet
 * @param inputParamBindings
 * @param columnBindings
 * @param groupDefn
 * @param boundColumnName
 * @param requestInfo
 * @return
 * @throws BirtException
 */
private IColumnValueIterator getColumnValueIterator(DataSetHandle dataSet,Iterator inputParamBindings,Iterator columnBindings,Iterator groupDefn,String boundColumnName,IRequestInfo requestInfo) throws BirtException {
  IQueryResults queryResults=getQueryResults(dataSet,inputParamBindings,columnBindings,groupDefn,boundColumnName);
  return new ColumnValueIterator(queryResults,boundColumnName,requestInfo);
}
Program: 69268
Project: 69268
Buggy source:
/** 
 * get the distinct value of query
 * @param dataSet
 * @param inputParamBindings
 * @param columnBindings
 * @param boundColumnName
 * @return
 * @throws BirtException
 */
private IQueryResults getQueryResults(DataSetHandle dataSet,Iterator inputParamBindings,Iterator columnBindings,String boundColumnName) throws BirtException {
}

Fixed version (ground truth):
/** 
 * get the distinct value of query
 * @param dataSet
 * @param inputParamBindings
 * @param columnBindings
 * @param boundColumnName
 * @return
 * @throws BirtException
 */
private IQueryResults getQueryResults(DataSetHandle dataSet,Iterator inputParamBindings,Iterator columnBindings,Iterator groupDefns,String boundColumnName) throws BirtException {
}
Program: 69269
Project: 69269
Buggy source:
/** 
 * Depending on the Computed the properties of various controls on this page are set
 */
private void setPageProperties(){
  boolean computedColumnsExist=false;
  computedColumnsExist=(computedColumns != null && computedColumns.getListValue() != null && computedColumns.getListValue().size() > 0);
  viewer.getEditButton().setEnabled(computedColumnsExist);
  viewer.getDownButton().setEnabled(computedColumnsExist && computedColumns.getListValue().size() > 1);
  viewer.getUpButton().setEnabled(computedColumnsExist && computedColumns.getListValue().size() > 1);
  viewer.getRemoveButton().setEnabled(computedColumnsExist);
  viewer.getRemoveMenuItem().setEnabled(computedColumnsExist);
  viewer.getRemoveAllMenuItem().setEnabled(computedColumnsExist);
  validateAllComputedColumns();
}

Fixed version (ground truth):
/** 
 * Depending on the Computed the properties of various controls on this page are set
 */
private void setPageProperties(){
  viewer.updateButtons();
  validateAllComputedColumns();
}
Program: 69270
Project: 69270
Buggy source:
/** 
 * Creates a DataSetParameter instance according to the given arguments
 * @param parameter
 * @param dataSetName
 * @param position
 * @return
 */
private DataSetParameter createDataSetParameter(DataSetParameterHandle parameter,String dataSetName,int position){
  DataSetParameter dataSetParameter=null;
  if (parameter instanceof OdaDataSetParameterHandle) {
    dataSetParameter=new OdaDataSetParameter();
    ((OdaDataSetParameter)dataSetParameter).setParamName(((OdaDataSetParameterHandle)parameter).getParamName());
  }
 else {
    dataSetParameter=new DataSetParameter();
  }
  dataSetParameter.setDataType(parameter.getDataType());
  dataSetParameter.setAllowNull(parameter.allowNull());
  dataSetParameter.setDefaultValue(parameter.getDefaultValue());
  dataSetParameter.setIsInput(parameter.isInput());
  dataSetParameter.setIsOutput(parameter.isOutput());
  dataSetParameter.setName(dataSetName + separator + parameter.getName());
  dataSetParameter.setIsOptional(parameter.isOptional());
  dataSetParameter.setPosition(position);
  return dataSetParameter;
}

Fixed version (ground truth):
/** 
 * Creates a DataSetParameter instance according to the given arguments
 * @param parameter
 * @param dataSetName
 * @param position
 * @return
 */
private DataSetParameter createDataSetParameter(DataSetParameterHandle parameter,String dataSetName,int position){
  DataSetParameter dataSetParameter=null;
  if (parameter instanceof OdaDataSetParameterHandle) {
    dataSetParameter=new OdaDataSetParameter();
    ((OdaDataSetParameter)dataSetParameter).setParamName(((OdaDataSetParameterHandle)parameter).getParamName());
  }
 else {
    dataSetParameter=new DataSetParameter();
  }
  dataSetParameter.setDataType(parameter.getDataType());
  dataSetParameter.setAllowNull(parameter.allowNull());
  dataSetParameter.setDefaultValue(parameter.getDefaultValue());
  dataSetParameter.setExpressionProperty(DataSetParameter.DEFAULT_VALUE_MEMBER,(Expression)parameter.getExpressionProperty(DataSetParameter.DEFAULT_VALUE_MEMBER).getValue());
  dataSetParameter.setIsInput(parameter.isInput());
  dataSetParameter.setIsOutput(parameter.isOutput());
  dataSetParameter.setName(dataSetName + separator + parameter.getName());
  dataSetParameter.setIsOptional(parameter.isOptional());
  dataSetParameter.setPosition(position);
  return dataSetParameter;
}
Program: 69271
Project: 69271
Buggy source:
/** 
 * Depending on the value of the parameters the properties of various controls on this page are set
 */
private void setPageProperties(){
  boolean parametersExist=false;
  parametersExist=(parameters != null && parameters.getListValue() != null && parameters.getListValue().size() > 0);
  if (viewer != null) {
    viewer.getNewButton().setEnabled(!isJointOrDerivedDataSetHandle);
    viewer.getEditButton().setEnabled(!isJointOrDerivedDataSetHandle && parametersExist);
    viewer.getRemoveButton().setEnabled(!isJointOrDerivedDataSetHandle && parametersExist);
    viewer.getUpButton().setEnabled(!isJointOrDerivedDataSetHandle && parametersExist && parameters.getListValue().size() > 1);
    viewer.getDownButton().setEnabled(!isJointOrDerivedDataSetHandle && parametersExist && parameters.getListValue().size() > 1);
    viewer.getRemoveMenuItem().setEnabled(!isJointOrDerivedDataSetHandle && parametersExist);
    viewer.getRemoveAllMenuItem().setEnabled(!isJointOrDerivedDataSetHandle && parametersExist);
  }
  if (parametersExist == false)   getContainer().setMessage(DEFAULT_MESSAGE,IMessageProvider.NONE);
}

Fixed version (ground truth):
/** 
 * Depending on the value of the parameters the properties of various controls on this page are set
 */
private void setPageProperties(){
  viewer.updateButtons();
  boolean parametersExist=(parameters != null && parameters.getListValue() != null && parameters.getListValue().size() > 0);
  if (!parametersExist)   getContainer().setMessage(DEFAULT_MESSAGE,IMessageProvider.NONE);
}
Program: 69272
Project: 69272
Buggy source:
protected void rollback(){
  DataSetParameter structure=getStructure(getStructureOrHandle());
  if (originalStructure != null) {
    structure.setName(originalStructure.getName());
    structure.setParameterDataType(originalStructure.getParameterDataType());
    structure.setIsInput(originalStructure.isInput());
    structure.setIsOutput(originalStructure.isOutput());
    structure.setDefaultValue(originalStructure.getDefaultValue());
    if (isOdaDataSetHandle)     ((OdaDataSetParameter)structure).setParamName(((OdaDataSetParameter)originalStructure).getParamName());
    originalStructure=null;
  }
 else {
    try {
      parameters.removeItem(structure);
      viewer.getViewer().refresh();
    }
 catch (    PropertyValueException e) {
      ExceptionHandler.handle(e);
    }
  }
  modelChanged=inputChanged;
}

Fixed version (ground truth):
protected void rollback(){
  DataSetParameter structure=getStructure(getStructureOrHandle());
  try {
    if (originalStructure != null) {
      structure.setName(originalStructure.getName());
      structure.setParameterDataType(originalStructure.getParameterDataType());
      structure.setIsInput(originalStructure.isInput());
      structure.setIsOutput(originalStructure.isOutput());
      structure.setDefaultValue(originalStructure.getDefaultValue());
      structure.setExpressionProperty(DataSetParameter.DEFAULT_VALUE_MEMBER,originalStructure.getExpressionProperty(DataSetParameter.DEFAULT_VALUE_MEMBER));
      if (isOdaDataSetHandle)       ((OdaDataSetParameter)structure).setParamName(((OdaDataSetParameter)originalStructure).getParamName());
      originalStructure=null;
    }
 else {
      parameters.removeItem(structure);
      viewer.getViewer().refresh();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.handle(e);
  }
  modelChanged=inputChanged;
}
Program: 69274
Project: 69274
Buggy source:
/** 
 */
public PropertyHandleTableViewer(Composite parent,boolean showMenus,boolean showButtons,boolean enableKeyStrokes){
  mainControl=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.numColumns=2;
  mainControl.setLayout(layout);
  viewer=new TableViewer(mainControl,SWT.FULL_SELECTION | SWT.BORDER);
  GridData data=new GridData(GridData.FILL_BOTH);
  data.grabExcessHorizontalSpace=true;
  viewer.getControl().setLayoutData(data);
  viewer.getTable().setHeaderVisible(true);
  viewer.getTable().setLinesVisible(true);
  if (showButtons) {
    localizeButtonWidth();
    createButtonComposite();
  }
  if (showMenus)   createMenuComposite();
  if (enableKeyStrokes)   enableKeyStrokes();
}

Fixed version (ground truth):
/** 
 */
public PropertyHandleTableViewer(Composite parent,boolean showMenus,boolean showButtons,boolean enableKeyStrokes,boolean editable){
  mainControl=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.numColumns=2;
  mainControl.setLayout(layout);
  viewer=new TableViewer(mainControl,SWT.FULL_SELECTION | SWT.BORDER);
  GridData data=new GridData(GridData.FILL_BOTH);
  data.grabExcessHorizontalSpace=true;
  viewer.getControl().setLayoutData(data);
  viewer.getTable().setHeaderVisible(true);
  viewer.getTable().setLinesVisible(true);
  if (showButtons) {
    localizeButtonWidth();
    createButtonComposite(editable);
  }
  if (showMenus)   createMenuComposite();
  if (enableKeyStrokes)   enableKeyStrokes();
}
Program: 69275
Project: 69275
Buggy source:
void doRemove(){
  int index=viewer.getTable().getSelectionIndex();
  PropertyHandle handle=(PropertyHandle)viewer.getInput();
  int count=(handle.getListValue() == null) ? 0 : handle.getListValue().size();
  if (index > -1 && index < count) {
    try {
      handle.removeItem(index);
    }
 catch (    PropertyValueException e1) {
      ExceptionHandler.handle(e1);
    }
    viewer.refresh();
    viewer.getTable().select(index);
  }
}

Fixed version (ground truth):
void doRemove(){
  int index=viewer.getTable().getSelectionIndex();
  PropertyHandle handle=(PropertyHandle)viewer.getInput();
  int count=(handle.getListValue() == null) ? 0 : handle.getListValue().size();
  if (index > -1 && index < count) {
    try {
      handle.removeItem(index);
    }
 catch (    PropertyValueException e1) {
      ExceptionHandler.handle(e1);
    }
    viewer.refresh();
    viewer.getTable().setFocus();
    viewer.getTable().select(index);
    updateButtons();
  }
}
Program: 69276
Project: 69276
Buggy source:
private Button createButton(Composite parent,String label,SelectionListener listener){
  Button button=new Button(parent,SWT.PUSH);
  button.setText(label);
  button.addSelectionListener(listener);
  GridData gd=new GridData();
  gd.widthHint=defaultButtonWidth;
  button.setLayoutData(gd);
  return button;
}

Fixed version (ground truth):
private Button createButton(Composite parent,String label,SelectionListener listener){
  Button button=new Button(parent,SWT.PUSH);
  button.setText(label);
  if (listener != null)   button.addSelectionListener(listener);
  GridData gd=new GridData();
  gd.widthHint=defaultButtonWidth;
  button.setLayoutData(gd);
  return button;
}
Program: 69277
Project: 69277
Buggy source:
private void createButtonComposite(){
  Composite composite=new Composite(mainControl,SWT.NONE);
  GridData gd=new GridData();
  gd.verticalIndent=-5;
  gd.verticalAlignment=SWT.BEGINNING;
  composite.setLayoutData(gd);
  composite.setLayout(new GridLayout());
  SelectionAdapter listener=new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      doButtonSelected(e);
    }
  }
;
  if (buttonLabels != null) {
    buttonArray=new Button[buttonLabels.length];
    for (int i=0; i < buttonLabels.length; i++) {
      String currLabel=buttonLabels[i];
      if (currLabel != null) {
        buttonArray[i]=createButton(composite,currLabel,listener);
      }
 else {
        buttonArray[i]=null;
        createSeparator(composite);
      }
    }
  }
}

Fixed version (ground truth):
private void createButtonComposite(boolean editable){
  Composite composite=new Composite(mainControl,SWT.NONE);
  GridData gd=new GridData();
  gd.verticalIndent=-5;
  gd.verticalAlignment=SWT.BEGINNING;
  composite.setLayoutData(gd);
  composite.setLayout(new GridLayout());
  SelectionAdapter listener=null;
  if (editable)   listener=new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      doButtonSelected(e);
    }
  }
;
  if (buttonLabels != null) {
    buttonArray=new Button[buttonLabels.length];
    for (int i=0; i < buttonLabels.length; i++) {
      String currLabel=buttonLabels[i];
      if (currLabel != null) {
        buttonArray[i]=createButton(composite,currLabel,listener);
        if (!editable)         buttonArray[i].setEnabled(editable);
      }
 else {
        buttonArray[i]=null;
        createSeparator(composite);
      }
    }
  }
}
Program: 69278
Project: 69278
Buggy source:
public void widgetSelected(SelectionEvent e){
  try {
    PropertyHandle handle=(PropertyHandle)viewer.getInput();
    handle.clearValue();
    viewer.refresh();
  }
 catch (  SemanticException e1) {
    ExceptionHandler.handle(e1);
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  try {
    PropertyHandle handle=(PropertyHandle)viewer.getInput();
    handle.clearValue();
    viewer.refresh();
    updateButtons();
  }
 catch (  SemanticException e1) {
    ExceptionHandler.handle(e1);
  }
}
Program: 69279
Project: 69279
Buggy source:
private void createMenuComposite(){
  menu=new Menu(viewer.getTable());
  menu.addMenuListener(new MenuAdapter(){
    public void menuShown(    MenuEvent e){
      viewer.cancelEditing();
    }
  }
);
  itmRemove=new MenuItem(menu,SWT.NONE);
  itmRemove.setText(Messages.getString("String_Node_Str"));
  itmRemove.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      doRemove();
    }
  }
);
  itmRemoveAll=new MenuItem(menu,SWT.NONE);
  itmRemoveAll.setText(Messages.getString("String_Node_Str"));
  itmRemoveAll.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      try {
        PropertyHandle handle=(PropertyHandle)viewer.getInput();
        handle.clearValue();
        viewer.refresh();
      }
 catch (      SemanticException e1) {
        ExceptionHandler.handle(e1);
      }
    }
  }
);
  viewer.getTable().setMenu(menu);
}

Fixed version (ground truth):
private void createMenuComposite(){
  menu=new Menu(viewer.getTable());
  menu.addMenuListener(new MenuAdapter(){
    public void menuShown(    MenuEvent e){
      viewer.cancelEditing();
    }
  }
);
  itmRemove=new MenuItem(menu,SWT.NONE);
  itmRemove.setText(Messages.getString("String_Node_Str"));
  itmRemove.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      doRemove();
    }
  }
);
  itmRemoveAll=new MenuItem(menu,SWT.NONE);
  itmRemoveAll.setText(Messages.getString("String_Node_Str"));
  itmRemoveAll.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      try {
        PropertyHandle handle=(PropertyHandle)viewer.getInput();
        handle.clearValue();
        viewer.refresh();
        updateButtons();
      }
 catch (      SemanticException e1) {
        ExceptionHandler.handle(e1);
      }
    }
  }
);
  viewer.getTable().setMenu(menu);
}
Program: 69280
Project: 69280
Buggy source:
private void doUp(){
  int index=viewer.getTable().getSelectionIndex();
  PropertyHandle handle=(PropertyHandle)viewer.getInput();
  if (index > 0 && handle.getListValue() != null && index < handle.getListValue().size()) {
    viewer.cancelEditing();
    try {
      handle.moveItem(index,index - 1);
    }
 catch (    PropertyValueException e1) {
      ExceptionHandler.handle(e1);
    }
    viewer.refresh();
    viewer.getTable().select(index - 1);
  }
}

Fixed version (ground truth):
private void doUp(){
  int index=viewer.getTable().getSelectionIndex();
  PropertyHandle handle=(PropertyHandle)viewer.getInput();
  if (index > 0 && handle.getListValue() != null && index < handle.getListValue().size()) {
    viewer.cancelEditing();
    try {
      handle.moveItem(index,index - 1);
    }
 catch (    PropertyValueException e1) {
      ExceptionHandler.handle(e1);
    }
    viewer.refresh();
    viewer.getTable().setFocus();
    viewer.getTable().select(index - 1);
    updateButtons();
  }
}
Program: 69281
Project: 69281
Buggy source:
private void doDown(){
  int index=viewer.getTable().getSelectionIndex();
  PropertyHandle handle=(PropertyHandle)viewer.getInput();
  if (index > -1 && handle.getListValue() != null && index < handle.getListValue().size() - 1) {
    viewer.cancelEditing();
    try {
      handle.moveItem(index,index + 1);
    }
 catch (    PropertyValueException e1) {
      ExceptionHandler.handle(e1);
    }
    viewer.refresh();
    viewer.getTable().select(index + 1);
  }
}

Fixed version (ground truth):
private void doDown(){
  int index=viewer.getTable().getSelectionIndex();
  PropertyHandle handle=(PropertyHandle)viewer.getInput();
  if (index > -1 && handle.getListValue() != null && index < handle.getListValue().size() - 1) {
    viewer.cancelEditing();
    try {
      handle.moveItem(index,index + 1);
    }
 catch (    PropertyValueException e1) {
      ExceptionHandler.handle(e1);
    }
    viewer.refresh();
    viewer.getTable().setFocus();
    viewer.getTable().select(index + 1);
    updateButtons();
  }
}
Program: 69282
Project: 69282
Buggy source:
public void handleEvent(Event event){
  if (event.data == getDataSheet() || event.data instanceof BaseDataDefinitionComponent) {
    if (event.type == IChartDataSheet.EVENT_PREVIEW) {
      doPreview();
      updateApplyButton();
    }
 else     if (event.type == IChartDataSheet.EVENT_QUERY) {
      getCustomizeUI().refreshBottomBindingArea();
      getCustomizeUI().refreshLeftBindingArea();
      getCustomizeUI().refreshRightBindingArea();
      DataDefinitionTextManager.getInstance().refreshAll();
    }
  }
  if (event.type == IChartDataSheet.EVENT_QUERY) {
    if (ChartUIConstants.QUERY_CATEGORY.equals(event.data)) {
      getCustomizeUI().refreshBottomBindingArea();
    }
 else     if (ChartUIConstants.QUERY_OPTIONAL.equals(event.data)) {
      getCustomizeUI().refreshRightBindingArea();
    }
 else     if (ChartUIConstants.QUERY_VALUE.equals(event.data)) {
      getCustomizeUI().refreshLeftBindingArea();
    }
    DataDefinitionTextManager.getInstance().refreshAll();
  }
 else   if (event.type == SWT.Resize) {
    autoSash();
  }
}

Fixed version (ground truth):
public void handleEvent(Event event){
  if (event.data == getDataSheet() || event.data instanceof BaseDataDefinitionComponent) {
    if (event.type == IChartDataSheet.EVENT_PREVIEW) {
      if (getChartModel() instanceof ChartWithAxes) {
        checkDataTypeForChartWithAxes();
      }
      doPreview();
      updateApplyButton();
    }
 else     if (event.type == IChartDataSheet.EVENT_QUERY) {
      getCustomizeUI().refreshBottomBindingArea();
      getCustomizeUI().refreshLeftBindingArea();
      getCustomizeUI().refreshRightBindingArea();
      DataDefinitionTextManager.getInstance().refreshAll();
    }
  }
  if (event.type == IChartDataSheet.EVENT_QUERY) {
    if (ChartUIConstants.QUERY_CATEGORY.equals(event.data)) {
      getCustomizeUI().refreshBottomBindingArea();
    }
 else     if (ChartUIConstants.QUERY_OPTIONAL.equals(event.data)) {
      getCustomizeUI().refreshRightBindingArea();
    }
 else     if (ChartUIConstants.QUERY_VALUE.equals(event.data)) {
      getCustomizeUI().refreshLeftBindingArea();
    }
    DataDefinitionTextManager.getInstance().refreshAll();
  }
 else   if (event.type == SWT.Resize) {
    autoSash();
  }
}
Program: 69283
Project: 69283
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,"String_Node_Str","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");
  writeFont(null,null,null,null,null,true,"String_Node_Str");
  writer.closeTag("String_Node_Str");
}
Program: 69284
Project: 69284
Buggy source:
private void writeFont(String fontName,Integer size,String bold,String italic,String strikeThrough,String 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 (isValid(bold)) {
    writer.attribute("String_Node_Str",bold);
  }
  if (isValid(italic)) {
    writer.attribute("String_Node_Str",italic);
  }
  if (isValid(strikeThrough)) {
    writer.attribute("String_Node_Str",strikeThrough);
  }
  if (isValid(underline) && !"String_Node_Str".equalsIgnoreCase(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,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");
}