nus-yam/ex-repair huggingface dataset:
Program: 64908
Project: 64908
Buggy source:
protected QueryDefinition constructQuery(DataSetHandle dataset,DataRequestSession session) throws BirtException {
  QueryDefinition query=super.constructQuery(dataset);
  PropertyHandle propertyHandle=dataset.getPropertyHandle(DataSetHandle.PARAMETERS_PROP);
  int paramsSize=propertyHandle.getListValue().size();
  Iterator paramIter=propertyHandle.iterator();
  for (int n=1; n <= paramsSize; n++) {
    DataSetParameterHandle paramDefn=(DataSetParameterHandle)paramIter.next();
    if (!paramDefn.isOutput())     continue;
    String bindingName=paramDefn.getName();
    IBinding binding=new Binding(bindingName);
    binding.setExpression(new ScriptExpression(PREFIX_OUTPUTPARAMETER + "String_Node_Str" + paramDefn.getName()+ "String_Node_Str"));
    binding.setDataType(DataAdapterUtil.adaptModelDataType(paramDefn.getDataType()));
    query.addBinding(binding);
  }
  return query;
}

Fixed version (ground truth):
protected QueryDefinition constructQuery(DataSetHandle dataset,DataRequestSession session) throws BirtException {
  QueryDefinition query=super.constructQuery(dataset,session);
  query.getBindings().clear();
  PropertyHandle propertyHandle=dataset.getPropertyHandle(DataSetHandle.PARAMETERS_PROP);
  int paramsSize=propertyHandle.getListValue().size();
  Iterator paramIter=propertyHandle.iterator();
  for (int n=1; n <= paramsSize; n++) {
    DataSetParameterHandle paramDefn=(DataSetParameterHandle)paramIter.next();
    if (!paramDefn.isOutput())     continue;
    String bindingName=paramDefn.getName();
    IBinding binding=new Binding(bindingName);
    binding.setExpression(new ScriptExpression(PREFIX_OUTPUTPARAMETER + "String_Node_Str" + paramDefn.getName()+ "String_Node_Str"));
    binding.setDataType(DataAdapterUtil.adaptModelDataType(paramDefn.getDataType()));
    query.addBinding(binding);
  }
  return query;
}
Program: 64909
Project: 64909
Buggy source:
protected void updateComputedColumn(Object structureOrHandle){
  if (structureOrHandle instanceof ComputedColumn) {
    try {
      computedColumns.addItem((ComputedColumn)structureOrHandle);
      viewer.getViewer().refresh();
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
    }
  }
 else {
    viewer.getViewer().update(structureOrHandle,null);
  }
  if (validateAllComputedColumns())   getContainer().setMessage(Messages.getString("String_Node_Str"),IMessageProvider.NONE);
}

Fixed version (ground truth):
protected void updateComputedColumn(Object structureOrHandle){
  if (structureOrHandle instanceof ComputedColumn) {
    try {
      computedColumns.addItem((ComputedColumn)structureOrHandle);
      viewer.getViewer().refresh();
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
    }
  }
 else {
    viewer.getViewer().update(structureOrHandle,null);
  }
  if (validateAllComputedColumns())   getContainer().setMessage(Messages.getString("String_Node_Str"),IMessageProvider.NONE);
  updateColumnCache();
}
Program: 64910
Project: 64910
Buggy source:
protected boolean isSpecifiedHeight(RowArea area){
  IContent content=(IContent)area.getContent();
  if (content != null) {
    return content.getHeight() != null;
  }
  return false;
}

Fixed version (ground truth):
protected boolean isSpecifiedHeight(RowArea area){
  IContent content=(IContent)area.getContent();
  if (content != null) {
    DimensionType cHeight=content.getHeight();
    if (cHeight != null && !cHeight.getUnits().equals(DimensionType.UNITS_PERCENTAGE)) {
      return true;
    }
  }
  return false;
}
Program: 64911
Project: 64911
Buggy source:
private void setUsesDetails(BaseQueryDefinition baseQuery){
  if (baseQuery instanceof QueryDefinition) {
    ((QueryDefinition)baseQuery).setIsSummaryQuery(true);
  }
  if (baseQuery != null && !baseQuery.cacheQueryResults()) {
    baseQuery.setUsesDetails(false);
  }
}

Fixed version (ground truth):
private void setUsesDetails(BaseQueryDefinition baseQuery){
  if (baseQuery instanceof QueryDefinition && !baseQuery.cacheQueryResults()) {
    ((QueryDefinition)baseQuery).setIsSummaryQuery(true);
  }
  if (baseQuery != null && !baseQuery.cacheQueryResults()) {
    baseQuery.setUsesDetails(false);
  }
}
Program: 64912
Project: 64912
Buggy source:
protected void updateComputedColumn(Object structureOrHandle){
  if (structureOrHandle instanceof ComputedColumn) {
    try {
      computedColumns.addItem((ComputedColumn)structureOrHandle);
      viewer.getViewer().refresh();
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
    }
  }
 else {
    viewer.getViewer().update(structureOrHandle,null);
  }
  if (validateAllComputedColumns())   getContainer().setMessage(Messages.getString("String_Node_Str"),IMessageProvider.NONE);
  updateColumnCache();
}

Fixed version (ground truth):
protected void updateComputedColumn(Object structureOrHandle){
  if (structureOrHandle instanceof ComputedColumn) {
    try {
      computedColumns.addItem((ComputedColumn)structureOrHandle);
      viewer.getViewer().refresh();
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
    }
  }
 else {
    viewer.getViewer().update(structureOrHandle,null);
  }
  if (validateAllComputedColumns())   getContainer().setMessage(Messages.getString("String_Node_Str"),IMessageProvider.NONE);
}
Program: 64913
Project: 64913
Buggy source:
public boolean hasNextChild(){
  if (currentElement < totalElements) {
    return true;
  }
  if (endOfListing) {
    return false;
  }
  try {
    while (!endOfListing) {
      int endGroup=rset.getEndingGroupLevel();
      if (endGroup <= 0) {
        ListingDesign listingDesign=(ListingDesign)getDesign();
        totalElements=0;
        currentElement=0;
        if (listingDesign.getFooter() != null) {
          executableElements[totalElements++]=listingDesign.getFooter();
        }
        endOfListing=true;
        return currentElement < totalElements;
      }
      if (rset.next()) {
        collectExecutableElements();
        if (currentElement < totalElements) {
          return true;
        }
      }
    }
  }
 catch (  BirtException ex) {
    context.addException(this.getDesign(),ex);
  }
  return false;
}

