nus-yam/ex-repair huggingface dataset:
Program: 73905
Project: 73905
Buggy source:
/** 
 * Remember before requesting any service, this function must be called in advance to make sure using current data source and data set.
 * @param dataSourceDesign
 * @param datasetDesign
 */
public void setDataSourceAndDataSet(IBaseDataSourceDesign dataSourceDesign,IBaseDataSetDesign dataSetDesign,Collection parameterHints,Map appContext){
  this.dataSourceDesign=dataSourceDesign;
  this.dataSetDesign=dataSetDesign;
  this.parameterHints=parameterHints;
  this.appContext=appContext;
  setRowFetchLimit();
}

Fixed version (ground truth):
/** 
 * Remember before requesting any service, this function must be called in advance to make sure using current data source and data set.
 * @param dataSourceDesign
 * @param datasetDesign
 */
public void setDataSourceAndDataSet(IBaseDataSourceDesign dataSourceDesign,IBaseDataSetDesign dataSetDesign,Collection parameterHints,Map appContext){
  this.dataSourceDesign=dataSourceDesign;
  this.dataSetDesign=dataSetDesign;
  this.parameterHints=parameterHints;
  this.appContext=appContext;
}
Program: 73907
Project: 73907
Buggy source:
public final int getDpiResolution(){
  if (iDpiResolution == 0) {
switch (getGraphicsContext().getDeviceConfiguration().getDevice().getType()) {
case GraphicsDevice.TYPE_RASTER_SCREEN:
      if (GraphicsEnvironment.isHeadless()) {
        iDpiResolution=super.getDpiResolution();
      }
 else {
        iDpiResolution=Toolkit.getDefaultToolkit().getScreenResolution();
      }
    break;
case GraphicsDevice.TYPE_PRINTER:
  iDpiResolution=72;
break;
case GraphicsDevice.TYPE_IMAGE_BUFFER:
if (userResolution == 0) {
iDpiResolution=Toolkit.getDefaultToolkit().getScreenResolution();
}
 else {
iDpiResolution=userResolution;
}
break;
}
if (iDpiResolution >= 192) {
_g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_ON);
}
 else {
_g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
}
}
return iDpiResolution;
}

Fixed version (ground truth):
public final int getDpiResolution(){
  if (iDpiResolution == 0) {
switch (getGraphicsContext().getDeviceConfiguration().getDevice().getType()) {
case GraphicsDevice.TYPE_RASTER_SCREEN:
      iDpiResolution=computeScreenDpi();
    break;
case GraphicsDevice.TYPE_PRINTER:
  iDpiResolution=72;
break;
case GraphicsDevice.TYPE_IMAGE_BUFFER:
iDpiResolution=computeScreenDpi();
break;
}
if (iDpiResolution >= 192) {
_g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_ON);
}
 else {
_g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
}
}
return iDpiResolution;
}
Program: 73909
Project: 73909
Buggy source:
protected TableContent createTableContent(){
  TableContent content=new TableContent(reportContent);
  content.setCaption("String_Node_Str");
  content.setCaptionKey("String_Node_Str");
  content.setHeaderRepeat(true);
  Column column1=new Column(reportContent);
  column1.setWidth(new DimensionType(1,"String_Node_Str"));
  content.addColumn(column1);
  Column column2=new Column(reportContent);
  column2.setWidth(new DimensionType(2,"String_Node_Str"));
  content.addColumn(column2);
  return content;
}

Fixed version (ground truth):
protected TableContent createTableContent(){
  TableContent content=(TableContent)reportContent.createTableContent();
  content.setCaption("String_Node_Str");
  content.setCaptionKey("String_Node_Str");
  content.setHeaderRepeat(true);
  Column column1=new Column(reportContent);
  column1.setWidth(new DimensionType(1,"String_Node_Str"));
  content.addColumn(column1);
  Column column2=new Column(reportContent);
  column2.setWidth(new DimensionType(2,"String_Node_Str"));
  content.addColumn(column2);
  return content;
}
Program: 73910
Project: 73910
Buggy source:
protected TableBandContent createTableBandContent(){
  TableBandContent content=new TableBandContent(reportContent);
  content.setBandType(100);
  return content;
}

Fixed version (ground truth):
protected TableBandContent createTableBandContent(){
  TableBandContent content=(TableBandContent)reportContent.createTableBandContent();
  content.setBandType(100);
  return content;
}
Program: 73911
Project: 73911
Buggy source:
protected CellContent createCellContent(){
  CellContent content=new CellContent(reportContent);
  content.setName("String_Node_Str");
  content.setWidth(new DimensionType(100,"String_Node_Str"));
  content.setHeight(new DimensionType("String_Node_Str"));
  ActionContent hyperlink=new ActionContent();
  hyperlink.setHyperlink("String_Node_Str","String_Node_Str");
  Map attr=new HashMap();
  attr.put("String_Node_Str","String_Node_Str");
  hyperlink.setDrillThrough("String_Node_Str",true,"String_Node_Str",attr,attr,"String_Node_Str","String_Node_Str",null);
  content.setHyperlinkAction(hyperlink);
  content.setRowSpan(10);
  content.setColSpan(11);
  content.setColumn(12);
  return content;
}

Fixed version (ground truth):
protected CellContent createCellContent(){
  CellContent content=(CellContent)reportContent.createCellContent();
  content.setName("String_Node_Str");
  content.setWidth(new DimensionType(100,"String_Node_Str"));
  content.setHeight(new DimensionType("String_Node_Str"));
  ActionContent hyperlink=new ActionContent();
  hyperlink.setHyperlink("String_Node_Str","String_Node_Str");
  Map attr=new HashMap();
  attr.put("String_Node_Str","String_Node_Str");
  hyperlink.setDrillThrough("String_Node_Str",true,"String_Node_Str",attr,attr,"String_Node_Str","String_Node_Str",null);
  content.setHyperlinkAction(hyperlink);
  content.setRowSpan(10);
  content.setColSpan(11);
  content.setColumn(12);
  return content;
}
Program: 73912
Project: 73912
Buggy source:
protected ForeignContent createForeignContent(){
  ForeignContent content=new ForeignContent(reportContent);
  content.setRawType("String_Node_Str");
  content.setRawValue(null);
  return content;
}

Fixed version (ground truth):
protected ForeignContent createForeignContent(){
  ForeignContent content=(ForeignContent)reportContent.createForeignContent();
  content.setRawType("String_Node_Str");
  content.setRawValue(null);
  return content;
}
Program: 73913
Project: 73913
Buggy source:
protected RowContent createRowContent(){
  RowContent content=new RowContent(reportContent);
  content.setRowID(100);
  return content;
}

