nus-yam/ex-repair huggingface dataset:
Program: 67428
Project: 67428
Buggy source:
public boolean performOk(){
  if (canLeave()) {
    dealDataSetLocale();
    dealDataSetNullOrdering();
    return super.performOk();
  }
 else   return false;
}

Fixed version (ground truth):
public boolean performOk(){
  if (canLeave()) {
    return super.performOk();
  }
 else   return false;
}
Program: 67429
Project: 67429
Buggy source:
/** 
 * @throws DataException
 */
public void test_FALSE() throws DataException {
  Object result;
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_FALSE,null,null);
  assertResult(result,false);
  result=ScriptEvalUtil.evalConditionalExpr(new Boolean(false),IConditionalExpression.OP_FALSE,null,null);
  assertResult(result,true);
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_FALSE,null,null);
  assertResult(result,false);
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
public void test_FALSE() throws DataException {
  Object result;
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_FALSE,null,null,null);
  assertResult(result,false);
  result=ScriptEvalUtil.evalConditionalExpr(new Boolean(false),IConditionalExpression.OP_FALSE,null,null,null);
  assertResult(result,true);
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_FALSE,null,null,null);
  assertResult(result,false);
}
Program: 67430
Project: 67430
Buggy source:
/** 
 * @throws DataException
 */
public void test_TRUE() throws DataException {
  Object result;
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_TRUE,null,null);
  assertResult(result,true);
  result=ScriptEvalUtil.evalConditionalExpr(new Boolean(false),IConditionalExpression.OP_TRUE,null,null);
  assertResult(result,false);
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_TRUE,null,null);
  assertResult(result,false);
  result=ScriptEvalUtil.evalConditionalExpr(new Boolean(true),IConditionalExpression.OP_TRUE,"String_Node_Str",null);
  assertResult(result,true);
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
public void test_TRUE() throws DataException {
  Object result;
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_TRUE,null,null,null);
  assertResult(result,true);
  result=ScriptEvalUtil.evalConditionalExpr(new Boolean(false),IConditionalExpression.OP_TRUE,null,null,null);
  assertResult(result,false);
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_TRUE,null,null,null);
  assertResult(result,false);
  result=ScriptEvalUtil.evalConditionalExpr(new Boolean(true),IConditionalExpression.OP_TRUE,"String_Node_Str",null);
  assertResult(result,true);
}
Program: 67431
Project: 67431
Buggy source:
/** 
 * @throws DataException
 */
public void test_NULL() throws DataException {
  Object result;
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_NULL,null,null);
  assertResult(result,false);
  result=ScriptEvalUtil.evalConditionalExpr(null,IConditionalExpression.OP_NULL,null,null);
  assertResult(result,true);
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
public void test_NULL() throws DataException {
  Object result;
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_NULL,null,null,null);
  assertResult(result,false);
  result=ScriptEvalUtil.evalConditionalExpr(null,IConditionalExpression.OP_NULL,null,null,null);
  assertResult(result,true);
}
Program: 67432
Project: 67432
Buggy source:
/** 
 * @throws DataException
 */
public void test_NOT_NULL() throws DataException {
  Object result;
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_NOT_NULL,null,null);
  assertResult(result,true);
  result=ScriptEvalUtil.evalConditionalExpr(null,IConditionalExpression.OP_NOT_NULL,null,null);
  assertResult(result,false);
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
public void test_NOT_NULL() throws DataException {
  Object result;
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_NOT_NULL,null,null,null);
  assertResult(result,true);
  result=ScriptEvalUtil.evalConditionalExpr(null,IConditionalExpression.OP_NOT_NULL,null,null,null);
  assertResult(result,false);
}
Program: 67434
Project: 67434
Buggy source:
/** 
 * @param rsMeta
 * @return
 */
private static SortSpec getSortSpec(IResultClass rsMeta){
  int fieldCount=rsMeta.getFieldCount();
  int[] sortKeyIndexs=new int[fieldCount];
  String[] sortKeyNames=new String[fieldCount];
  boolean[] ascending=new boolean[fieldCount];
  Comparator[] comparator=new Comparator[fieldCount];
  for (int i=0; i < fieldCount; i++) {
    sortKeyIndexs[i]=i + 1;
    ascending[i]=true;
  }
  return new SortSpec(sortKeyIndexs,sortKeyNames,ascending,comparator);
}

Fixed version (ground truth):
/** 
 * @param rsMeta
 * @return
 */
private static SortSpec getSortSpec(IResultClass rsMeta){
  int fieldCount=rsMeta.getFieldCount();
  int[] sortKeyIndexs=new int[fieldCount];
  String[] sortKeyNames=new String[fieldCount];
  boolean[] ascending=new boolean[fieldCount];
  CompareHints[] comparator=new CompareHints[fieldCount];
  for (int i=0; i < fieldCount; i++) {
    sortKeyIndexs[i]=i + 1;
    ascending[i]=true;
  }
  return new SortSpec(sortKeyIndexs,sortKeyNames,ascending,comparator);
}
Program: 67435
Project: 67435
Buggy source:
void setComparator(Comparator[] comparator){
  this.comparator=comparator;
}

Fixed version (ground truth):
void setComparator(CompareHints[] comparator){
  this.comparator=comparator;
}
Program: 67436
Project: 67436
Buggy source:
Comparator[] getComparator(){
  return comparator;
}

Fixed version (ground truth):
CompareHints[] getComparator(){
  return comparator;
}
Program: 67437
Project: 67437
Buggy source:
/** 
 * @param sortKeyIndexes
 * @param sortKeyColumns
 * @param sortAscending
 */
public SortSpec(int[] sortKeyIndexes,String[] sortKeyColumns,boolean[] sortAscending,Comparator[] comparator){
  this.setSortKeyIndexes(sortKeyIndexes);
  this.setSortKeyColumns(sortKeyColumns);
  this.setSortAscending(sortAscending);
  this.setComparator(comparator);
}

Fixed version (ground truth):
/** 
 * @param sortKeyIndexes
 * @param sortKeyColumns
 * @param sortAscending
 */
public SortSpec(int[] sortKeyIndexes,String[] sortKeyColumns,boolean[] sortAscending,CompareHints[] comparator){
  this.setSortKeyIndexes(sortKeyIndexes);
  this.setSortKeyColumns(sortKeyColumns);
  this.setSortAscending(sortAscending);
  this.setComparator(comparator);
}
Program: 67438
Project: 67438
Buggy source:
/** 
 */