Fixed version (ground truth):
public boolean hasNextChild(){
  if (currentElement < totalElements) {
    return true;
  }
  if (endOfListing) {
    return false;
  }
  try {
    while (!endOfListing) {
      int endGroup=rset.getEndingGroupLevel();
      if (endGroup <= 0) {
        ListingDesign listingDesign=(ListingDesign)getDesign();
        totalElements=0;
        currentElement=0;
        if (listingDesign.getFooter() != null) {
          executableElements[totalElements++]=listingDesign.getFooter();
        }
        endOfListing=true;
        return currentElement < totalElements;
      }
      if (rset.next()) {
        collectExecutableElements();
        if (currentElement < totalElements) {
          return true;
        }
      }
 else {
        ListingDesign listingDesign=(ListingDesign)getDesign();
        totalElements=0;
        currentElement=0;
        if (listingDesign.getFooter() != null) {
          executableElements[totalElements++]=listingDesign.getFooter();
        }
        endOfListing=true;
        return currentElement < totalElements;
      }
    }
  }
 catch (  BirtException ex) {
    context.addException(this.getDesign(),ex);
  }
  return false;
}
Program: 64916
Project: 64916
Buggy source:
protected ArchiveFile createArchiveFile(String name) throws IOException {
  ArchiveFile af=new ArchiveFile(name,"String_Node_Str");
  af.setCacheSize(4096 * 10);
  for (int i=0; i < 1000; i++) {
    ArchiveEntry entry=af.createEntry("String_Node_Str" + i);
    long position=0;
    ByteArrayOutputStream buffer=new ByteArrayOutputStream();
    DataOutputStream output=new DataOutputStream(buffer);
    output.writeUTF("String_Node_Str" + i + "String_Node_Str");
    byte[] bytes=buffer.toByteArray();
    for (int j=0; j < 4096; j++) {
      entry.write(position,bytes,0,bytes.length);
      position+=bytes.length;
    }
    entry.close();
  }
  return af;
}

Fixed version (ground truth):
protected ArchiveFile createArchiveFile(String name) throws IOException {
  ArchiveFile af=new ArchiveFile(name,"String_Node_Str");
  af.setCacheSize(4096 * 10);
  for (int i=0; i < 100; i++) {
    ArchiveEntry entry=af.createEntry("String_Node_Str" + i);
    long position=0;
    ByteArrayOutputStream buffer=new ByteArrayOutputStream();
    DataOutputStream output=new DataOutputStream(buffer);
    output.writeUTF("String_Node_Str" + i + "String_Node_Str");
    byte[] bytes=buffer.toByteArray();
    for (int j=0; j < 4096; j++) {
      entry.write(position,bytes,0,bytes.length);
      position+=bytes.length;
    }
    entry.close();
  }
  return af;
}
Program: 64917
Project: 64917
Buggy source:
/** 
 * Set the error message to the wizard dialog.
 * @param t Exception
 */
public void showErrors(String errorMessage){
  this.errorMessage=errorMessage;
  if (wizard.getDialog().getShell() == null || wizard.getDialog().getShell().isDisposed()) {
    return;
  }
  wizard.getDialog().setErrorMessage(errorMessage);
}

Fixed version (ground truth):
/** 
 * Set the error message to the wizard dialog.
 * @param t Exception
 */
public void showErrors(String errorMessage){
  this.errorMessage=errorMessage;
  if (wizard.getDialog().getShell() == null || wizard.getDialog().getShell().isDisposed()) {
    return;
  }
  wizard.getDialog().setErrorMessage(addLineSeparator(wizard.getDialog().getShell(),errorMessage));
}
Program: 64918
Project: 64918
Buggy source:
/** 
 * Read an int value from an input stream
 * @param inputStream
 * @return int value
 * @throws IOException
 */
public final static int readInt(InputStream inputStream) throws IOException {
  int ch1=inputStream.read();
  int ch2=inputStream.read();
  int ch3=inputStream.read();
  int ch4=inputStream.read();
  return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8)+ (ch4 << 0));
}

Fixed version (ground truth):
/** 
 * Read an int value from an input stream
 * @param inputStream
 * @return int value
 * @throws IOException
 */
public final static int readInt(InputStream inputStream) throws IOException {
  int ch1=inputStream.read();
  int ch2=inputStream.read();
  int ch3=inputStream.read();
  int ch4=inputStream.read();
  if (ch1 == -1 || ch2 == -1 || ch3 == -1 || ch4 == -1) {
    throw new EOFException();
  }
  return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8)+ (ch4 << 0));
}
Program: 64919
Project: 64919
Buggy source:
/** 
 * Read a bool value from an input stream
 * @param inputStream
 * @return boolean value
 * @throws IOException
 */
public final static boolean readBool(InputStream inputStream) throws IOException {
  return inputStream.read() == 0 ? false : true;
}

Fixed version (ground truth):
/** 
 * Read a bool value from an input stream
 * @param inputStream
 * @return boolean value
 * @throws IOException
 */
public final static boolean readBool(InputStream inputStream) throws IOException {
  int v=inputStream.read();
  if (v == -1) {
    throw new EOFException();
  }
  return v == 0 ? false : true;
}
Program: 64920
Project: 64920
Buggy source:
/** 
 * Read an int value from an input stream
 * @param inputStream
 * @return int value
 * @throws IOException
 */
public final static short readShort(InputStream inputStream) throws IOException {
  int ch1=inputStream.read();
  int ch2=inputStream.read();
  return (short)((ch1 << 8) + ch2);
}

Fixed version (ground truth):
/** 
 * Read an int value from an input stream
 * @param inputStream
 * @return int value
 * @throws IOException
 */
public final static short readShort(InputStream inputStream) throws IOException {
  int ch1=inputStream.read();
  int ch2=inputStream.read();
  if (ch1 == -1 || ch2 == -1) {
    throw new EOFException();
  }
  return (short)((ch1 << 8) + ch2);
}
Program: 64921
Project: 64921
Buggy source:
protected QueryDefinition constructQuery(DataSetHandle dataset,DataRequestSession session) throws BirtException {
  QueryDefinition query=super.constructQuery(dataset);
  query.getBindings().clear();
  PropertyHandle propertyHandle=dataset.getPropertyHandle(DataSetHandle.PARAMETERS_PROP);
  int paramsSize=propertyHandle.getListValue().size();
  Iterator paramIter=propertyHandle.iterator();
  for (int n=1; n <= paramsSize; n++) {
    DataSetParameterHandle paramDefn=(DataSetParameterHandle)paramIter.next();
    if (!paramDefn.isOutput())     continue;
    String bindingName=paramDefn.getName();
    IBinding binding=new Binding(bindingName);
    binding.setExpression(new ScriptExpression(PREFIX_OUTPUTPARAMETER + "String_Node_Str" + paramDefn.getName()+ "String_Node_Str"));
    binding.setDataType(DataAdapterUtil.adaptModelDataType(paramDefn.getDataType()));
    query.addBinding(binding);
  }
  return query;
}