Fixed version (ground truth):
protected RowContent createRowContent(){
  RowContent content=(RowContent)reportContent.createRowContent();
  content.setRowID(100);
  return content;
}
Program: 73914
Project: 73914
Buggy source:
protected PageContent createPageContent(){
  PageContent content=new PageContent(reportContent);
  content.setPageType("String_Node_Str");
  content.setPageHeight(new DimensionType(3,"String_Node_Str"));
  content.setPageNumber(100);
  return content;
}

Fixed version (ground truth):
protected PageContent createPageContent(){
  PageContent content=(PageContent)reportContent.createPageContent();
  content.setPageType("String_Node_Str");
  content.setPageHeight(new DimensionType(3,"String_Node_Str"));
  content.setPageNumber(100);
  return content;
}
Program: 73915
Project: 73915
Buggy source:
protected DataContent createDataContent(){
  DataContent content=new DataContent(reportContent);
  content.setValue(null);
  content.setLabelText("String_Node_Str");
  content.setLabelKey("String_Node_Str");
  content.getHelpKey();
  return content;
}

Fixed version (ground truth):
protected DataContent createDataContent(){
  DataContent content=(DataContent)reportContent.createDataContent();
  content.setValue(null);
  content.setLabelText("String_Node_Str");
  content.setLabelKey("String_Node_Str");
  content.getHelpKey();
  return content;
}
Program: 73916
Project: 73916
Buggy source:
protected ImageContent createImageContent(){
  ImageContent content=new ImageContent(reportContent);
  content.setAltText("String_Node_Str");
  content.setAltTextKey("String_Node_Str");
  content.setImageSource(1);
  return content;
}

Fixed version (ground truth):
protected ImageContent createImageContent(){
  ImageContent content=(ImageContent)reportContent.createImageContent();
  content.setAltText("String_Node_Str");
  content.setAltTextKey("String_Node_Str");
  content.setImageSource(1);
  return content;
}
Program: 73917
Project: 73917
Buggy source:
protected LabelContent createLabelContent(){
  LabelContent content=new LabelContent(reportContent);
  content.setLabelText("String_Node_Str");
  content.setLabelKey("String_Node_Str");
  return content;
}

Fixed version (ground truth):
protected LabelContent createLabelContent(){
  LabelContent content=(LabelContent)reportContent.createLabelContent();
  content.setLabelText("String_Node_Str");
  content.setLabelKey("String_Node_Str");
  return content;
}
Program: 73919
Project: 73919
Buggy source:
protected ContainerContent createContainerContent(){
  ContainerContent content=new ContainerContent(reportContent);
  content.setName("String_Node_Str");
  content.setHeight(new DimensionType(4,"String_Node_Str"));
  ActionContent hyperlink=new ActionContent();
  hyperlink.setHyperlink("String_Node_Str","String_Node_Str");
  Map attr=new HashMap();
  attr.put("String_Node_Str","String_Node_Str");
  hyperlink.setDrillThrough("String_Node_Str",true,"String_Node_Str",attr,attr,"String_Node_Str","String_Node_Str",null);
  content.setHyperlinkAction(hyperlink);
  return content;
}

Fixed version (ground truth):
protected ContainerContent createContainerContent(){
  ContainerContent content=(ContainerContent)reportContent.createContainerContent();
  content.setName("String_Node_Str");
  content.setHeight(new DimensionType(4,"String_Node_Str"));
  ActionContent hyperlink=new ActionContent();
  hyperlink.setHyperlink("String_Node_Str","String_Node_Str");
  Map attr=new HashMap();
  attr.put("String_Node_Str","String_Node_Str");
  hyperlink.setDrillThrough("String_Node_Str",true,"String_Node_Str",attr,attr,"String_Node_Str","String_Node_Str",null);
  content.setHyperlinkAction(hyperlink);
  return content;
}
Program: 73920
Project: 73920
Buggy source:
protected TextContent createTextContent(){
  TextContent content=new TextContent(reportContent);
  content.setName("String_Node_Str");
  content.setHeight(new DimensionType(10,"String_Node_Str"));
  ActionContent hyperlink=new ActionContent();
  hyperlink.setHyperlink("String_Node_Str","String_Node_Str");
  Map attr=new HashMap();
  attr.put("String_Node_Str","String_Node_Str");
  hyperlink.setDrillThrough("String_Node_Str",true,"String_Node_Str",attr,attr,"String_Node_Str","String_Node_Str",null);
  content.setHyperlinkAction(hyperlink);
  return content;
}

Fixed version (ground truth):
protected TextContent createTextContent(){
  TextContent content=(TextContent)reportContent.createTextContent();
  content.setName("String_Node_Str");
  content.setHeight(new DimensionType(10,"String_Node_Str"));
  ActionContent hyperlink=new ActionContent();
  hyperlink.setHyperlink("String_Node_Str","String_Node_Str");
  Map attr=new HashMap();
  attr.put("String_Node_Str","String_Node_Str");
  hyperlink.setDrillThrough("String_Node_Str",true,"String_Node_Str",attr,attr,"String_Node_Str","String_Node_Str",null);
  content.setHyperlinkAction(hyperlink);
  return content;
}
Program: 73921
Project: 73921
Buggy source:
protected void doSaveCoreStreams() throws Exception {
  RAOutputStream out=null;
  DataOutputStream coreStream=null;
  try {
    out=archive.createRandomAccessStream(CORE_STREAM);
    coreStream=new DataOutputStream(new BufferedOutputStream(out));
    IOUtil.writeString(coreStream,REPORT_DOCUMENT_TAG);
    IOUtil.writeString(coreStream,CORE_VERSION_1);
    IOUtil.writeString(coreStream,REPORT_DOCUMENT_VERSION);
    HashMap properties=new HashMap();
    properties.put(BIRT_ENGINE_VERSION_KEY,BIRT_ENGINE_VERSION);
    properties.put(BIRT_ENGINE_BUILD_NUMBER_KEY,getBuildNumber());
    IOUtil.writeMap(coreStream,properties);
    if (checkpoint != CHECKPOINT_END) {
      checkpoint++;
    }
    IOUtil.writeInt(coreStream,checkpoint);
    IOUtil.writeLong(coreStream,pageCount);
    IOUtil.writeString(coreStream,designName);
    IOUtil.writeMap(coreStream,paramters);
    IOUtil.writeMap(coreStream,globalVariables);
    if (checkpoint == CHECKPOINT_END) {
      writeMap(coreStream,bookmarks);
      TOCBuilder.write(tocTree,coreStream);
      writeMap(coreStream,idToOffset);
      writeMap(coreStream,bookmarkToOffset);
    }
    coreStream.flush();
  }
 catch (  IOException ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
  }
 finally {
    if (out != null) {
      try {
        out.close();
        out=null;
      }
 catch (      Exception ex) {
      }
    }
  }
}