public int compare(Object o1,Object o2){
  Object[] sortKeys1=((GroupBoundaryInfo)o1).getSortKeys();
  Object[] sortKeys2=((GroupBoundaryInfo)o2).getSortKeys();
  boolean[] sortDirection=((GroupBoundaryInfo)o1).getSortDirection();
  Comparator[] comparator=((GroupBoundaryInfo)o1).getCollarComparator();
  int result=0;
  for (int i=0; i < sortKeys1.length; i++) {
    try {
      result=ScriptEvalUtil.compare(sortKeys1[i],sortKeys2[i],comparator[i]);
    }
 catch (    DataException e) {
      result=0;
    }
    if (result != 0) {
      if (sortDirection[i] == false) {
        result=result * -1;
      }
      break;
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 */
public int compare(Object o1,Object o2){
  Object[] sortKeys1=((GroupBoundaryInfo)o1).getSortKeys();
  Object[] sortKeys2=((GroupBoundaryInfo)o2).getSortKeys();
  boolean[] sortDirection=((GroupBoundaryInfo)o1).getSortDirection();
  CompareHints[] comparator=((GroupBoundaryInfo)o1).getCollarComparator();
  int result=0;
  for (int i=0; i < sortKeys1.length; i++) {
    try {
      result=ScriptEvalUtil.compare(sortKeys1[i],sortKeys2[i],comparator[i]);
    }
 catch (    DataException e) {
      result=0;
    }
    if (result != 0) {
      if (sortDirection[i] == false) {
        result=result * -1;
      }
      break;
    }
  }
  return result;
}
Program: 67439
Project: 67439
Buggy source:
/** 
 * Set the sort conditions
 * @param sortKeys
 * @param sortOrderings
 */
void setSortCondition(Object[] sortKeys,boolean[] sortOrderings,int[] sortStrength,ULocale[] sortLocale){
  this.sortKeys=sortKeys;
  this.sortDirections=sortOrderings;
  this.comparator=new Collator[this.sortKeys.length];
  for (int i=0; i < this.comparator.length; i++) {
    this.comparator[i]=sortStrength[i] == ISortDefinition.ASCII_SORT_STRENGTH ? null : Collator.getInstance(sortLocale[i]);
  }
}

Fixed version (ground truth):
/** 
 * Set the sort conditions
 * @param sortKeys
 * @param sortOrderings
 */
void setSortCondition(Object[] sortKeys,boolean[] sortOrderings,int[] sortStrength,ULocale[] sortLocale){
  this.sortKeys=sortKeys;
  this.sortDirections=sortOrderings;
  this.comparator=new Collator[this.sortKeys.length];
  this.compareHints=new CompareHints[this.sortKeys.length];
  for (int i=0; i < this.comparator.length; i++) {
    this.comparator[i]=sortStrength[i] == ISortDefinition.ASCII_SORT_STRENGTH ? null : Collator.getInstance(sortLocale[i]);
    this.compareHints[i]=new CompareHints(this.comparator[i],null);
  }
}
Program: 67440
Project: 67440
Buggy source:
/** 
 * Return the sort strength;
 * @return
 */
Comparator[] getCollarComparator(){
  return this.comparator;
}

Fixed version (ground truth):
/** 
 * Return the sort strength;
 * @return
 */
CompareHints[] getCollarComparator(){
  return this.compareHints;
}
Program: 67442
Project: 67442
Buggy source:
public LineAttributesComposite(Composite parent,int style,ChartWizardContext wizardContext,LineAttributes laCurrent,boolean bEnableWidths,boolean bEnableStyles,boolean bEnableVisibility,boolean bEnableColor){
  super(parent,style);
  this.laCurrent=laCurrent;
  if (laCurrent == null) {
    this.laCurrent=AttributeFactory.eINSTANCE.createLineAttributes();
  }
  this.bEnableStyles=bEnableStyles;
  this.bEnableWidths=bEnableWidths;
  this.bEnableVisibility=bEnableVisibility;
  this.bEnableColor=bEnableColor;
  this.wizardContext=wizardContext;
  init();
  placeComponents();
}

Fixed version (ground truth):
public LineAttributesComposite(Composite parent,int style,ChartWizardContext wizardContext,LineAttributes laCurrent,boolean bEnableWidths,boolean bEnableStyles,boolean bEnableVisibility,boolean bEnableColor,boolean bEnableAutoColor){
  super(parent,style);
  this.laCurrent=laCurrent;
  if (laCurrent == null) {
    this.laCurrent=AttributeFactory.eINSTANCE.createLineAttributes();
  }
  this.bEnableStyles=bEnableStyles;
  this.bEnableWidths=bEnableWidths;
  this.bEnableVisibility=bEnableVisibility;
  this.bEnableColor=bEnableColor;
  this.bEnableAutoColor=bEnableAutoColor;
  this.wizardContext=wizardContext;
  init();
  placeComponents();
}
Program: 67449
Project: 67449
Buggy source:
private void placeComponents(){
  this.setLayout(new GridLayout());
  Group grpLine=new Group(this,SWT.NONE);
{
    grpLine.setText(Messages.getString("String_Node_Str"));
    GridLayout glLine=new GridLayout();
    glLine.numColumns=series.isShowAsBarStick() ? 3 : 1;
    grpLine.setLayout(glLine);
    grpLine.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  }
  liacStock=new LineAttributesComposite(grpLine,SWT.NONE,context,series.getLineAttributes(),true,true,false);
  GridData gdLIACStock=new GridData(GridData.FILL_HORIZONTAL);
  gdLIACStock.verticalSpan=3;
  liacStock.setLayoutData(gdLIACStock);
  liacStock.addListener(this);
  if (series.isShowAsBarStick()) {
    new Label(grpLine,SWT.NONE).setText(Messages.getString("String_Node_Str"));
    iscStick=new Spinner(grpLine,SWT.BORDER);
    iscStick.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    iscStick.setMinimum(0);
    iscStick.setMaximum(Integer.MAX_VALUE);
    iscStick.setSelection(series.getStickLength());
    iscStick.addSelectionListener(this);
  }
}

Fixed version (ground truth):
private void placeComponents(){
  this.setLayout(new GridLayout());
  Group grpLine=new Group(this,SWT.NONE);
{
    grpLine.setText(Messages.getString("String_Node_Str"));
    GridLayout glLine=new GridLayout();
    glLine.numColumns=series.isShowAsBarStick() ? 3 : 1;
    grpLine.setLayout(glLine);
    grpLine.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  }
  liacStock=new LineAttributesComposite(grpLine,SWT.NONE,context,series.getLineAttributes(),true,true,false,true,true);
  GridData gdLIACStock=new GridData(GridData.FILL_HORIZONTAL);
  gdLIACStock.verticalSpan=3;
  liacStock.setLayoutData(gdLIACStock);
  liacStock.addListener(this);
  if (series.isShowAsBarStick()) {
    new Label(grpLine,SWT.NONE).setText(Messages.getString("String_Node_Str"));
    iscStick=new Spinner(grpLine,SWT.BORDER);
    iscStick.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    iscStick.setMinimum(0);
    iscStick.setMaximum(Integer.MAX_VALUE);
    iscStick.setSelection(series.getStickLength());
    iscStick.addSelectionListener(this);
  }
}
Program: 67450
Project: 67450
Buggy source:
public IRenderOption getPreferredRenderOption(){
  PDFRenderOption renderOption=new PDFRenderOption();
  renderOption.setEmitterID(getID());
  renderOption.setOutputFormat("String_Node_Str");
  if (values != null && values.length > 0) {
    for (    IOptionValue optionValue : values) {
      if (optionValue != null) {
        renderOption.setOption(getRenderOptionName(optionValue.getName()),optionValue.getValue());
      }
    }
  }
  return renderOption;
}

Fixed version (ground truth):
public IRenderOption getPreferredRenderOption(){
  PDFRenderOption renderOption=new PDFRenderOption();
  renderOption.setEmitterID(getID());
  renderOption.setOutputFormat("String_Node_Str");
  if (values != null && values.length > 0) {
    for (    IOptionValue optionValue : values) {
      if (optionValue != null) {
        if (optionValue.getName().equals(RENDER_CHART_IN_SVG)) {
          boolean renderChartInSVG=true;
          Object value=optionValue.getValue();
          if (value != null && value instanceof Boolean) {
            renderChartInSVG=(Boolean)value;
          }
          if (renderChartInSVG) {
            renderOption.setSupportedImageFormats("String_Node_Str");
          }
 else {
            renderOption.setSupportedImageFormats("String_Node_Str");
          }
        }
 else {
          renderOption.setOption(getRenderOptionName(optionValue.getName()),optionValue.getValue());
        }
      }
    }
  }
  return renderOption;
}
Program: 67452
Project: 67452
Buggy source:
private void recalculateAggregation(List<IAggregationResultRow> aggregationRows) throws DataException, IOException {
  if (this.calculator == null) {
    return;
  }
  for (int i=0; i < aggregationRows.size(); i++) {
    this.calculator.start();
    List<Integer> positions=getRowsPositionInAggregationRows(i,aggregationRows);
    for (int k=0; k < positions.size(); k++) {
      this.calculator.onRow(aggregationRows.get(positions.get(k)));
    }
    this.calculator.finish(aggregationRows.get(i));
  }
}

Fixed version (ground truth):
private void recalculateAggregation(List<IAggregationResultRow> aggregationRows) throws DataException, IOException {
  Set<Integer> duplicatedIndex=new HashSet<Integer>();
  for (int i=0; i < aggregationRows.size(); i++) {
    this.calculator.start();
    List<Integer> positions=getRowsPositionInAggregationRows(i,aggregationRows);
    for (int k=0; k < positions.size(); k++) {
      this.calculator.onRow(aggregationRows.get(positions.get(k)));
      if (k != 0)       duplicatedIndex.add(positions.get(k));
    }
    this.calculator.finish(aggregationRows.get(i));
    Iterator<Integer> iter=duplicatedIndex.iterator();
    while (iter.hasNext()) {
      aggregationRows.remove(iter.next());
    }
    duplicatedIndex.clear();
  }
}
Program: 67454
Project: 67454
Buggy source:
private static ISortDefinition[] getIncrementSorts(ICubeQueryDefinition basedQuery,ICubeQueryDefinition newQuery) throws DataException {
  if (isEqualSorts(basedQuery.getSorts(),newQuery.getSorts())) {
    return new ISortDefinition[0];
  }
 else {
    List<ISortDefinition> result=newQuery.getSorts();
    return result.toArray(new ISortDefinition[0]);
  }
}

Fixed version (ground truth):
private static ISortDefinition[] getIncrementSorts(ICubeQueryDefinition basedQuery,ICubeQueryDefinition newQuery) throws DataException {
  if (newQuery.getSorts().size() < basedQuery.getSorts().size()) {
    return null;
  }
  if (isEqualSorts(basedQuery.getSorts(),newQuery.getSorts())) {
    return new ISortDefinition[0];
  }
 else {
    List<ISortDefinition> result=newQuery.getSorts();
    return result.toArray(new ISortDefinition[0]);
  }
}
Program: 67455
Project: 67455
Buggy source:
/** 
 * Returns hint info about how newQuery can be executed based on the execution result of basedQuery.
 * @param basedQuery
 * @param newQuery
 * @return null if the execution result of basedQuery is useless for newQuery 
 */
public static IncrementExecutionHint getIncrementExecutionHint(ICubeQueryDefinition basedQuery,ICubeQueryDefinition newQuery) throws DataException {
  if (basedQuery.getFilterOption() != newQuery.getFilterOption()) {
    return null;
  }
  if (!isEqualMeasures(basedQuery.getMeasures(),newQuery.getMeasures())) {
    return null;
  }
  if (!isEqualMeasures(basedQuery.getComputedMeasures(),newQuery.getComputedMeasures())) {
    return null;
  }
  if (!isEqualEdges(basedQuery,newQuery)) {
    return null;
  }
  if (!isEqualCubeOperations(basedQuery.getCubeOperations(),newQuery.getCubeOperations())) {
    return null;
  }
  IncrementExecutionHint ieh=new IncrementExecutionHint();
  IBinding[] bindings=getIncrementBindings(basedQuery,newQuery);
  if (bindings == null) {
    return null;
  }
 else {
    ieh.setBindings(bindings);
  }
  IFilterDefinition[] filters=getIncrementFilters(basedQuery,newQuery);
  if (filters == null) {
    return null;
  }
 else {
    ieh.setFilters(filters);
  }
  ISortDefinition[] sorts=getIncrementSorts(basedQuery,newQuery);
  ieh.setSorts(sorts);
  return ieh;
}

Fixed version (ground truth):
/** 
 * Returns hint info about how newQuery can be executed based on the execution result of basedQuery.
 * @param basedQuery
 * @param newQuery
 * @return null if the execution result of basedQuery is useless for newQuery 
 */
public static IncrementExecutionHint getIncrementExecutionHint(ICubeQueryDefinition basedQuery,ICubeQueryDefinition newQuery) throws DataException {
  if (basedQuery.getFilterOption() != newQuery.getFilterOption()) {
    return null;
  }
  if (!isEqualMeasures(basedQuery.getMeasures(),newQuery.getMeasures())) {
    return null;
  }
  if (!isEqualMeasures(basedQuery.getComputedMeasures(),newQuery.getComputedMeasures())) {
    return null;
  }
  if (!isEqualEdges(basedQuery,newQuery)) {
    return null;
  }
  if (!isEqualCubeOperations(basedQuery.getCubeOperations(),newQuery.getCubeOperations())) {
    return null;
  }
  IncrementExecutionHint ieh=new IncrementExecutionHint();
  IBinding[] bindings=getIncrementBindings(basedQuery,newQuery);
  if (bindings == null) {
    return null;
  }
 else {
    ieh.setBindings(bindings);
  }
  IFilterDefinition[] filters=getIncrementFilters(basedQuery,newQuery);
  if (filters == null) {
    return null;
  }
 else {
    ieh.setFilters(filters);
  }
  ISortDefinition[] sorts=getIncrementSorts(basedQuery,newQuery);
  if (sorts == null) {
    return null;
  }
 else   ieh.setSorts(sorts);
  return ieh;
}
Program: 67456
Project: 67456
Buggy source:
private Color[] createColorMap(Display display){
  return new Color[]{new Color(display,0,0,0),new Color(display,154,50,0),new Color(display,51,51,0),new Color(display,0,50,0),new Color(display,0,50,100),new Color(display,0,0,128),new Color(display,51,51,153),new Color(display,51,51,51),new Color(display,128,0,0),new Color(display,254,102,0),new Color(display,124,124,0),new Color(display,0,128,0),new Color(display,0,128,128),new Color(display,0,0,254),new Color(display,102,102,153),new Color(display,128,128,128),new Color(display,254,0,0),new Color(display,254,153,0),new Color(display,154,204,0),new Color(display,51,153,102),new Color(display,51,204,204),new Color(display,51,102,254),new Color(display,128,0,128),new Color(display,145,145,145),new Color(display,254,0,254),new Color(display,254,204,0),new Color(display,254,254,0),new Color(display,0,254,0),new Color(display,0,254,254),new Color(display,0,204,254),new Color(display,154,50,102),new Color(display,192,192,192),new Color(display,253,153,204),new Color(display,254,204,153),new Color(display,254,254,153),new Color(display,204,254,204),new Color(display,204,254,254),new Color(display,153,204,254),new Color(display,204,153,254),new Color(display,254,254,254)};
}

Fixed version (ground truth):
private Color[] createColorMap(Display display){
  return new Color[]{new Color(display,0,0,0),new Color(display,154,50,0),new Color(display,51,51,0),new Color(display,0,50,0),new Color(display,0,50,100),new Color(display,0,0,128),new Color(display,51,51,153),new Color(display,51,51,51),new Color(display,128,0,0),new Color(display,255,102,0),new Color(display,124,124,0),new Color(display,0,128,0),new Color(display,0,128,128),new Color(display,0,0,255),new Color(display,102,102,153),new Color(display,128,128,128),new Color(display,255,0,0),new Color(display,255,153,0),new Color(display,154,204,0),new Color(display,51,153,102),new Color(display,51,204,204),new Color(display,51,102,255),new Color(display,128,0,128),new Color(display,145,145,145),new Color(display,255,0,255),new Color(display,255,204,0),new Color(display,255,255,0),new Color(display,0,255,0),new Color(display,0,255,255),new Color(display,0,204,255),new Color(display,154,50,102),new Color(display,192,192,192),new Color(display,253,153,204),new Color(display,255,204,153),new Color(display,255,255,153),new Color(display,204,255,204),new Color(display,204,255,255),new Color(display,153,204,255),new Color(display,204,153,255),new Color(display,255,255,255)};
}
Program: 67460
Project: 67460
Buggy source:
protected boolean isParameterRequired(String paramName){
  if (paramName == null) {
    return false;
  }
  if (parameterList != null) {
    for (Iterator iter=parameterList.iterator(); iter.hasNext(); ) {
      Object obj=iter.next();
      if (obj instanceof ScalarParameterHandle && ((ScalarParameterHandle)obj).getName().equals(paramName)) {
        return !((ScalarParameterHandle)obj).allowNull() || !((ScalarParameterHandle)obj).allowBlank();
      }
    }
  }
  return false;
}

Fixed version (ground truth):
protected boolean isParameterRequired(String paramName){
  if (paramName == null) {
    return false;
  }
  if (parameterList != null) {
    for (Iterator<ParameterHandle> iter=parameterList.iterator(); iter.hasNext(); ) {
      Object obj=iter.next();
      if (obj instanceof ScalarParameterHandle && ((ScalarParameterHandle)obj).getName().equals(paramName)) {
        return !((ScalarParameterHandle)obj).allowNull() || !((ScalarParameterHandle)obj).allowBlank();
      }
    }
  }
  return false;
}
Program: 67461
Project: 67461
Buggy source:
public String getColumnText(Object element,int columnIndex){
  String text=null;
  ParamBinding parameterBinding=((ParamBinding)element);
  if (parameterBinding != dummyParameterBinding) {
    if (columnIndex == 0) {
      text=parameterBinding.getParamName();
    }
 else     if (columnIndex == 2) {
      String name=parameterBinding.getParamName();
      String dataType=(String)paramTypes.get(name);
      if (dataType == null) {
        return "String_Node_Str";
      }
      return getDisplayDataType(dataType);
    }
 else     if (columnIndex == 3) {
      text=parameterBinding.getExpression();
    }
  }
  if (text == null) {
    text="String_Node_Str";
  }
  return text;
}

Fixed version (ground truth):
public String getColumnText(Object element,int columnIndex){
  String text=null;
  ParamBinding parameterBinding=((ParamBinding)element);
  if (parameterBinding != dummyParameterBinding) {
    if (columnIndex == 0) {
      text=parameterBinding.getParamName();
    }
 else     if (columnIndex == 2) {
      String name=parameterBinding.getParamName();
      String dataType=paramTypes.get(name);
      if (dataType == null) {
        return "String_Node_Str";
      }
      return getDisplayDataType(dataType);
    }
 else     if (columnIndex == 3) {
      text=parameterBinding.getExpression();
    }
  }
  if (text == null) {
    text="String_Node_Str";
  }
  return text;
}
Program: 67462
Project: 67462
Buggy source:
public HyperlinkBuilder(boolean isIDE){
  this(UIUtil.getDefaultShell());
  this.isIDE=isIDE;
}

Fixed version (ground truth):
public HyperlinkBuilder(boolean isIDE){
  this(UIUtil.getDefaultShell(),isIDE);
}
Program: 67463
Project: 67463
Buggy source:
private List getAllTocDisplayString(TOCNode parent){
  List tocList=new ArrayList();
  if (parent.getParent() != null) {
    tocList.add("String_Node_Str" + parent.getDisplayString() + "String_Node_Str");
  }
  List childToc=parent.getChildren();
  for (Iterator iter=childToc.iterator(); iter.hasNext(); ) {
    TOCNode node=(TOCNode)iter.next();
    tocList.addAll(getAllTocDisplayString(node));
  }
  return tocList;
}

Fixed version (ground truth):
private List<String> getAllTocDisplayString(TOCNode parent){
  List<String> tocList=new ArrayList<String>();
  if (parent.getParent() != null) {
    tocList.add("String_Node_Str" + parent.getDisplayString() + "String_Node_Str");
  }
  List childToc=parent.getChildren();
  for (Iterator iter=childToc.iterator(); iter.hasNext(); ) {
    TOCNode node=(TOCNode)iter.next();
    tocList.addAll(getAllTocDisplayString(node));
  }
  return tocList;
}
Program: 67466
Project: 67466
Buggy source:
private void buildParameterChoices(String selectedParameter){
  ArrayList avaliavleList=new ArrayList();
  for (Iterator iter=parameterList.iterator(); iter.hasNext(); ) {
    ParameterHandle parameter=(ParameterHandle)iter.next();
    avaliavleList.add(parameter.getQualifiedName());
  }
  for (Iterator iter=bindingList.iterator(); iter.hasNext(); ) {
    ParamBinding paramBinding=(ParamBinding)iter.next();
    if (!paramBinding.getParamName().equals(selectedParameter)) {
      avaliavleList.remove(paramBinding.getParamName());
    }
  }
  parameterChooser.setItems((String[])avaliavleList.toArray(new String[0]));
}

Fixed version (ground truth):
private void buildParameterChoices(String selectedParameter){
  ArrayList<String> avaliableList=new ArrayList<String>();
  for (Iterator<ParameterHandle> iter=parameterList.iterator(); iter.hasNext(); ) {
    ParameterHandle parameter=iter.next();
    avaliableList.add(parameter.getQualifiedName());
  }
  for (Iterator<ParamBinding> iter=bindingList.iterator(); iter.hasNext(); ) {
    ParamBinding paramBinding=iter.next();
    if (!paramBinding.getParamName().equals(selectedParameter)) {
      avaliableList.remove(paramBinding.getParamName());
    }
  }
  parameterChooser.setItems(avaliableList.toArray(new String[0]));
}
Program: 67468
Project: 67468
Buggy source:
public String[] getActionExpressions(Action action,StructureSource source){
  if (action instanceof MultipleActions) {
    List<String> expList=new ArrayList<String>();
    for (    Action subAction : ((MultipleActions)action).getActions()) {
      if (subAction.getValue() instanceof URLValue) {
        getURLValueExpressions(expList,(URLValue)subAction.getValue());
      }
    }
    if (expList.size() > 0) {
      return (String[])expList.toArray(new String[expList.size()]);
    }
  }
 else   if (ActionType.URL_REDIRECT_LITERAL.equals(action.getType())) {
    List<String> expList=new ArrayList<String>();
    if (action.getValue() instanceof URLValue) {
      URLValue uv=(URLValue)action.getValue();
      getURLValueExpressions(expList,uv);
    }
 else     if (action.getValue() instanceof MultiURLValues) {
      for (      URLValue uv : ((MultiURLValues)action.getValue()).getURLValues()) {
        getURLValueExpressions(expList,uv);
      }
    }
    if (expList.size() > 0) {
      return (String[])expList.toArray(new String[expList.size()]);
    }
  }
 else   if (ActionType.SHOW_TOOLTIP_LITERAL.equals(action.getType())) {
    if (StructureType.SERIES.equals(source.getType())) {
      TooltipValue tv=(TooltipValue)action.getValue();
      String exp=tv.getText();
      if (exp != null && exp.trim().length() > 0) {
        return new String[]{exp};
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public String[] getActionExpressions(Action action,StructureSource source){
  if (action instanceof MultipleActions) {
    List<String> expList=new ArrayList<String>();
    for (    Action subAction : ((MultipleActions)action).getActions()) {
      if (subAction.getValue() instanceof URLValue) {
        getURLValueExpressions(expList,(URLValue)subAction.getValue());
      }
    }
    if (expList.size() > 0) {
      return (String[])expList.toArray(new String[expList.size()]);
    }
  }
 else   if (ActionType.URL_REDIRECT_LITERAL.equals(action.getType())) {
    List<String> expList=new ArrayList<String>();
    if (action.getValue() instanceof URLValue) {
      URLValue uv=(URLValue)action.getValue();
      getURLValueExpressions(expList,uv);
    }
 else     if (action.getValue() instanceof MultiURLValues) {
      for (      URLValue uv : ((MultiURLValues)action.getValue()).getURLValues()) {
        getURLValueExpressions(expList,uv);
      }
    }
    if (expList.size() > 0) {
      return (String[])expList.toArray(new String[expList.size()]);
    }
  }
 else   if (ActionType.SHOW_TOOLTIP_LITERAL.equals(action.getType())) {
    if (StructureType.SERIES.equals(source.getType())) {
      TooltipValue tv=(TooltipValue)action.getValue();
      String exp=tv.getText();
      if (exp != null && exp.trim().length() > 0) {
        return new String[]{exp};
      }
    }
  }
  return null;
}
Program: 67470
Project: 67470
Buggy source:
protected String getActionString(ChartHyperlinkActionBase chAction,ActionHandle handle){
  if (DesignChoiceConstants.ACTION_LINK_TYPE_HYPERLINK.equals(handle.getLinkType())) {
    ExpressionHandle urlExpr=handle.getExpressionProperty(org.eclipse.birt.report.model.api.elements.structures.Action.URI_MEMBER);
    String text=urlExpr.getStringExpression();
    if (ExpressionType.CONSTANT.equals(urlExpr.getType())) {
      return text;
    }
 else {
      return ChartUtil.stringValue(chAction.evaluate(text));
    }
  }
  if (DesignChoiceConstants.ACTION_LINK_TYPE_BOOKMARK_LINK.equals(handle.getLinkType()))   return ChartUtil.stringValue(chAction.evaluate(handle.getTargetBookmark()));
  return null;
}

Fixed version (ground truth):
protected String getActionString(ChartHyperlinkActionBase chAction,ActionHandle handle){
  if (DesignChoiceConstants.ACTION_LINK_TYPE_HYPERLINK.equals(handle.getLinkType())) {
    ExpressionHandle urlExpr=handle.getExpressionProperty(org.eclipse.birt.report.model.api.elements.structures.Action.URI_MEMBER);
    String text=urlExpr.getStringExpression();
    if (ExpressionType.CONSTANT.equals(urlExpr.getType())) {
      return text;
    }
    return ChartUtil.stringValue(chAction.evaluate(text));
  }
  if (DesignChoiceConstants.ACTION_LINK_TYPE_BOOKMARK_LINK.equals(handle.getLinkType()))   return ChartUtil.stringValue(chAction.evaluate(handle.getTargetBookmark()));
  return null;
}
Program: 67472
Project: 67472
Buggy source:
public Object evaluate(String expr){
  return evaluator.evaluate(expr);
}

Fixed version (ground truth):
@Override public Object evaluate(String expr){
  return evaluator.evaluate(expr);
}
Program: 67474
Project: 67474
Buggy source:
public List<Integer> seek(Object value) throws DataException {
  List keyList=this.keys.get();
  List<List<Integer>> indexList=this.indexs.get();
  int threshHold=binarySearch(value,keyList,IConditionalExpression.OP_EQ);
  if (threshHold < 0 || threshHold >= keyList.size())   return new ArrayList();
  List<Integer> result=new ArrayList<Integer>();
  result.addAll(indexList.get(threshHold));
  return result;
}

Fixed version (ground truth):
public List<Integer> seek(Object value) throws DataException {
  init();
  List keyList=this.keys.get();
  List<List<Integer>> indexList=this.indexs.get();
  int threshHold=binarySearch(value,keyList,IConditionalExpression.OP_EQ);
  if (threshHold < 0 || threshHold >= keyList.size())   return new ArrayList();
  List<Integer> result=new ArrayList<Integer>();
  result.addAll(indexList.get(threshHold));
  return result;
}
Program: 67477
Project: 67477
Buggy source:
public void startTable(ITableContent table){
  adjustInline();
  styles.push(table.getComputedStyle());
  writeBookmark(table);
  Object tableToc=table.getTOC();
  if (tableToc != null) {
    tableTocs.add(new TocInfo(tableToc.toString(),tocLevel));
  }
  increaseTOCLevel(table);
  String caption=table.getCaption();
  if (caption != null) {
    wordWriter.writeCaption(caption);
  }
  if (context.isLastTable()) {
    wordWriter.insertHiddenParagraph();
  }
  int width=WordUtil.convertTo(table.getWidth(),context.getCurrentWidth(),reportDpi);
  width=Math.min(width,context.getCurrentWidth());
  int[] cols=computeTblColumnWidths(table,width);
  wordWriter.startTable(table.getComputedStyle(),getTableWidth(cols));
  wordWriter.writeColumn(cols);
  context.addTable(cols,table.getComputedStyle());
}

Fixed version (ground truth):
public void startTable(ITableContent table){
  adjustInline();
  styles.push(table.getComputedStyle());
  writeBookmark(table);
  Object tableToc=table.getTOC();
  if (tableToc != null) {
    tableTocs.add(new TocInfo(tableToc.toString(),tocLevel));
  }
  increaseTOCLevel(table);
  String caption=table.getCaption();
  if (caption != null) {
    wordWriter.writeCaption(caption);
  }
  if (context.isLastTable()) {
    wordWriter.insertHiddenParagraph();
  }
  int width=WordUtil.convertTo(table.getWidth(),context.getCurrentWidth(),reportDpi);
  int[] cols=computeTblColumnWidths(table,width);
  wordWriter.startTable(table.getComputedStyle(),getTableWidth(cols));
  wordWriter.writeColumn(cols);
  context.addTable(cols,table.getComputedStyle());
}
Program: 67478
Project: 67478
Buggy source:
private int[] computeTblColumnWidths(ITableContent table,int tblWidth){
  int colCount=table.getColumnCount();
  int[] tblColumns=new int[colCount];
  int count=0;
  int total=0;
  for (int i=0; i < colCount; i++) {
    IColumn col=table.getColumn(i);
    if (col.getWidth() == null) {
      tblColumns[i]=-1;
      count++;
    }
 else {
      tblColumns[i]=WordUtil.convertTo(col.getWidth(),tblWidth,reportDpi);
      total+=tblColumns[i];
    }
  }
  if (table.getWidth() == null && count == 0) {
    return tblColumns;
  }
  return EmitterUtil.resizeTableColumn(tblWidth,tblColumns,count,total);
}

Fixed version (ground truth):
private int[] computeTblColumnWidths(ITableContent table,int tblWidth){
  int colCount=table.getColumnCount();
  int[] tblColumns=new int[colCount];
  int count=0;
  int total=0;
  for (int i=0; i < colCount; i++) {
    IColumn col=table.getColumn(i);
    if (col.getWidth() == null) {
      tblColumns[i]=-1;
      count++;
    }
 else {
      tblColumns[i]=WordUtil.convertTo(col.getWidth(),tblWidth,reportDpi);
      total+=tblColumns[i];
    }
  }
  if (table.getWidth() == null && count == 0) {
    return tblColumns;
  }
  tblWidth=Math.min(tblWidth,context.getCurrentWidth());
  return EmitterUtil.resizeTableColumn(tblWidth,tblColumns,count,total);
}
Program: 67479
Project: 67479
Buggy source:
private void populateTable(){
  for (  String propName : propMap.keySet()) {
    ExtendedProperty property=propMap.get(propName);
    String[] sProperty=new String[2];
    sProperty[0]=property.getName();
    sProperty[1]=property.getValue();
    TableItem tiProp=new TableItem(table,SWT.CHECK);
    tiProp.setBackground(getSelectionColor());
    tiProp.setText(sProperty);
  }
  if (table.getItemCount() > 0) {
    table.select(0);
    btnRemove.setEnabled(!propDisabledMap.containsKey(table.getItem(0).getText()));
  }
 else {
    txtNewKey.forceFocus();
    btnRemove.setEnabled(false);
  }
}

Fixed version (ground truth):
private void populateTable(){
  for (  String propName : propMap.keySet()) {
    ExtendedProperty property=propMap.get(propName);
    String[] sProperty=new String[2];
    sProperty[0]=property.getName();
    sProperty[1]=property.getValue();
    TableItem tiProp=new TableItem(table,SWT.CHECK);
    tiProp.setText(sProperty);
  }
  if (table.getItemCount() > 0) {
    table.select(0);
    btnRemove.setEnabled(!propDisabledMap.containsKey(table.getItem(0).getText()));
  }
 else {
    txtNewKey.forceFocus();
    btnRemove.setEnabled(false);
  }
}
Program: 67480
Project: 67480
Buggy source:
/** 
 * @return
 */
private int getAllMeasuerSize(){
  int size=0;
  for (int i=0; i < factTable.getMeasureInfo().length; i++) {
    if (factTable.getMeasureInfo()[i].getDataType() == DataType.DOUBLE_TYPE)     size+=8;
 else     if (factTable.getMeasureInfo()[i].getDataType() == DataType.INTEGER_TYPE)     size+=4;
 else     return -1;
  }
  return size;
}

Fixed version (ground truth):
/** 
 * @return
 */
private int getAllMeasuerSize(){
  int size=0;
  for (int i=0; i < factTable.getMeasureInfo().length; i++) {
    if (factTable.getMeasureInfo()[i].getDataType() == DataType.DOUBLE_TYPE)     size+=9;
 else     if (factTable.getMeasureInfo()[i].getDataType() == DataType.INTEGER_TYPE)     size+=5;
 else     return -1;
  }
  return size;
}
Program: 67482
Project: 67482
Buggy source:
public boolean next() throws IOException, DataException {
  while (!stopSign.isStopped()) {
    try {
      if (currentSegment == null) {
        return false;
      }
      Bytes combinedDimensionPosition=currentSegment.readBytes();
      currentPos=factTable.getCombinedPositionCalculator().calculateDimensionPosition(subDimensionIndex,combinedDimensionPosition.bytesValue());
      readMeasure=false;
      if (!isSelectedRow()) {
        if (!readMeasure) {
          if (allMeasuerSize != -1)           currentSegment.skipBytes(allMeasuerSize);
 else           readMeasure();
        }
        continue;
      }
 else {
        if (!readMeasure)         readMeasure();
        return true;
      }
    }
 catch (    EOFException e) {
      break;
    }
  }
  if (stopSign.isStopped() || !nextSegment()) {
    return false;
  }
  return next();
}

Fixed version (ground truth):
public boolean next() throws IOException, DataException {
  while (!stopSign.isStopped()) {
    try {
      if (currentSegment == null) {
        return false;
      }
      Bytes combinedDimensionPosition=currentSegment.readBytes();
      currentPos=factTable.getCombinedPositionCalculator().calculateDimensionPosition(subDimensionIndex,combinedDimensionPosition.bytesValue());
      readMeasure=false;
      if (!isSelectedRow()) {
        if (!readMeasure) {
          if (allMeasuerSize != -1) {
            int n=currentSegment.skipBytes(allMeasuerSize);
            if (n == -1) {
              break;
            }
          }
 else           readMeasure();
        }
        continue;
      }
 else {
        if (!readMeasure)         readMeasure();
        return true;
      }
    }
 catch (    EOFException e) {
      break;
    }
  }
  if (stopSign.isStopped() || !nextSegment()) {
    return false;
  }
  return next();
}
Program: 67483
Project: 67483
Buggy source:
/** 
 * Creates fills for difference chart
 * @param paletteEntry fill from palette
 * @param isColor to determine output fill is ColorDefinition instance if possible
 * @return Fill array
 */
public static Fill[] createDifferenceFillFromPalette(Fill paletteEntry,boolean isColor){
  Fill fillColorP=null;
  Fill fillColorN=null;
  if (paletteEntry instanceof ColorDefinition) {
    fillColorP=goFactory.copyOf((ColorDefinition)paletteEntry);
    fillColorN=goFactory.copyOf((ColorDefinition)paletteEntry);
  }
 else   if (paletteEntry instanceof MultipleFill) {
    EList<Fill> fills=((MultipleFill)paletteEntry).getFills();
    fillColorP=goFactory.copyOf((ColorDefinition)fills.get(0));
    fillColorN=goFactory.copyOf((ColorDefinition)fills.get(1));
  }
 else   if (isColor && paletteEntry instanceof Gradient) {
    fillColorP=goFactory.copyOf(((Gradient)paletteEntry).getStartColor());
    fillColorN=goFactory.copyOf(((Gradient)paletteEntry).getEndColor());
  }
 else {
    fillColorP=paletteEntry;
    fillColorN=paletteEntry;
  }
  return new Fill[]{fillColorP,fillColorN};
}

Fixed version (ground truth):
/** 
 * Creates fills for difference chart
 * @param paletteEntry fill from palette
 * @param isColor to determine output fill is ColorDefinition instance if possible
 * @return Fill array
 */
public static Fill[] createDifferenceFillFromPalette(Fill paletteEntry,boolean isColor){
  Fill fillColorP=null;
  Fill fillColorN=null;
  if (paletteEntry instanceof ColorDefinition) {
    fillColorP=goFactory.copyOf((ColorDefinition)paletteEntry);
    fillColorN=goFactory.copyOf((ColorDefinition)paletteEntry);
  }
 else   if (paletteEntry instanceof MultipleFill) {
    EList<Fill> fills=((MultipleFill)paletteEntry).getFills();
    fillColorP=goFactory.copyOf(fills.get(0));
    fillColorN=goFactory.copyOf(fills.get(1));
  }
 else   if (isColor && paletteEntry instanceof Gradient) {
    fillColorP=goFactory.copyOf(((Gradient)paletteEntry).getStartColor());
    fillColorN=goFactory.copyOf(((Gradient)paletteEntry).getEndColor());
  }
 else {
    fillColorP=paletteEntry;
    fillColorN=paletteEntry;
  }
  return new Fill[]{fillColorP,fillColorN};
}
Program: 67484
Project: 67484
Buggy source:
static Fill convertFill(Fill fill,boolean bIncrease){
  if (bIncrease) {
    if (fill instanceof MultipleFill) {
      fill=goFactory.copyOf((ColorDefinition)((MultipleFill)fill).getFills().get(0));
    }
 else {
      fill=ColorDefinitionImpl.WHITE();
    }
  }
 else {
    if (fill instanceof MultipleFill) {
      fill=goFactory.copyOf((ColorDefinition)((MultipleFill)fill).getFills().get(1));
    }
  }
  return fill;
}

Fixed version (ground truth):
static Fill convertFill(Fill fill,boolean bIncrease){
  if (bIncrease) {
    if (fill instanceof MultipleFill) {
      fill=goFactory.copyOf(((MultipleFill)fill).getFills().get(0));
    }
 else {
      fill=ColorDefinitionImpl.WHITE();
    }
  }
 else {
    if (fill instanceof MultipleFill) {
      fill=goFactory.copyOf(((MultipleFill)fill).getFills().get(1));
    }
  }
  return fill;
}
Program: 67486
Project: 67486
Buggy source:
public IReportItemInstance[] getInstancesByElementName(String elementName) throws ScriptException {
  ArrayList<IReportItemInstance> instances=new ArrayList<IReportItemInstance>();
  for (  IContent content : contents) {
    ReportItemDesign design=(ReportItemDesign)content.getGenerateBy();
    if (elementName.equals(design.getName())) {
      try {
        ReportItemInstance instance=(ReportItemInstance)ElementUtil.getInstance(content,context,RunningState.PAGEBREAK);
        instances.add(instance);
      }
 catch (      BirtException ex) {
        throw new ScriptException(ex);
      }
    }
  }
  if (!instances.isEmpty()) {
    return instances.toArray(new IReportItemInstance[instances.size()]);
  }
  return null;
}

Fixed version (ground truth):
public IReportItemInstance[] getInstancesByElementName(String elementName) throws ScriptException {
  ArrayList<IReportItemInstance> instances=new ArrayList<IReportItemInstance>();
  for (  IContent content : contents) {
    Object generateBy=content.getGenerateBy();
    if (generateBy instanceof ReportItemDesign) {
      ReportItemDesign design=(ReportItemDesign)generateBy;
      if (elementName.equals(design.getName())) {
        try {
          ReportItemInstance instance=(ReportItemInstance)ElementUtil.getInstance(content,context,RunningState.PAGEBREAK);
          instances.add(instance);
        }
 catch (        BirtException ex) {
          throw new ScriptException(ex);
        }
      }
    }
  }
  if (!instances.isEmpty()) {
    return instances.toArray(new IReportItemInstance[instances.size()]);
  }
  return null;
}
Program: 67487
Project: 67487
Buggy source:
public IReportItemInstance[] getInstancesByElementId(int elementId) throws ScriptException {
  ArrayList<IReportItemInstance> instances=new ArrayList<IReportItemInstance>();
  for (  IContent content : contents) {
    ReportItemDesign design=(ReportItemDesign)content.getGenerateBy();
    if (design.getID() == elementId) {
      try {
        ReportItemInstance instance=(ReportItemInstance)ElementUtil.getInstance(content,context,RunningState.PAGEBREAK);
        instances.add(instance);
      }
 catch (      BirtException ex) {
        throw new ScriptException(ex);
      }
    }
  }
  if (!instances.isEmpty()) {
    return instances.toArray(new IReportItemInstance[instances.size()]);
  }
  return null;
}

Fixed version (ground truth):
public IReportItemInstance[] getInstancesByElementId(int elementId) throws ScriptException {
  ArrayList<IReportItemInstance> instances=new ArrayList<IReportItemInstance>();
  for (  IContent content : contents) {
    Object generateBy=content.getGenerateBy();
    if (generateBy instanceof ReportItemDesign) {
      ReportItemDesign design=(ReportItemDesign)generateBy;
      if (design.getID() == elementId) {
        try {
          ReportItemInstance instance=(ReportItemInstance)ElementUtil.getInstance(content,context,RunningState.PAGEBREAK);
          instances.add(instance);
        }
 catch (        BirtException ex) {
          throw new ScriptException(ex);
        }
      }
    }
  }
  if (!instances.isEmpty()) {
    return instances.toArray(new IReportItemInstance[instances.size()]);
  }
  return null;
}
Program: 67488
Project: 67488
Buggy source:
public void end(IReportContent report) throws IOException, BirtException {
  adjustInline();
  writeSectionInBody();
  wordWriter.endPage();
  wordWriter.end();
}

Fixed version (ground truth):
public void end(IReportContent report) throws IOException, BirtException {
  if (previousPage != null) {
    adjustInline();
    writeSectionInBody();
    wordWriter.endPage();
    wordWriter.end();
  }
}
Program: 67489
Project: 67489
Buggy source:
public String getRightDataSetDesignQulifiedName(){
  return this.rightDataSetQualifiedName;
}

Fixed version (ground truth):
public String getRightDataSetDesignQulifiedName(){
  if (this.rightDataSetQualifiedName == null)   return this.right;
  return this.rightDataSetQualifiedName;
}
Program: 67490
Project: 67490
Buggy source:
public String getLeftDataSetDesignQulifiedName(){
  return this.leftDataSetQualifiedName;
}

Fixed version (ground truth):
public String getLeftDataSetDesignQulifiedName(){
  if (this.leftDataSetQualifiedName == null)   return this.left;
  return this.leftDataSetQualifiedName;
}