Fixed version (ground truth):
protected QueryDefinition constructQuery(DataSetHandle dataset,DataRequestSession session) throws BirtException {
  QueryDefinition query=super.constructQuery(dataset,session);
  PropertyHandle propertyHandle=dataset.getPropertyHandle(DataSetHandle.PARAMETERS_PROP);
  int paramsSize=propertyHandle.getListValue().size();
  Iterator paramIter=propertyHandle.iterator();
  for (int n=1; n <= paramsSize; n++) {
    DataSetParameterHandle paramDefn=(DataSetParameterHandle)paramIter.next();
    if (!paramDefn.isOutput())     continue;
    String bindingName=paramDefn.getName();
    IBinding binding=new Binding(bindingName);
    binding.setExpression(new ScriptExpression(PREFIX_OUTPUTPARAMETER + "String_Node_Str" + paramDefn.getName()+ "String_Node_Str"));
    binding.setDataType(DataAdapterUtil.adaptModelDataType(paramDefn.getDataType()));
    query.addBinding(binding);
  }
  return query;
}
Program: 64922
Project: 64922
Buggy source:
public void onPage(long page,Object pageContext){
  if (pageContext instanceof HTMLLayoutContext) {
    context.firePageBreakEvent(((HTMLLayoutContext)pageContext).isHorizontalPageBreak());
  }
 else {
    context.firePageBreakEvent(false);
  }
}

Fixed version (ground truth):
public void onPage(long page,Object pageContext){
  if (pageContext instanceof HTMLLayoutContext) {
    context.firePageBreakEvent(((HTMLLayoutContext)pageContext).isHorizontalPageBreak(),false);
  }
 else {
    context.firePageBreakEvent(false,true);
  }
}
Program: 64923
Project: 64923
Buggy source:
/** 
 * Notify page break listeners that page is broken.
 */
public void firePageBreakEvent(boolean isHorizontalPageBreak){
  if (pageBreakListeners != null) {
    for (int i=0; i < pageBreakListeners.size(); i++) {
      ((IPageBreakListener)pageBreakListeners.get(i)).onPageBreak(isHorizontalPageBreak);
    }
  }
}

Fixed version (ground truth):
/** 
 * Notify page break listeners that page is broken.
 */
public void firePageBreakEvent(boolean isHorizontalPageBreak,boolean isFixedLayoutPageBreak){
  if (pageBreakListeners != null) {
    for (int i=0; i < pageBreakListeners.size(); i++) {
      ((IPageBreakListener)pageBreakListeners.get(i)).onPageBreak(isHorizontalPageBreak,isFixedLayoutPageBreak);
    }
  }
}
Program: 64924
Project: 64924
Buggy source:
/** 
 * Handler to preocess page break before event.
 */
void onPageBreak(boolean isHorizontalPageBreak);

Fixed version (ground truth):
/** 
 * Handler to preocess page break before event.
 */
void onPageBreak(boolean isHorizontalPageBreak,boolean isFixedLayoutPageBreak);
Program: 64925
Project: 64925
Buggy source:
public void onPageBreak(boolean isHorizontalPageBreak){
  if (!isHorizontalPageBreak) {
    pageRowCount=0;
    if (addAfterBreak) {
      next();
      addAfterBreak=false;
    }
 else {
      if (softBreakBefore) {
        softBreakBefore=false;
      }
    }
  }
}

Fixed version (ground truth):
public void onPageBreak(boolean isHorizontalPageBreak,boolean isFixedlayoutPageBreak){
  if (!isHorizontalPageBreak) {
    pageRowCount=0;
    if (addAfterBreak) {
      next();
      addAfterBreak=false;
    }
 else     if (isFixedlayoutPageBreak) {
      next();
    }
 else {
      if (softBreakBefore) {
        softBreakBefore=false;
      }
    }
  }
}
Program: 64927
Project: 64927
Buggy source:
protected void okPressed(){
  if (canSelect) {
    setResult(selectedColumnName);
    if (inputElement instanceof DataItemHandle) {
      try {
        ((DataItemHandle)inputElement).setResultSetColumn(selectedColumnName);
      }
 catch (      SemanticException e) {
        ExceptionHandler.handle(e);
      }
    }
  }
  if (ExtendedDataModelUIAdapterHelper.isBoundToExtendedData(inputElement)) {
    IStatus status=DataModelAdapterUtil.validateRelativeTimePeriod(inputElement,getSelectColumnHandle());
    if (status.getSeverity() == IStatus.ERROR) {
      MessageDialog.openError(UIUtil.getDefaultShell(),null,status.getMessage());
      return;
    }
  }
  super.okPressed();
}