Fixed version (ground truth):
protected void doSaveCoreStreams() throws Exception {
  RAOutputStream out=null;
  DataOutputStream coreStream=null;
  try {
    out=archive.createRandomAccessStream(CORE_STREAM);
    coreStream=new DataOutputStream(new BufferedOutputStream(out));
    IOUtil.writeString(coreStream,REPORT_DOCUMENT_TAG);
    IOUtil.writeString(coreStream,CORE_VERSION_1);
    IOUtil.writeString(coreStream,REPORT_DOCUMENT_VERSION);
    HashMap properties=new HashMap();
    properties.put(PAGE_HINT_VERSION_KEY,PAGE_HINT_VERSION_3);
    properties.put(BIRT_ENGINE_VERSION_KEY,BIRT_ENGINE_VERSION);
    properties.put(BIRT_ENGINE_BUILD_NUMBER_KEY,getBuildNumber());
    IOUtil.writeMap(coreStream,properties);
    if (checkpoint != CHECKPOINT_END) {
      checkpoint++;
    }
    IOUtil.writeInt(coreStream,checkpoint);
    IOUtil.writeLong(coreStream,pageCount);
    IOUtil.writeString(coreStream,designName);
    IOUtil.writeMap(coreStream,paramters);
    IOUtil.writeMap(coreStream,globalVariables);
    if (checkpoint == CHECKPOINT_END) {
      writeMap(coreStream,bookmarks);
      TOCBuilder.write(tocTree,coreStream);
      writeMap(coreStream,idToOffset);
      writeMap(coreStream,bookmarkToOffset);
    }
    coreStream.flush();
  }
 catch (  IOException ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
  }
 finally {
    if (out != null) {
      try {
        out.close();
        out=null;
      }
 catch (      Exception ex) {
      }
    }
  }
}
Program: 73922
Project: 73922
Buggy source:
public AbstractBandContent(IReportContent report){
  super(report);
}

Fixed version (ground truth):
AbstractBandContent(IReportContent report){
  super(report);
}
Program: 73923
Project: 73923
Buggy source:
/** 
 * Constructor of the AbstractContent
 * @param content content can't be null
 */
public AbstractContent(IContent content){
  this.report=content.getReportContent();
  this.parent=content.getReportContent().getRoot();
  this.cssEngine=((ReportContent)content.getReportContent()).getCSSEngine();
  this.name=content.getName();
  this.x=content.getX();
  this.y=content.getY();
  this.width=content.getWidth();
  this.height=content.getHeight();
  this.hyperlink=content.getHyperlinkAction();
  this.bookmark=content.getBookmark();
  this.helpText=content.getHelpText();
  this.inlineStyle=content.getInlineStyle();
  this.generateBy=content.getGenerateBy();
  this.styleClass=content.getStyleClass();
  this.instanceId=content.getInstanceID();
  this.toc=content.getTOC();
  Object ext=content.getExtension(IContent.DOCUMENT_EXTENSION);
  if (ext != null) {
    setExtension(IContent.DOCUMENT_EXTENSION,ext);
  }
}

Fixed version (ground truth):
/** 
 * Constructor of the AbstractContent
 * @param content content can't be null
 */
AbstractContent(IContent content){
  this.report=content.getReportContent();
  this.parent=content.getReportContent().getRoot();
  this.cssEngine=((ReportContent)content.getReportContent()).getCSSEngine();
  this.name=content.getName();
  this.x=content.getX();
  this.y=content.getY();
  this.width=content.getWidth();
  this.height=content.getHeight();
  this.hyperlink=content.getHyperlinkAction();
  this.bookmark=content.getBookmark();
  this.helpText=content.getHelpText();
  this.inlineStyle=copyInlineStyle(content);
  this.generateBy=content.getGenerateBy();
  this.styleClass=content.getStyleClass();
  this.instanceId=content.getInstanceID();
  this.toc=content.getTOC();
  Object ext=content.getExtension(IContent.DOCUMENT_EXTENSION);
  if (ext != null) {
    setExtension(IContent.DOCUMENT_EXTENSION,ext);
  }
  ext=content.getExtension(IContent.LAYOUT_EXTENSION);
  if (ext != null) {
    setExtension(IContent.LAYOUT_EXTENSION,ext);
  }
}
Program: 73925
Project: 73925
Buggy source:
public boolean endLine(){
  if (root != null && root.getChildrenCount() > 0) {
    closeLayout();
    parent.submit(root);
  }
  if (parent instanceof ILineStackingLayoutManager) {
    boolean ret=((ILineStackingLayoutManager)parent).endLine();
    if (ret) {
      initialize();
      return true;
    }
  }
  assert(false);
  return true;
}

Fixed version (ground truth):
public boolean endLine(){
  if (root != null && root.getChildrenCount() > 0) {
    closeLayout();
    parent.submit(root);
  }
  if (parent instanceof ILineStackingLayoutManager) {
    boolean ret=((ILineStackingLayoutManager)parent).endLine();
    if (ret) {
      initialize();
      return true;
    }
    return false;
  }
  assert(false);
  return true;
}
Program: 73926
Project: 73926
Buggy source:
private boolean layoutChildNode(IReportItemExecutor childExecutor){
  boolean hasNextPage=false;
  IContent childContent=childExecutor.execute();
  PDFAbstractLM childLM=getFactory().createLayoutManager(this,childContent,childExecutor);
  hasNextPage=childLM.layout();
  if (hasNextPage && !childLM.isFinished()) {
    currentChild=childLM;
  }
 else {
    child=null;
  }
  return hasNextPage;
}