Fixed version (ground truth):
protected void okPressed(){
  if (canSelect) {
    setResult(selectedColumnName);
    if (inputElement instanceof DataItemHandle) {
      try {
        ((DataItemHandle)inputElement).setResultSetColumn(selectedColumnName);
      }
 catch (      SemanticException e) {
        ExceptionHandler.handle(e);
      }
    }
  }
  if (ExtendedDataModelUIAdapterHelper.isBoundToExtendedData(inputElement)) {
    DataModelAdapterStatus status=DataModelAdapterUtil.validateRelativeTimePeriod(inputElement,getSelectColumnHandle());
    if (status.getStatus() == DataModelAdapterStatus.Status.FAIL) {
      MessageDialog.openError(UIUtil.getDefaultShell(),null,status.getMessage());
      return;
    }
  }
  super.okPressed();
}
Program: 64928
Project: 64928
Buggy source:
public static List<String> getColumnNames(DataSetHandle dataset){
  CachedMetaDataHandle cachedMetaDataHandle=dataset.getCachedMetaDataHandle();
  if (cachedMetaDataHandle != null) {
    List<ResultSetColumn> resultSetColumns=(List<ResultSetColumn>)cachedMetaDataHandle.getProperty(CachedMetaData.RESULT_SET_MEMBER);
    ArrayList<String> columnNames=new ArrayList<String>();
    for (    ResultSetColumn column : resultSetColumns) {
      String columnName=column.getColumnName();
      columnNames.add(columnName);
    }
    return columnNames;
  }
  return Collections.EMPTY_LIST;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static List<String> getColumnNames(DataSetHandle dataset){
  CachedMetaDataHandle cachedMetaDataHandle=dataset.getCachedMetaDataHandle();
  if (cachedMetaDataHandle != null) {
    List<ResultSetColumn> resultSetColumns=(List<ResultSetColumn>)cachedMetaDataHandle.getProperty(CachedMetaData.RESULT_SET_MEMBER);
    if (resultSetColumns == null) {
      return Collections.EMPTY_LIST;
    }
    ArrayList<String> columnNames=new ArrayList<String>();
    for (    ResultSetColumn column : resultSetColumns) {
      String columnName=column.getColumnName();
      columnNames.add(columnName);
    }
    return columnNames;
  }
  return Collections.EMPTY_LIST;
}
Program: 64929
Project: 64929
Buggy source:
/** 
 * Creates a PdfAction.
 * @param hyperlink the hyperlink.
 * @param bookmark the bookmark.
 * @param target if target equals "_blank", the target will be opened in a new window, else the target will be opened in the current window.
 * @return the created PdfAction.
 */
private PdfAction createPdfAction(String hyperlink,String bookmark,String target,int type){
  if ("String_Node_Str".equalsIgnoreCase(target) || "String_Node_Str".equalsIgnoreCase(target) || "String_Node_Str".equalsIgnoreCase(target)|| "String_Node_Str".equalsIgnoreCase(target)) {
    boolean isUrl=hyperlink.startsWith("String_Node_Str");
    if (!isUrl) {
      Matcher matcher=PAGE_LINK_PATTERN.matcher(hyperlink);
      if (matcher.find()) {
        String fileName=matcher.group(1);
        String pageNumber=matcher.group(matcher.groupCount());
        return new PdfAction(fileName,Integer.valueOf(pageNumber));
      }
    }
    return new PdfAction(hyperlink);
  }
 else {
    if (type == IHyperlinkAction.ACTION_BOOKMARK) {
      return PdfAction.gotoLocalPage(bookmark,false);
    }
 else {
      return PdfAction.gotoRemotePage(hyperlink,bookmark,false,false);
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates a PdfAction.
 * @param hyperlink the hyperlink.
 * @param bookmark the bookmark.
 * @param target if target equals "_blank", the target will be opened in a new window, else the target will be opened in the current window.
 * @return the created PdfAction.
 */
private PdfAction createPdfAction(String hyperlink,String bookmark,String target,int type){
  if ("String_Node_Str".equalsIgnoreCase(target) || "String_Node_Str".equalsIgnoreCase(target) || "String_Node_Str".equalsIgnoreCase(target)|| "String_Node_Str".equalsIgnoreCase(target)) {
    if (hyperlink == null)     hyperlink="String_Node_Str";
    boolean isUrl=hyperlink.startsWith("String_Node_Str");
    if (!isUrl) {
      Matcher matcher=PAGE_LINK_PATTERN.matcher(hyperlink);
      if (matcher.find()) {
        String fileName=matcher.group(1);
        String pageNumber=matcher.group(matcher.groupCount());
        return new PdfAction(fileName,Integer.valueOf(pageNumber));
      }
    }
    return new PdfAction(hyperlink);
  }
 else {
    if (type == IHyperlinkAction.ACTION_BOOKMARK) {
      return PdfAction.gotoLocalPage(bookmark,false);
    }
 else {
      return PdfAction.gotoRemotePage(hyperlink,bookmark,false,false);
    }
  }
}
Program: 64930
Project: 64930
Buggy source:
/** 
 * Supports the obsolete setValueExpr() method.
 * @throws Exception
 */
public void testDataValueExpr() throws Exception {
  createDesign();
  DataItemHandle data=designHandle.getElementFactory().newDataItem("String_Node_Str");
  designHandle.getBody().add(data);
  data.setValueExpr("String_Node_Str");
  TableHandle table=designHandle.getElementFactory().newTableItem("String_Node_Str",2);
  data=designHandle.getElementFactory().newDataItem("String_Node_Str");
  data.setValueExpr("String_Node_Str");
  table.getCell(TableHandle.HEADER_SLOT,-1,1,1).getContent().add(data);
  designHandle.getBody().add(table);
  save();
  assertTrue(compareFile("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Supports the obsolete setValueExpr() method.
 * @throws IOException 
 * @throws Exception
 */
public void testDataValueExpr() throws Exception {
  createDesign();
  DataItemHandle data=designHandle.getElementFactory().newDataItem("String_Node_Str");
  designHandle.getBody().add(data);
  data.setValueExpr("String_Node_Str");
  TableHandle table=designHandle.getElementFactory().newTableItem("String_Node_Str",2);
  data=designHandle.getElementFactory().newDataItem("String_Node_Str");
  data.setValueExpr("String_Node_Str");
  table.getCell(TableHandle.HEADER_SLOT,-1,1,1).getContent().add(data);
  designHandle.getBody().add(table);
  save();
  assertTrue(compareDesignModel("String_Node_Str",new String[]{"String_Node_Str"}));
}
Program: 64931
Project: 64931
Buggy source:
/** 
 * Supports the misc setting expression methods.
 * @throws Exception
 */
public void testBoundColumnWriterNoExpression() throws Exception {
  createDesign();
  design.getVersionManager().setVersion("String_Node_Str");
  DataItemHandle data=designHandle.getElementFactory().newDataItem("String_Node_Str");
  data.setTocExpression("String_Node_Str");
  data.setValueExpr("String_Node_Str");
  TableHandle table=designHandle.getElementFactory().newTableItem("String_Node_Str",2);
  table.getCell(TableHandle.HEADER_SLOT,-1,1,1).getContent().add(data);
  designHandle.getBody().add(table);
  FilterCondition filter=new FilterCondition();
  filter.setExpr("String_Node_Str");
  filter.setValue1("String_Node_Str");
  filter.setValue2("String_Node_Str");
  table.getPropertyHandle(ListHandle.FILTER_PROP).addItem(filter);
  save();
  assertTrue(compareFile("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Supports the misc setting expression methods.
 * @throws Exception
 */
public void testBoundColumnWriterNoExpression() throws Exception {
  createDesign();
  design.getVersionManager().setVersion("String_Node_Str");
  DataItemHandle data=designHandle.getElementFactory().newDataItem("String_Node_Str");
  data.setTocExpression("String_Node_Str");
  data.setValueExpr("String_Node_Str");
  TableHandle table=designHandle.getElementFactory().newTableItem("String_Node_Str",2);
  table.getCell(TableHandle.HEADER_SLOT,-1,1,1).getContent().add(data);
  designHandle.getBody().add(table);
  FilterCondition filter=new FilterCondition();
  filter.setExpr("String_Node_Str");
  filter.setValue1("String_Node_Str");
  filter.setValue2("String_Node_Str");
  table.getPropertyHandle(ListHandle.FILTER_PROP).addItem(filter);
  save();
  assertTrue(compareDesignModel("String_Node_Str",new String[]{"String_Node_Str"}));
}
Program: 64933
Project: 64933
Buggy source:
/** 
 * Supports the misc setting expression methods.
 * @throws Exception
 */
public void testBoundColumnWithGroup() throws Exception {
  createDesign();
  TableHandle table=designHandle.getElementFactory().newTableItem("String_Node_Str",3);
  designHandle.getBody().add(table);
  TableGroupHandle group=designHandle.getElementFactory().newTableGroup();
  group.getFooter().add(designHandle.getElementFactory().newTableRow(3));
  table.getGroups().add(group);
  group=designHandle.getElementFactory().newTableGroup();
  group.getFooter().add(designHandle.getElementFactory().newTableRow(3));
  table.getGroups().add(group);
  DataItemHandle data=designHandle.getElementFactory().newDataItem("String_Node_Str");
  data.setValueExpr("String_Node_Str");
  table.getCell(GroupHandle.FOOTER_SLOT,2,1,1).getContent().add(data);
  data=designHandle.getElementFactory().newDataItem("String_Node_Str");
  data.setValueExpr("String_Node_Str");
  table.getCell(GroupHandle.FOOTER_SLOT,1,1,1).getContent().add(data);
  save();
  saveOutputFile("String_Node_Str");
  assertTrue(compareFile("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Supports the misc setting expression methods.
 * @throws Exception
 */
public void testBoundColumnWithGroup() throws Exception {
  createDesign();
  TableHandle table=designHandle.getElementFactory().newTableItem("String_Node_Str",3);
  designHandle.getBody().add(table);
  TableGroupHandle group=designHandle.getElementFactory().newTableGroup();
  group.getFooter().add(designHandle.getElementFactory().newTableRow(3));
  table.getGroups().add(group);
  group=designHandle.getElementFactory().newTableGroup();
  group.getFooter().add(designHandle.getElementFactory().newTableRow(3));
  table.getGroups().add(group);
  DataItemHandle data=designHandle.getElementFactory().newDataItem("String_Node_Str");
  data.setValueExpr("String_Node_Str");
  table.getCell(GroupHandle.FOOTER_SLOT,2,1,1).getContent().add(data);
  data=designHandle.getElementFactory().newDataItem("String_Node_Str");
  data.setValueExpr("String_Node_Str");
  table.getCell(GroupHandle.FOOTER_SLOT,1,1,1).getContent().add(data);
  save();
  saveOutputFile("String_Node_Str");
  assertTrue(compareDesignModel("String_Node_Str",new String[]{"String_Node_Str"}));
}
Program: 64934
Project: 64934
Buggy source:
@Override public void drawLine(LineRenderEvent lre) throws ChartException {
  if (iv != null) {
    iv.modifyEvent(lre);
  }
  final LineAttributes lia=lre.getLineAttributes();
  if (!validateLineAttributes(lre.getSource(),lia) || lia.getColor() == null) {
    return;
  }
  if (lia.getColor().isSetTransparency() && lia.getColor().getTransparency() == 0) {
    return;
  }
  final Location loStart=lre.getStart();
  final Location loEnd=lre.getEnd();
  Stroke sPrevious=null, sCurrent=getCachedStroke(lia);
  if (sCurrent != null) {
    sPrevious=_g2d.getStroke();
    _g2d.setStroke(sCurrent);
  }
  _g2d.setColor((Color)_ids.getColor(lia.getColor()));
  _g2d.draw(new Line2D.Double(loStart.getX(),loStart.getY(),loEnd.getX(),loEnd.getY()));
  if (sPrevious != null) {
    _g2d.setStroke(sPrevious);
  }
}

Fixed version (ground truth):
@Override public void drawLine(LineRenderEvent lre) throws ChartException {
  if (iv != null) {
    iv.modifyEvent(lre);
  }
  final LineAttributes lia=lre.getLineAttributes();
  if (!validateLineAttributes(lre.getSource(),lia) || lia.getColor() == null) {
    return;
  }
  if (lia.getColor().isSetTransparency() && lia.getColor().getTransparency() == 0) {
    return;
  }
  final Location loStart=lre.getStart();
  final Location loEnd=lre.getEnd();
  if (!checkValidLocation(loStart) || !checkValidLocation(loEnd)) {
    return;
  }
  Stroke sPrevious=null, sCurrent=getCachedStroke(lia);
  if (sCurrent != null) {
    sPrevious=_g2d.getStroke();
    _g2d.setStroke(sCurrent);
  }
  _g2d.setColor((Color)_ids.getColor(lia.getColor()));
  _g2d.draw(new Line2D.Double(loStart.getX(),loStart.getY(),loEnd.getX(),loEnd.getY()));
  if (sPrevious != null) {
    _g2d.setStroke(sPrevious);
  }
}
Program: 64935
Project: 64935
Buggy source:
protected QueryDefinition constructQuery(DataSetHandle dataset,DataRequestSession session) throws BirtException {
  QueryDefinition query=super.constructQuery(dataset,session);
  query.getBindings().clear();
  PropertyHandle propertyHandle=dataset.getPropertyHandle(DataSetHandle.PARAMETERS_PROP);
  int paramsSize=propertyHandle.getListValue().size();
  Iterator paramIter=propertyHandle.iterator();
  for (int n=1; n <= paramsSize; n++) {
    DataSetParameterHandle paramDefn=(DataSetParameterHandle)paramIter.next();
    if (!paramDefn.isOutput())     continue;
    String bindingName=paramDefn.getName();
    IBinding binding=new Binding(bindingName);
    binding.setExpression(new ScriptExpression(PREFIX_OUTPUTPARAMETER + "String_Node_Str" + paramDefn.getName()+ "String_Node_Str"));
    binding.setDataType(DataAdapterUtil.adaptModelDataType(paramDefn.getDataType()));
    query.addBinding(binding);
  }
  return query;
}

Fixed version (ground truth):
protected QueryDefinition constructQuery(DataSetHandle dataset,DataRequestSession session) throws BirtException {
  QueryDefinition query=super.constructQuery(dataset);
  query.getBindings().clear();
  PropertyHandle propertyHandle=dataset.getPropertyHandle(DataSetHandle.PARAMETERS_PROP);
  int paramsSize=propertyHandle.getListValue().size();
  Iterator paramIter=propertyHandle.iterator();
  for (int n=1; n <= paramsSize; n++) {
    DataSetParameterHandle paramDefn=(DataSetParameterHandle)paramIter.next();
    if (!paramDefn.isOutput())     continue;
    String bindingName=paramDefn.getName();
    IBinding binding=new Binding(bindingName);
    binding.setExpression(new ScriptExpression(PREFIX_OUTPUTPARAMETER + "String_Node_Str" + paramDefn.getName()+ "String_Node_Str"));
    binding.setDataType(DataAdapterUtil.adaptModelDataType(paramDefn.getDataType()));
    query.addBinding(binding);
  }
  return query;
}
Program: 64936
Project: 64936
Buggy source:
public void cancel(Object signal){
}

Fixed version (ground truth):
@Override public void cancel(String reason){
}
Program: 64937
Project: 64937
Buggy source:
public static QueryDefinition cloneQuery(QueryDefinition query){
  if (query == null) {
    return null;
  }
  IBaseQueryDefinition parent=query.getParentQuery();
  QueryDefinition newQuery=null;
  if (parent instanceof BaseQueryDefinition) {
    newQuery=new QueryDefinition((BaseQueryDefinition)parent);
  }
 else {
    newQuery=new QueryDefinition();
  }
  newQuery.getBindings().putAll(query.getBindings());
  newQuery.getFilters().addAll(query.getFilters());
  newQuery.getSorts().addAll(query.getSorts());
  newQuery.getSubqueries().addAll(query.getSubqueries());
  newQuery.getGroups().addAll(query.getGroups());
  newQuery.setUsesDetails(query.usesDetails());
  newQuery.setMaxRows(query.getMaxRows());
  newQuery.setDataSetName(query.getDataSetName());
  newQuery.setAutoBinding(query.needAutoBinding());
  newQuery.setColumnProjection(query.getColumnProjection());
  newQuery.setName(query.getName());
  newQuery.setIsSummaryQuery(query.isSummaryQuery());
  newQuery.setQueryExecutionHints(query.getQueryExecutionHints());
  return newQuery;
}

Fixed version (ground truth):
public static QueryDefinition cloneQuery(QueryDefinition query){
  if (query == null) {
    return null;
  }
  IBaseQueryDefinition parent=query.getParentQuery();
  QueryDefinition newQuery=null;
  if (parent instanceof BaseQueryDefinition) {
    newQuery=new QueryDefinition((BaseQueryDefinition)parent,query.needAutoBinding());
  }
 else {
    newQuery=new QueryDefinition(query.needAutoBinding());
  }
  newQuery.getBindings().putAll(query.getBindings());
  newQuery.getFilters().addAll(query.getFilters());
  newQuery.getSorts().addAll(query.getSorts());
  newQuery.getSubqueries().addAll(query.getSubqueries());
  newQuery.getGroups().addAll(query.getGroups());
  newQuery.setUsesDetails(query.usesDetails());
  newQuery.setMaxRows(query.getMaxRows());
  newQuery.setDataSetName(query.getDataSetName());
  newQuery.setColumnProjection(query.getColumnProjection());
  newQuery.setName(query.getName());
  newQuery.setIsSummaryQuery(query.isSummaryQuery());
  newQuery.setQueryExecutionHints(query.getQueryExecutionHints());
  return newQuery;
}
Program: 64939
Project: 64939
Buggy source:
/** 
 * @param projectedColumns
 */
private void initColumnsInfo(List projectedColumns){
  m_fieldCount=projectedColumns.size();
  projectedCols=new ResultFieldMetadata[m_fieldCount];
  nameToIdMapping=new HashMap();
  this.originalAnyTypeField=new ArrayList();
  for (int i=0, n=projectedColumns.size(); i < n; i++) {
    projectedCols[i]=(ResultFieldMetadata)projectedColumns.get(i);
    ResultFieldMetadata column=projectedCols[i];
    if (isOfAnyType(column)) {
      this.hasAny=true;
      this.originalAnyTypeField.add(Integer.valueOf(i + 1));
    }
    String upperCaseName=column.getName();
    Integer index=Integer.valueOf(i + 1);
    if (!nameToIdMapping.containsKey(upperCaseName)) {
      nameToIdMapping.put(upperCaseName,index);
    }
    String upperCaseAlias=column.getAlias();
    if (upperCaseAlias != null && upperCaseAlias.length() > 0 && !nameToIdMapping.containsKey(upperCaseAlias)) {
      nameToIdMapping.put(upperCaseAlias,index);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param projectedColumns
 */
private void initColumnsInfo(List projectedColumns){
  m_fieldCount=projectedColumns.size();
  projectedCols=new ResultFieldMetadata[m_fieldCount];
  nameToIdMapping=new HashMap();
  this.originalAnyTypeField=new ArrayList();
  for (int i=0, n=projectedColumns.size(); i < n; i++) {
    projectedCols[i]=(ResultFieldMetadata)projectedColumns.get(i);
    ResultFieldMetadata column=projectedCols[i];
    if (isOfAnyType(column)) {
      this.hasAny=true;
      this.originalAnyTypeField.add(Integer.valueOf(i + 1));
    }
    String upperCaseName=column.getName();
    Integer index=Integer.valueOf(i + 1);
    if (!nameToIdMapping.containsKey(upperCaseName)) {
      nameToIdMapping.put(upperCaseName,index);
    }
    String upperCaseAlias=column.getAlias();
    if (upperCaseAlias != null && upperCaseAlias.length() > 0 && !nameToIdMapping.containsKey(upperCaseAlias)) {
      nameToIdMapping.put(upperCaseAlias,index);
    }
  }
  for (int i=0; i < projectedCols.length; i++) {
    String JDBCAlias=projectedCols[i].getLabel();
    if (!nameToIdMapping.containsKey(JDBCAlias))     nameToIdMapping.put(JDBCAlias,Integer.valueOf(i + 1));
  }
}
Program: 64940
Project: 64940
Buggy source:
/** 
 * Populate all valid data set column names and alias.
 * @return
 * @throws DataException
 */
private Set populateValidDataSetColumnNameSet() throws DataException {
  Set validDataSetColumnNames=new HashSet();
  for (int i=1; i <= this.odiResult.getResultClass().getFieldCount(); i++) {
    validDataSetColumnNames.add(this.odiResult.getResultClass().getFieldName(i));
    validDataSetColumnNames.add(this.odiResult.getResultClass().getFieldAlias(i));
  }
  return validDataSetColumnNames;
}

Fixed version (ground truth):
/** 
 * Populate all valid data set column names and alias.
 * @return
 * @throws DataException
 */
private Set populateValidDataSetColumnNameSet() throws DataException {
  Set validDataSetColumnNames=new HashSet();
  IResultClass rc=this.odiResult.getResultClass();
  for (int i=1; i <= rc.getFieldCount(); i++) {
    validDataSetColumnNames.add(rc.getFieldName(i));
    if (rc.getFieldAlias(i) != null)     validDataSetColumnNames.add(rc.getFieldAlias(i));
    if (rc.getFieldLabel(i) != null)     validDataSetColumnNames.add(rc.getFieldLabel(i));
  }
  return validDataSetColumnNames;
}
Program: 64941
Project: 64941
Buggy source:
void addHint(ColumnHint columnHint) throws DataException {
  final String methodName="String_Node_Str";
  sm_logger.entering(sm_className,methodName,columnHint);
  assert(columnHint != null);
  int columnPosition=columnHint.getPosition();
  if (columnPosition > 0 && columnPosition <= m_columns.size()) {
    int driverIndex=columnPosition - 1;
    ResultFieldMetadata fieldMD=(ResultFieldMetadata)m_columns.get(driverIndex);
    String columnHintAlias=columnHint.getAlias();
    if (columnHintAlias != null)     validateNewNameOrAlias(columnHintAlias,driverIndex);
    String newColumnName=columnHint.getName();
    if (newColumnName != null && newColumnName.length() > 0) {
      validateNewNameOrAlias(newColumnName,driverIndex);
      fieldMD.setName(newColumnName);
    }
    updateFieldDataTypeAndAlias(fieldMD,columnHint,driverIndex);
  }
 else {
    String columnHintName=columnHint.getName();
    for (int i=0, n=m_columns.size(); i < n; i++) {
      ResultFieldMetadata fieldMD=(ResultFieldMetadata)m_columns.get(i);
      if (fieldMD.getName().equals(columnHintName)) {
        updateFieldDataTypeAndAlias(fieldMD,columnHint,i);
      }
    }
  }
  doGetColumnHints().add(columnHint);
  sm_logger.exiting(sm_className,methodName);
}

Fixed version (ground truth):
void addHint(ColumnHint columnHint) throws DataException {
  final String methodName="String_Node_Str";
  sm_logger.entering(sm_className,methodName,columnHint);
  assert(columnHint != null);
  int columnPosition=columnHint.getPosition();
  if (columnPosition > 0 && columnPosition <= m_columns.size()) {
    int driverIndex=columnPosition - 1;
    ResultFieldMetadata fieldMD=(ResultFieldMetadata)m_columns.get(driverIndex);
    String columnHintAlias=columnHint.getAlias();
    if (columnHintAlias != null)     validateNewNameOrAlias(columnHintAlias,driverIndex);
    String newColumnName=columnHint.getName();
    if (newColumnName != null && newColumnName.length() > 0) {
      fieldMD.setName(newColumnName);
    }
    updateFieldDataTypeAndAlias(fieldMD,columnHint,driverIndex);
  }
 else {
    String columnHintName=columnHint.getName();
    for (int i=0, n=m_columns.size(); i < n; i++) {
      ResultFieldMetadata fieldMD=(ResultFieldMetadata)m_columns.get(i);
      if (fieldMD.getName().equals(columnHintName)) {
        updateFieldDataTypeAndAlias(fieldMD,columnHint,i);
      }
    }
  }
  doGetColumnHints().add(columnHint);
  sm_logger.exiting(sm_className,methodName);
}
Program: 64942
Project: 64942
Buggy source:
protected QueryDefinition constructQuery(DataSetHandle dataset) throws DataException {
  QueryDefinition query=super.constructQuery(dataset);
  PropertyHandle propertyHandle=dataset.getPropertyHandle(DataSetHandle.PARAMETERS_PROP);
  int paramsSize=propertyHandle.getListValue().size();
  Iterator paramIter=propertyHandle.iterator();
  for (int n=1; n <= paramsSize; n++) {
    DataSetParameterHandle paramDefn=(DataSetParameterHandle)paramIter.next();
    if (!paramDefn.isOutput())     continue;
    String bindingName=paramDefn.getName();
    IBinding binding=new Binding(bindingName);
    binding.setExpression(new ScriptExpression(PREFIX_OUTPUTPARAMETER + "String_Node_Str" + paramDefn.getName()+ "String_Node_Str"));
    binding.setDataType(DataAdapterUtil.adaptModelDataType(paramDefn.getDataType()));
    query.addBinding(binding);
  }
  return query;
}

Fixed version (ground truth):
protected QueryDefinition constructQuery(DataSetHandle dataset,DataRequestSession session) throws BirtException {
  QueryDefinition query=super.constructQuery(dataset,session);
  PropertyHandle propertyHandle=dataset.getPropertyHandle(DataSetHandle.PARAMETERS_PROP);
  int paramsSize=propertyHandle.getListValue().size();
  Iterator paramIter=propertyHandle.iterator();
  for (int n=1; n <= paramsSize; n++) {
    DataSetParameterHandle paramDefn=(DataSetParameterHandle)paramIter.next();
    if (!paramDefn.isOutput())     continue;
    String bindingName=paramDefn.getName();
    IBinding binding=new Binding(bindingName);
    binding.setExpression(new ScriptExpression(PREFIX_OUTPUTPARAMETER + "String_Node_Str" + paramDefn.getName()+ "String_Node_Str"));
    binding.setDataType(DataAdapterUtil.adaptModelDataType(paramDefn.getDataType()));
    query.addBinding(binding);
  }
  return query;
}
Program: 64943
Project: 64943
Buggy source:
public Object getSummaryValue(){
  return sum;
}

Fixed version (ground truth):
public Object getSummaryValue(){
  return Double.valueOf(sum.doubleValue());
}
Program: 64945
Project: 64945
Buggy source:
/** 
 * Reset year units for this datetime instance above a specified unit.
 * @param iUnit The unit above which year values are to be reset
 * @param always indicates if it's always trimmed no matter if it's full date time
 */
public final void clearAbove(int iUnit,boolean always){
  if (!always && isFullDateTime()) {
    return;
  }
  if (iUnit == YEAR) {
    return;
  }
 else   if (iUnit == MONTH || iUnit == GroupingUnitType.QUARTERS) {
    set(Calendar.YEAR,2000);
  }
 else   if (iUnit == DATE) {
    set(Calendar.YEAR,2000);
  }
 else   if (iUnit == WEEK_OF_YEAR) {
    set(Calendar.YEAR,2000);
  }
  return;
}

Fixed version (ground truth):
/** 
 * Reset year units for this datetime instance above a specified unit.
 * @param iUnit The unit above which year values are to be reset
 * @param always indicates if it's always trimmed no matter if it's full date time
 */
public final void clearAbove(int iUnit,boolean always){
  if (!always && isFullDateTime()) {
    return;
  }
  if (iUnit == YEAR) {
    return;
  }
 else   if (iUnit == MONTH || iUnit == QUARTER) {
    set(Calendar.YEAR,2000);
  }
 else   if (iUnit == DATE || iUnit == DAY_OF_MONTH || iUnit == DAY_OF_WEEK || iUnit == DAY_OF_YEAR) {
    set(Calendar.YEAR,2000);
  }
 else   if (iUnit == WEEK_OF_YEAR || iUnit == WEEK_OF_MONTH) {
    set(Calendar.YEAR,2000);
  }
  return;
}
Program: 64946
Project: 64946
Buggy source:
/** 
 * @param subquery Subquery definition
 * @param parentQuery Parent query (which can be a subquery itself, or a PreparedReportQuery)
 * @param groupLevel Index of group in which this subquery is defined within the parent query. If 0, subquery is defined outside of any groups.
 * @throws DataException
 */
PreparedSubquery(DataEngineSession session,DataEngineContext context,ISubqueryDefinition subquery,IPreparedQueryService queryService,int groupLevel) throws DataException {
  Object[] params={session,context,subquery,queryService,Integer.valueOf(groupLevel)};
  logger.entering(PreparedSubquery.class.getName(),"String_Node_Str",params);
  this.groupLevel=groupLevel;
  this.queryService=queryService;
  this.subQueryOnGroup=subquery.applyOnGroup();
  logger.logp(Level.FINER,PreparedSubquery.class.getName(),"String_Node_Str","String_Node_Str");
  this.session=session;
  this.preparedQuery=new PreparedQuery(session,context,subquery,this,null);
  logger.exiting(PreparedSubquery.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param subquery Subquery definition
 * @param parentQuery Parent query (which can be a subquery itself, or a PreparedReportQuery)
 * @param groupLevel Index of group in which this subquery is defined within the parent query. If 0, subquery is defined outside of any groups.
 * @throws DataException
 */
PreparedSubquery(DataEngineSession session,DataEngineContext context,ISubqueryDefinition subquery,IPreparedQueryService queryService,int groupLevel) throws DataException {
  Object[] params={session,context,subquery,queryService,Integer.valueOf(groupLevel)};
  logger.entering(PreparedSubquery.class.getName(),"String_Node_Str",params);
  this.groupLevel=groupLevel;
  this.queryService=queryService;
  this.subQueryOnGroup=subquery.applyOnGroup();
  logger.logp(Level.FINER,PreparedSubquery.class.getName(),"String_Node_Str","String_Node_Str");
  this.session=session;
  this.preparedQuery=new PreparedQuery(session,context,subquery,this,queryService.getDataSourceQuery().appContext);
  logger.exiting(PreparedSubquery.class.getName(),"String_Node_Str");
}
Program: 64947
Project: 64947
Buggy source:
public Object getSummaryValue(){
  return Double.valueOf(sum.doubleValue());
}

Fixed version (ground truth):
public Object getSummaryValue(){
  return sum;
}
Program: 64948
Project: 64948
Buggy source:
private double translateCoor(double d){
  return d / dpi * 72d;
}

Fixed version (ground truth):
private double translateCoor(double d){
  return d / dpi * 96d;
}
Program: 64949
Project: 64949
Buggy source:
public String getImageMap(){
  return new ImageMapEmitter(getShapeActions(),_bAltEnabled,getULocale()).getImageMap();
}

Fixed version (ground truth):
public String getImageMap(){
  return new ImageMapEmitter(getShapeActions(),_bAltEnabled,getULocale(),getDisplayServer().getDpiResolution()).getImageMap();
}
Program: 64955
Project: 64955
Buggy source:
/** 
 * @throws IOException
 */
abstract protected void saveToDisk(int fromIndex,int toIndex) throws IOException ;

Fixed version (ground truth):
/** 
 * @throws IOException
 */
protected void saveToDisk(int fromIndex,int toIndex) throws IOException {
  throw new UnsupportedOperationException();
}
Program: 64956
Project: 64956
Buggy source:
/** 
 * @param o
 * @return
 * @throws IOException
 */
public void push(Object o) throws IOException {
  if (bufferPos < buffer.length) {
    buffer[bufferPos]=o;
    bufferPos++;
  }
 else   if (useMemoryOnly) {
    Object tempBuffer[]=new Object[buffer.length * 2];
    System.arraycopy(buffer,0,tempBuffer,0,buffer.length);
    buffer=tempBuffer;
    buffer[bufferPos]=o;
    bufferPos++;
  }
 else {
    sort(buffer);
    if (forceDistinct) {
      int endIndex=removeDuplicated(buffer);
      saveToDisk(0,endIndex);
    }
 else {
      saveToDisk(0,buffer.length - 1);
    }
    buffer[0]=o;
    bufferPos=1;
  }
  size++;
}

Fixed version (ground truth):
/** 
 * @param o
 * @return
 * @throws IOException
 */
public void push(Object o) throws IOException {
  if (bufferPos < buffer.length) {
    buffer[bufferPos]=o;
    bufferPos++;
  }
 else   if (useMemoryOnly) {
    Object tempBuffer[]=new Object[buffer.length * 2];
    System.arraycopy(buffer,0,tempBuffer,0,buffer.length);
    buffer=tempBuffer;
    buffer[bufferPos]=o;
    bufferPos++;
  }
 else {
    sort(buffer);
    if (this.segments.size() < MAX_NUMBER_OF_SEGMENT) {
      int endIndex=buffer.length - 1;
      if (forceDistinct) {
        endIndex=removeDuplicated(buffer);
      }
      saveToDisk(0,endIndex);
    }
 else {
      BaseDiskSortedStack temp=new BaseDiskSortedStack(this.forceDistinct,segments,this.comparator,this.buffer,this.bufferPos);
      BaseDiskArray diskArray=this.creator == null ? new PrimitiveDiskArray() : new StructureDiskArray(this.creator);
      Object next=null;
      while ((next=temp.pop()) != null) {
        diskArray.add(next);
      }
      temp.close();
      this.segments.clear();
      this.segments.add(diskArray);
    }
    buffer[0]=o;
    bufferPos=1;
  }
  size++;
}
Program: 64957
Project: 64957
Buggy source:
/** 
 * @param bufferSize
 * @param forceDistinct
 * @param comparator
 */
public BaseDiskSortedStack(int bufferSize,boolean forceDistinct,Comparator comparator){
  if (bufferSize <= 0) {
    buffer=new Object[DEFAULT_BUFFER_SIZE];
  }
 else {
    buffer=new Object[bufferSize];
  }
  segments=new ArrayList();
  this.comparator=comparator;
  this.forceDistinct=forceDistinct;
  mValueIndex=new ValueIndex(null,0,comparator);
  this.size=0;
}

Fixed version (ground truth):
private BaseDiskSortedStack(boolean forceDistinct,List segments,Comparator comparator,Object[] buffer,int bufferPos){
  this.forceDistinct=forceDistinct;
  this.segments=segments;
  this.comparator=comparator;
  this.buffer=buffer;
  this.bufferPos=bufferPos;
  this.mValueIndex=new ValueIndex(null,0,comparator);
}
Program: 64958
Project: 64958
Buggy source:
public DiskSortedStack(int bufferSize,boolean forceDistinct,Comparator comparator,IStructureCreator creator){
  super(bufferSize,forceDistinct,comparator);
  this.creator=creator;
}

Fixed version (ground truth):
public DiskSortedStack(int bufferSize,boolean forceDistinct,Comparator comparator,IStructureCreator creator){
  super(bufferSize,forceDistinct,comparator,creator);
  this.creator=creator;
}