Fixed version (ground truth):
private boolean layoutChildNode(IReportItemExecutor childExecutor){
  boolean hasNextPage=false;
  IContent childContent=childExecutor.execute();
  PDFAbstractLM childLM=getFactory().createLayoutManager(this,childContent,childExecutor);
  hasNextPage=childLM.layout();
  if (hasNextPage && !childLM.isFinished()) {
    child=childLM;
  }
 else {
    child=null;
  }
  return hasNextPage;
}
Program: 73927
Project: 73927
Buggy source:
protected boolean traverseChildren(){
  boolean hasNextPage=false;
  if (currentChild != null) {
    hasNextPage=child.layout();
    if (hasNextPage) {
      if (currentChild.isFinished()) {
        currentChild=null;
      }
      return true;
    }
  }
  while (executor.hasNextChild()) {
    IReportItemExecutor childExecutor=executor.getNextChild();
    if (childExecutor != null) {
      if (layoutChildNode(childExecutor)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
protected boolean traverseChildren(){
  boolean hasNextPage=false;
  if (child != null) {
    hasNextPage=child.layout();
    if (hasNextPage) {
      if (child.isFinished()) {
        child=null;
      }
      return true;
    }
  }
  while (executor.hasNextChild()) {
    IReportItemExecutor childExecutor=executor.getNextChild();
    if (childExecutor != null) {
      if (layoutChildNode(childExecutor)) {
        return true;
      }
    }
  }
  return false;
}
Program: 73928
Project: 73928
Buggy source:
protected void updateLine(){
  if (root == null) {
    return;
  }
  Iterator iter=root.getChildren();
  int height=root.getHeight();
  int lineHeight=((PDFBlockStackingLM)parent).getLineHeight();
  if (lineHeight > maxAvaHeight) {
    lineHeight=0;
  }
  if (parent.isPageEmpty()) {
    height=Math.min(maxAvaHeight,Math.max(height,lineHeight));
  }
 else {
    height=Math.max(height,lineHeight);
  }
  root.setContentHeight(height);
}

Fixed version (ground truth):
protected void updateLine(){
  if (root == null) {
    return;
  }
  int height=root.getHeight();
  int lineHeight=((PDFBlockStackingLM)parent).getLineHeight();
  if (parent.isPageEmpty()) {
    height=Math.min(maxAvaHeight,Math.max(height,lineHeight));
  }
 else {
    height=Math.max(height,lineHeight);
  }
  root.setContentHeight(height);
}
Program: 73930
Project: 73930
Buggy source:
protected void calculateSpecifiedHeight(){
  if (content != null) {
    int calHeight=getDimensionValue(content.getHeight());
    if (calHeight > 0 && calHeight < context.getMaxHeight()) {
      this.specifiedHeight=calHeight;
    }
  }
}

Fixed version (ground truth):
protected void calculateSpecifiedHeight(){
  if (content != null) {
    int calHeight=getDimensionValue(content.getHeight());
    if (calHeight > 0) {
      this.specifiedHeight=Math.min(calHeight,context.getMaxHeight());
    }
  }
}
Program: 73931
Project: 73931
Buggy source:
protected void updatePageDimension(float scale){
  page.setHeight((int)(page.getHeight() / scale));
  page.setWidth((int)(page.getWidth() / scale));
  ContainerArea pageRoot=(ContainerArea)page.getRoot();
  pageRoot.setPosition((int)(pageRoot.getX() / scale),(int)(pageRoot.getY() / scale));
  pageRoot.setHeight((int)(pageRoot.getHeight() / scale));
  pageRoot.setWidth((int)(pageRoot.getWidth() / scale));
}

Fixed version (ground truth):
protected void updatePageDimension(float scale){
  page.setHeight((int)(pageContentHeight / scale));
  page.setWidth((int)(pageContentWidth / scale));
  ContainerArea pageRoot=(ContainerArea)page.getRoot();
  pageRoot.setPosition((int)(rootLeft / scale),(int)(rootTop / scale));
  pageRoot.setHeight((int)(rootHeight / scale));
  pageRoot.setWidth((int)(rootWidth / scale));
}
Program: 73933
Project: 73933
Buggy source:
protected boolean layoutChildren(){
  initialize();
  boolean hasNextPage=false;
  hasNextPage=traverseChildren();
  if (!hasNextPage) {
    isLast=true;
    clearCache();
  }
 else   if (!context.isAutoPageBreak()) {
    clearCache();
  }
  if (!isRootEmpty() && !(context.isAutoPageBreak() && hasNextPage)) {
    closeLayout();
    hasNextPage=!submitRoot() || hasNextPage;
  }
  return hasNextPage;
}

Fixed version (ground truth):
protected boolean layoutChildren(){
  initialize();
  boolean hasNextPage=false;
  hasNextPage=traverseChildren();
  if (!hasNextPage) {
    isLast=true;
    clearCache();
  }
 else   if (!context.isAutoPageBreak()) {
    clearCache();
  }
  if (!isRootEmpty()) {
    closeLayout();
    hasNextPage=!submitRoot() || hasNextPage;
  }
  return hasNextPage;
}
Program: 73934
Project: 73934
Buggy source:
public long getPageOffset(String masterPage) throws IOException {
  Object value=pages.get(masterPage);
  if (value != null && value instanceof Long) {
    return ((Long)value).longValue();
  }
 else {
    RAInputStream indexStream=null;
    try {
      indexStream=reader.getStream(ReportDocumentConstants.PAGE_INDEX_STREAM);
      DataInputStream input=new DataInputStream(indexStream);
      while (true) {
        String masterPageName=IOUtil.readString(input);
        long pageOffset=IOUtil.readLong(input);
        pages.put(masterPageName,pageOffset);
      }
    }
 catch (    EOFException eef) {
    }
catch (    IOException ex) {
      throw ex;
    }
 finally {
      if (indexStream != null) {
        try {
          indexStream.close();
        }
 catch (        IOException e) {
        }
        indexStream=null;
      }
    }
    value=pages.get(masterPage);
    if (value != null && value instanceof Long) {
      return ((Long)value).longValue();
    }
  }
  return -1;
}

Fixed version (ground truth):
public long getPageOffset(String masterPage) throws IOException {
  Object value=pages.get(masterPage);
  if (value != null && value instanceof Long) {
    return ((Long)value).longValue();
  }
 else {
    RAInputStream indexStream=null;
    try {
      indexStream=reader.getStream(ReportDocumentConstants.PAGE_INDEX_STREAM);
      DataInputStream input=new DataInputStream(indexStream);
      while (true) {
        String masterPageName=IOUtil.readString(input);
        long pageOffset=IOUtil.readLong(input);
        pages.put(masterPageName,new Long(pageOffset));
      }
    }
 catch (    EOFException eef) {
    }
catch (    IOException ex) {
      throw ex;
    }
 finally {
      if (indexStream != null) {
        try {
          indexStream.close();
        }
 catch (        IOException e) {
        }
        indexStream=null;
      }
    }
    value=pages.get(masterPage);
    if (value != null && value instanceof Long) {
      return ((Long)value).longValue();
    }
  }
  return -1;
}
Program: 73935
Project: 73935
Buggy source:
private void groupOnRowKeyCount(double intervalRange) throws Exception, IOException {
  String[] bindingNameGroup=new String[1];
  bindingNameGroup[0]="String_Node_Str";
  IBaseExpression[] bindingExprGroup=new IBaseExpression[1];
  bindingExprGroup[0]=new ScriptExpression("String_Node_Str");
  GroupDefinition[] groupDefn=new GroupDefinition[]{new GroupDefinition("String_Node_Str")};
  groupDefn[0].setKeyExpression("String_Node_Str");
  groupDefn[0].setInterval(IGroupDefinition.NO_INTERVAL);
  groupDefn[0].setIntervalRange(intervalRange);
  String[] bindingNameRow=new String[3];
  bindingNameRow[0]="String_Node_Str";
  bindingNameRow[1]="String_Node_Str";
  bindingNameRow[2]="String_Node_Str";
  IBaseExpression[] bindingExprRow=new IBaseExpression[3];
  bindingExprRow[0]=new ScriptExpression("String_Node_Str");
  bindingExprRow[1]=new ScriptExpression("String_Node_Str");
  bindingExprRow[2]=new ScriptExpression("String_Node_Str");
  String[] columnStr=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  QueryDefinition qd=this.createQuery(bindingNameGroup,bindingExprGroup,groupDefn,null,null,null,null,null,null,bindingNameRow,bindingExprRow);
  String outputStr=getOutputStrForGroupTest(30,qd,groupDefn.length,bindingNameRow,columnStr);
  testPrint(outputStr);
  this.checkOutputFile();
}

Fixed version (ground truth):
/** 
 * Currently, don't support multiple GroupOnRowKeyCount
 * @throws Exception
 */
private void groupOnRowKeyCount(double intervalRange) throws Exception, IOException {
  String[] bindingNameGroup=new String[1];
  bindingNameGroup[0]="String_Node_Str";
  IBaseExpression[] bindingExprGroup=new IBaseExpression[1];
  bindingExprGroup[0]=new ScriptExpression("String_Node_Str");
  GroupDefinition[] groupDefn=new GroupDefinition[]{new GroupDefinition("String_Node_Str")};
  groupDefn[0].setKeyExpression("String_Node_Str");
  groupDefn[0].setInterval(IGroupDefinition.NO_INTERVAL);
  groupDefn[0].setIntervalRange(intervalRange);
  String[] bindingNameRow=new String[3];
  bindingNameRow[0]="String_Node_Str";
  bindingNameRow[1]="String_Node_Str";
  bindingNameRow[2]="String_Node_Str";
  IBaseExpression[] bindingExprRow=new IBaseExpression[3];
  bindingExprRow[0]=new ScriptExpression("String_Node_Str");
  bindingExprRow[1]=new ScriptExpression("String_Node_Str");
  bindingExprRow[2]=new ScriptExpression("String_Node_Str");
  String[] columnStr=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  QueryDefinition qd=this.createQuery(bindingNameGroup,bindingExprGroup,groupDefn,null,null,null,null,null,null,bindingNameRow,bindingExprRow);
  String outputStr=getOutputStrForGroupTest(30,qd,groupDefn.length,bindingNameRow,columnStr);
  testPrint(outputStr);
  this.checkOutputFile();
}
Program: 73936
Project: 73936
Buggy source:
public List checkCompatibility(){
  List errorList=new ArrayList(1);
  if (!CROSSTAB_CURRENT_VERSION.equals(handle.getExtensionVersion())) {
    try {
      handle.setExtensionVersion(CROSSTAB_CURRENT_VERSION);
    }
 catch (    SemanticException e) {
      errorList.add(e);
    }
  }
  if (getHeader() == null) {
    PropertyHandle headerHandle=handle.getPropertyHandle(HEADER_PROP);
    if (headerHandle != null) {
      try {
        headerHandle.setValue(CrosstabExtendedItemFactory.createCrosstabCell(getModuleHandle()));
      }
 catch (      SemanticException e) {
        errorList.add(e);
      }
    }
  }
  return errorList.size() == 0 ? Collections.EMPTY_LIST : errorList;
}

Fixed version (ground truth):
public List checkCompatibility(){
  List errorList=new ArrayList(1);
  if (checkVersion(handle.getExtensionVersion()) < 0) {
    try {
      handle.setExtensionVersion(CROSSTAB_CURRENT_VERSION);
    }
 catch (    SemanticException e) {
      errorList.add(e);
    }
    if (getHeader() == null) {
      PropertyHandle headerHandle=handle.getPropertyHandle(HEADER_PROP);
      if (headerHandle != null) {
        try {
          headerHandle.setValue(CrosstabExtendedItemFactory.createCrosstabCell(getModuleHandle()));
        }
 catch (        SemanticException e) {
          errorList.add(e);
        }
      }
    }
  }
  return errorList.size() == 0 ? Collections.EMPTY_LIST : errorList;
}
Program: 73937
Project: 73937
Buggy source:
public List checkCompatibility(){
  ExtendedItemHandle exhandle=(ExtendedItemHandle)getModelHandle();
  Map illegalContents=exhandle.getIllegalContents();
  if (illegalContents.containsKey(IMeasureViewConstants.DETAIL_PROP)) {
    List detailInfoList=(List)illegalContents.get(IMeasureViewConstants.DETAIL_PROP);
    if (detailInfoList.size() > 0) {
      IllegalContentInfo detailInfo=(IllegalContentInfo)detailInfoList.get(0);
      ExtendedItemHandle oldDetail=(ExtendedItemHandle)detailInfo.getContent();
      if (oldDetail != null) {
        try {
          ExtendedItemHandle newDetail=CrosstabExtendedItemFactory.createAggregationCell(getModuleHandle());
          handle.getPropertyHandle(DETAIL_PROP).setValue(newDetail);
          List contents=oldDetail.getContents(ICrosstabCellConstants.CONTENT_PROP);
          for (int i=0; i < contents.size(); i++) {
            ((DesignElementHandle)contents.get(i)).moveTo(newDetail,IAggregationCellConstants.CONTENT_PROP);
          }
        }
 catch (        SemanticException e) {
          List errorList=new ArrayList(1);
          errorList.add(e);
          return errorList;
        }
      }
    }
  }
  return Collections.EMPTY_LIST;
}

Fixed version (ground truth):
public List checkCompatibility(){
{
    ExtendedItemHandle exhandle=(ExtendedItemHandle)getModelHandle();
    Map illegalContents=exhandle.getIllegalContents();
    if (illegalContents.containsKey(IMeasureViewConstants.DETAIL_PROP)) {
      List detailInfoList=(List)illegalContents.get(IMeasureViewConstants.DETAIL_PROP);
      if (detailInfoList.size() > 0) {
        IllegalContentInfo detailInfo=(IllegalContentInfo)detailInfoList.get(0);
        ExtendedItemHandle oldDetail=(ExtendedItemHandle)detailInfo.getContent();
        if (oldDetail != null) {
          try {
            ExtendedItemHandle newDetail=CrosstabExtendedItemFactory.createAggregationCell(getModuleHandle());
            handle.getPropertyHandle(DETAIL_PROP).setValue(newDetail);
            List contents=oldDetail.getContents(ICrosstabCellConstants.CONTENT_PROP);
            for (int i=0; i < contents.size(); i++) {
              ((DesignElementHandle)contents.get(i)).moveTo(newDetail,IAggregationCellConstants.CONTENT_PROP);
            }
          }
 catch (          SemanticException e) {
            List errorList=new ArrayList(1);
            errorList.add(e);
            return errorList;
          }
        }
      }
    }
  }
  return Collections.EMPTY_LIST;
}
Program: 73938
Project: 73938
Buggy source:
public void init(IEditorSite site,IEditorInput input) throws PartInitException {
  if (instance != null) {
    getSite().getWorkbenchWindow().getPartService().removePartListener(instance);
    instance.dispose();
  }
  if (input instanceof IFileEditorInput || input instanceof IURIEditorInput) {
    instance=new IDEMultiPageReportEditor();
    instance.addPropertyListener(this);
  }
 else {
    instance=new MultiPageReportEditor();
    instance.addPropertyListener(this);
  }
  instance.init(site,input);
  instance.addPropertyListener(this);
  getSite().getWorkbenchWindow().getPartService().addPartListener(this);
}

Fixed version (ground truth):
public void init(IEditorSite site,IEditorInput input) throws PartInitException {
  cachedSite=site;
  if (instance != null) {
    getSite().getWorkbenchWindow().getPartService().removePartListener(instance);
    instance.dispose();
  }
  if (input instanceof IFileEditorInput || input instanceof IURIEditorInput) {
    instance=new IDEMultiPageReportEditor();
  }
 else {
    instance=new MultiPageReportEditor();
  }
  instance.addPropertyListener(this);
  instance.init(site,input);
  getSite().getWorkbenchWindow().getPartService().addPartListener(this);
}
Program: 73939
Project: 73939
Buggy source:
public IEditorSite getEditorSite(){
  return instance.getEditorSite();
}

Fixed version (ground truth):
public IEditorSite getEditorSite(){
  if (instance != null) {
    return instance.getEditorSite();
  }
  return cachedSite;
}
Program: 73940
Project: 73940
Buggy source:
public IWorkbenchPartSite getSite(){
  return instance.getSite();
}

Fixed version (ground truth):
public IWorkbenchPartSite getSite(){
  if (instance != null) {
    return instance.getSite();
  }
  return cachedSite;
}
Program: 73941
Project: 73941
Buggy source:
public void endContainer(IContent content,boolean finished,IContentEmitter emitter,boolean visible){
  if (content != null && visible) {
    ContentEmitterUtil.endContent(pageContent,emitter);
  }
}

Fixed version (ground truth):
public void endContainer(IContent content,boolean finished,IContentEmitter emitter,boolean visible){
  if (content != null && visible) {
    ContentEmitterUtil.endContent(content,emitter);
  }
}
Program: 73942
Project: 73942
Buggy source:
/** 
 * @throws Exception
 */
public void testWrongExtensionID() throws Exception {
  openDesign("String_Node_Str");
  save();
  assertTrue(compareFile("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * If the extension id is invalid, related properties should be parsed and the file can be opened.
 * @throws Exception
 */
public void testWrongExtensionID() throws Exception {
  openDesign("String_Node_Str");
  save();
  OdaDataSetHandle setHandle=(OdaDataSetHandle)designHandle.findDataSet("String_Node_Str");
  assertNull(setHandle.getProperty("String_Node_Str"));
  assertEquals("String_Node_Str",setHandle.getStringProperty("String_Node_Str"));
  assertTrue(compareFile("String_Node_Str"));
}
Program: 73944
Project: 73944
Buggy source:
/** 
 * construction
 */
CacheMapManager(String tempDir){
  this.tempDir=tempDir;
}

Fixed version (ground truth):
/** 
 * construction
 */
CacheMapManager(String tempDir,boolean useJVMLevelCache){
  this.tempDir=tempDir;
  if (useJVMLevelCache) {
    cacheMap=JVMLevelCacheMap;
  }
 else {
    cacheMap=new HashMap();
  }
}
Program: 73945
Project: 73945
Buggy source:
/** 
 * Reset for test case
 */
void resetForTest(){
synchronized (this) {
    cacheMap=new HashMap();
  }
}

Fixed version (ground truth):
/** 
 * Reset for test case
 */
void resetForTest(){
synchronized (this) {
    cacheMap.clear();
  }
}
Program: 73946
Project: 73946
Buggy source:
/** 
 * Notice, this method is only for test, it can not be called unless its use is for test.
 */
public void resetForTest(){
  dataSourceDesign=null;
  dataSetDesign=null;
  cacheOption=DataEngineContext.CACHE_USE_DEFAULT;
  alwaysCacheRowCount=0;
  this.cacheMapManager.resetForTest();
}

Fixed version (ground truth):
/** 
 * Notice, this method is only for test, it can not be called unless its use is for test.
 */
public void resetForTest(){
  dataSourceDesign=null;
  dataSetDesign=null;
  cacheOption=DataEngineContext.CACHE_USE_DEFAULT;
  alwaysCacheRowCount=0;
  if (this.cacheMapManager != null) {
    this.cacheMapManager.resetForTest();
  }
}
Program: 73947
Project: 73947
Buggy source:
/** 
 * only for test
 * @return
 */
public boolean doesLoadFromCache(){
  if (needsToCache(dataSetDesign,cacheOption,alwaysCacheRowCount) == false)   return false;
  return cacheMapManager.doesLoadFromCache(DataSourceAndDataSet.newInstance(this.dataSourceDesign,this.dataSetDesign,this.parameterHints));
}

Fixed version (ground truth):
/** 
 * only for test
 * @return
 */
public boolean doesLoadFromCache(){
  if (needsToCache(dataSetDesign,cacheOption,alwaysCacheRowCount) == false)   return false;
  switchCacheMap(dataSetDesign);
  return cacheMapManager.doesLoadFromCache(DataSourceAndDataSet.newInstance(this.dataSourceDesign,this.dataSetDesign,this.parameterHints));
}
Program: 73948
Project: 73948
Buggy source:
/** 
 * @param dataSetDesign
 * @param cacheDir
 */
public void registerCacheDir(IBaseDataSetDesign dataSetDesign,String cacheDir){
  cacheMapManager.getCacheDirMap().put(dataSetDesign,cacheDir);
}

Fixed version (ground truth):
/** 
 * @param dataSetDesign
 * @param cacheDir
 */
public void registerCacheDir(IBaseDataSetDesign dataSetDesign,String cacheDir){
  switchCacheMap(dataSetDesign);
  cacheMapManager.getCacheDirMap().put(dataSetDesign,cacheDir);
}
Program: 73949
Project: 73949
Buggy source:
/** 
 * Clear cache
 * @param dataSourceDesign2
 * @param dataSetDesign2
 */
public void clearCache(IBaseDataSourceDesign dataSourceDesign2,IBaseDataSetDesign dataSetDesign2){
  if (dataSourceDesign2 == null || dataSetDesign2 == null)   return;
  DataSourceAndDataSet ds=DataSourceAndDataSet.newInstance(dataSourceDesign2,dataSetDesign2,null);
  cacheMapManager.clearCache(ds);
}

Fixed version (ground truth):
/** 
 * Clear cache
 * @param dataSourceDesign2
 * @param dataSetDesign2
 */
public void clearCache(IBaseDataSourceDesign dataSourceDesign2,IBaseDataSetDesign dataSetDesign2){
  if (dataSourceDesign2 == null || dataSetDesign2 == null)   return;
  DataSourceAndDataSet ds=DataSourceAndDataSet.newInstance(dataSourceDesign2,dataSetDesign2,null);
  switchCacheMap(dataSetDesign2);
  cacheMapManager.clearCache(ds);
}
Program: 73950
Project: 73950
Buggy source:
/** 
 * @return
 */
public IDataSetCacheObject getCacheObject(){
  return cacheMapManager.getCacheObject(DataSourceAndDataSet.newInstance(this.dataSourceDesign,this.dataSetDesign,this.parameterHints));
}

Fixed version (ground truth):
/** 
 * @return
 */
public IDataSetCacheObject getCacheObject(){
  switchCacheMap(dataSetDesign);
  return cacheMapManager.getCacheObject(DataSourceAndDataSet.newInstance(this.dataSourceDesign,this.dataSetDesign,this.parameterHints));
}
Program: 73951
Project: 73951
Buggy source:
/** 
 * Return the cached result metadata. Please note that parameter hint will not change the returned metadata.
 * @return
 * @throws DataException
 */
public IResultMetaData getCachedResultMetadata(IBaseDataSourceDesign dataSource,IBaseDataSetDesign dataSet) throws DataException {
  IResultClass resultClass=this.cacheMapManager.getCachedResultClass(DataSourceAndDataSet.newInstance(dataSource,dataSet,null));
  if (resultClass != null)   return new ResultMetaData(resultClass);
 else   return null;
}

Fixed version (ground truth):
/** 
 * Return the cached result metadata. Please note that parameter hint will not change the returned metadata.
 * @return
 * @throws DataException
 */
public IResultMetaData getCachedResultMetadata(IBaseDataSourceDesign dataSource,IBaseDataSetDesign dataSet) throws DataException {
  switchCacheMap(dataSet);
  IResultClass resultClass=this.cacheMapManager.getCachedResultClass(DataSourceAndDataSet.newInstance(dataSource,dataSet,null));
  if (resultClass != null)   return new ResultMetaData(resultClass);
 else   return null;
}
Program: 73952
Project: 73952
Buggy source:
/** 
 * Construction
 */
public DataSetCacheManager(String tempDir,DataEngine dataEngine){
  this.tempDir=tempDir;
  this.dataSourceDesign=null;
  this.dataSetDesign=null;
  this.cacheOption=DataEngineContext.CACHE_USE_DEFAULT;
  this.alwaysCacheRowCount=0;
  this.cacheMapManager=new CacheMapManager(tempDir);
  this.mode=DataEngineContext.CACHE_MODE_IN_DISK;
}

Fixed version (ground truth):
/** 
 * Construction
 */
public DataSetCacheManager(String tempDir,DataEngine dataEngine){
  this.tempDir=tempDir;
  this.dataSourceDesign=null;
  this.dataSetDesign=null;
  this.cacheOption=DataEngineContext.CACHE_USE_DEFAULT;
  this.alwaysCacheRowCount=0;
  this.JVMLevelCacheMapManager=new CacheMapManager(tempDir,true);
  this.DteLevelCacheMapManager=new CacheMapManager(tempDir,false);
  this.mode=DataEngineContext.CACHE_MODE_IN_DISK;
}
Program: 73953
Project: 73953
Buggy source:
/** 
 * @return
 * @throws DataException 
 */
public boolean doesSaveToCache() throws DataException {
  if (needsToCache(dataSetDesign,cacheOption,alwaysCacheRowCount) == false)   return false;
  return cacheMapManager.doesSaveToCache(DataSourceAndDataSet.newInstance(this.dataSourceDesign,this.dataSetDesign,this.parameterHints),this.mode,this.dataSourceDesign,this.dataSetDesign,this.parameterHints,this.appContext);
}

Fixed version (ground truth):
/** 
 * @return
 * @throws DataException 
 */
public boolean doesSaveToCache() throws DataException {
  if (needsToCache(dataSetDesign,cacheOption,alwaysCacheRowCount) == false)   return false;
  switchCacheMap(dataSetDesign);
  return cacheMapManager.doesSaveToCache(DataSourceAndDataSet.newInstance(this.dataSourceDesign,this.dataSetDesign,this.parameterHints),this.mode,this.dataSourceDesign,this.dataSetDesign,this.parameterHints,this.appContext);
}
Program: 73954
Project: 73954
Buggy source:
/** 
 * Adapts base data set properties
 */
public static void adaptBaseDataSet(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet) throws BirtException {
  if ((!(modelDataSet instanceof JointDataSetHandle)) && modelDataSet.getDataSource() == null) {
    throw new AdapterException(ResourceConstants.DATASOURCE_NULL_ERROR);
  }
  if (!(modelDataSet instanceof JointDataSetHandle)) {
    dteDataSet.setDataSource(modelDataSet.getDataSource().getQualifiedName());
    dteDataSet.setBeforeOpenScript(modelDataSet.getBeforeOpen());
    dteDataSet.setAfterOpenScript(modelDataSet.getAfterOpen());
    dteDataSet.setOnFetchScript(modelDataSet.getOnFetch());
    dteDataSet.setBeforeCloseScript(modelDataSet.getBeforeClose());
    dteDataSet.setAfterCloseScript(modelDataSet.getAfterClose());
  }
  populateParameter(modelDataSet,dteDataSet);
  populateComputedColumn(modelDataSet,dteDataSet);
  populateFilter(modelDataSet,dteDataSet);
  dteDataSet.setRowFetchLimit(modelDataSet.getRowFetchLimit());
  mergeHints(modelDataSet,dteDataSet);
}

Fixed version (ground truth):
/** 
 * Adapts base data set properties
 */
public static void adaptBaseDataSet(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet) throws BirtException {
  if ((!(modelDataSet instanceof JointDataSetHandle)) && modelDataSet.getDataSource() == null) {
    throw new AdapterException(ResourceConstants.DATASOURCE_NULL_ERROR);
  }
  if (!(modelDataSet instanceof JointDataSetHandle)) {
    dteDataSet.setDataSource(modelDataSet.getDataSource().getQualifiedName());
    dteDataSet.setBeforeOpenScript(modelDataSet.getBeforeOpen());
    dteDataSet.setAfterOpenScript(modelDataSet.getAfterOpen());
    dteDataSet.setOnFetchScript(modelDataSet.getOnFetch());
    dteDataSet.setBeforeCloseScript(modelDataSet.getBeforeClose());
    dteDataSet.setAfterCloseScript(modelDataSet.getAfterClose());
  }
  populateParameter(modelDataSet,dteDataSet);
  populateComputedColumn(modelDataSet,dteDataSet);
  populateFilter(modelDataSet,dteDataSet);
  dteDataSet.setRowFetchLimit(modelDataSet.getRowFetchLimit());
  dteDataSet.setNeedCache(modelDataSet.needsCache());
  mergeHints(modelDataSet,dteDataSet);
}
Program: 73955
Project: 73955
Buggy source:
void adaptBaseDataSet(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet) throws BirtException {
  if ((!(modelDataSet instanceof JointDataSetHandle)) && modelDataSet.getDataSource() == null)   throw new EngineException("String_Node_Str");
  if (!(modelDataSet instanceof JointDataSetHandle)) {
    dteDataSet.setDataSource(modelDataSet.getDataSource().getQualifiedName());
    dteDataSet.setBeforeOpenScript(modelDataSet.getBeforeOpen());
    dteDataSet.setAfterOpenScript(modelDataSet.getAfterOpen());
    dteDataSet.setOnFetchScript(modelDataSet.getOnFetch());
    dteDataSet.setBeforeCloseScript(modelDataSet.getBeforeClose());
    dteDataSet.setAfterCloseScript(modelDataSet.getAfterClose());
  }
  populateParameter(modelDataSet,dteDataSet);
  populateComputedColumn(modelDataSet,dteDataSet);
  populateFilter(modelDataSet,dteDataSet);
  dteDataSet.setRowFetchLimit(modelDataSet.getRowFetchLimit());
  mergeHints(modelDataSet,dteDataSet);
}

Fixed version (ground truth):
void adaptBaseDataSet(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet) throws BirtException {
  if ((!(modelDataSet instanceof JointDataSetHandle)) && modelDataSet.getDataSource() == null)   throw new EngineException("String_Node_Str");
  if (!(modelDataSet instanceof JointDataSetHandle)) {
    dteDataSet.setDataSource(modelDataSet.getDataSource().getQualifiedName());
    dteDataSet.setBeforeOpenScript(modelDataSet.getBeforeOpen());
    dteDataSet.setAfterOpenScript(modelDataSet.getAfterOpen());
    dteDataSet.setOnFetchScript(modelDataSet.getOnFetch());
    dteDataSet.setBeforeCloseScript(modelDataSet.getBeforeClose());
    dteDataSet.setAfterCloseScript(modelDataSet.getAfterClose());
  }
  populateParameter(modelDataSet,dteDataSet);
  populateComputedColumn(modelDataSet,dteDataSet);
  populateFilter(modelDataSet,dteDataSet);
  dteDataSet.setRowFetchLimit(modelDataSet.getRowFetchLimit());
  dteDataSet.setNeedCache(modelDataSet.needsCache());
  mergeHints(modelDataSet,dteDataSet);
}
Program: 73956
Project: 73956
Buggy source:
/** 
 * Create a file for caching objects.
 * @param cacheIndex
 * @return
 */
private File getCacheFile(int cacheIndex){
  String tempDirStr=tempDir + this.fileNamePrefix;
  if (dir == null) {
    dir=new File(tempDirStr);
    dir.mkdir();
  }
  return new File(tempDirStr + File.separatorChar + cacheIndex+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Create a file for caching objects.
 * @param cacheIndex
 * @return
 */
private File getCacheFile(int cacheIndex){
  String tempDirStr=tempDir + this.fileNamePrefix;
  if (dir == null) {
    dir=new File(tempDirStr);
    dir.mkdirs();
  }
  return new File(tempDirStr + File.separatorChar + cacheIndex+ "String_Node_Str");
}
Program: 73957
Project: 73957
Buggy source:
public static String createTempRootDir(String tempDir){
  String rootDirStr=null;
  File tempDtEDir=null;
synchronized (cacheCounter1) {
    tempDtEDir=new File(tempDir,"String_Node_Str" + System.currentTimeMillis() + cacheCounter1);
    cacheCounter1=new Integer(cacheCounter1.intValue() + 1);
    int x=0;
    while (tempDtEDir.exists()) {
      x++;
      tempDtEDir=new File(tempDir,"String_Node_Str" + System.currentTimeMillis() + cacheCounter1+ "String_Node_Str"+ x);
    }
    tempDtEDir.mkdir();
    tempDtEDir.deleteOnExit();
  }
  rootDirStr=getCanonicalPath(tempDtEDir);
  return rootDirStr;
}

Fixed version (ground truth):
public static String createTempRootDir(String tempDir){
  String rootDirStr=null;
  File tempDtEDir=null;
synchronized (cacheCounter1) {
    tempDtEDir=new File(tempDir,"String_Node_Str" + System.currentTimeMillis() + cacheCounter1);
    cacheCounter1=new Integer(cacheCounter1.intValue() + 1);
    int x=0;
    while (tempDtEDir.exists()) {
      x++;
      tempDtEDir=new File(tempDir,"String_Node_Str" + System.currentTimeMillis() + cacheCounter1+ "String_Node_Str"+ x);
    }
    tempDtEDir.mkdirs();
    tempDtEDir.deleteOnExit();
  }
  rootDirStr=getCanonicalPath(tempDtEDir);
  return rootDirStr;
}