nus-yam/ex-repair huggingface dataset:
Program: 73445
Project: 73445
Buggy source:
protected void checkFindTOCByName(ReportDocumentReader document){
  TOCNode root=document.findTOC("String_Node_Str");
  assertTrue(root != null);
  List tocs=(List)document.findTOCByName("String_Node_Str");
  assertEquals(1,tocs.size());
  tocs=(List)document.findTOCByName("String_Node_Str");
  assertEquals(2,tocs.size());
  tocs=(List)document.findTOCByName("String_Node_Str");
  assertEquals(3,tocs.size());
  tocs=(List)document.findTOCByName("String_Node_Str");
  assertNull(tocs);
  assertNull(document.findTOCByName(null));
}

Fixed version (ground truth):
protected void checkFindTOCByName(IReportDocument document){
  TOCNode root=document.findTOC("String_Node_Str");
  assertTrue(root != null);
  List tocs=(List)document.findTOCByName("String_Node_Str");
  assertEquals(1,tocs.size());
  tocs=(List)document.findTOCByName("String_Node_Str");
  assertEquals(2,tocs.size());
  tocs=(List)document.findTOCByName("String_Node_Str");
  assertEquals(3,tocs.size());
  tocs=(List)document.findTOCByName("String_Node_Str");
  assertNull(tocs);
  assertNull(document.findTOCByName(null));
}
Program: 73446
Project: 73446
Buggy source:
protected void checkDocument(){
  try {
    IDocArchiveReader archive=new FileArchiveReader(REPORT_DOCUMENT);
    ReportDocumentReader document=new ReportDocumentReader(engine,archive);
    assertTrue(document.getName() != null);
    assertTrue(document.getReportRunnable() != null);
    checkParamters(document.getParameterValues());
    checkTOC(document);
    checkBookmarks(document);
    checkPersistentObjects(document.getGlobalVariables(null));
    document.close();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    fail();
  }
}

Fixed version (ground truth):
protected void checkDocument(){
  try {
    IDocArchiveReader archive=new FileArchiveReader(REPORT_DOCUMENT);
    IReportDocument document=engine.openReportDocument(null,archive,null);
    assertTrue(document.getName() != null);
    assertTrue(document.getReportRunnable() != null);
    checkParamters(document.getParameterValues());
    checkTOC(document);
    checkBookmarks(document);
    checkPersistentObjects(document.getGlobalVariables(null));
    document.close();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    fail();
  }
}
Program: 73447
Project: 73447
Buggy source:
/** 
 * write empty content, the stream shouldn't be created.
 */
public void testEmptyDocument(){
  try {
    IDocArchiveWriter archive=new FileArchiveWriter(REPORT_DOCUMENT);
    ReportDocumentWriter document=new ReportDocumentWriter(engine,archive);
    TOCTree tree=new TOCTree();
    document.saveTOC(tree);
    HashMap bookmarks=new HashMap();
    document.saveBookmarks(bookmarks);
    document.close();
    IDocArchiveReader reader=new FileArchiveReader(REPORT_DOCUMENT);
    ReportDocumentReader docReader=new ReportDocumentReader(engine,reader);
    assertFalse(reader.exists(ReportDocumentReader.BOOKMARK_STREAM));
    TOCNode root=tree.getTOCRoot();
    assertTrue(root.getChildren().isEmpty());
    assertTrue(docReader.getBookmarks().isEmpty());
    docReader.close();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    fail();
  }
}

Fixed version (ground truth):
/** 
 * write empty content, the stream shouldn't be created.
 */
public void testEmptyDocument(){
  try {
    IDocArchiveWriter archive=new FileArchiveWriter(REPORT_DOCUMENT);
    ReportDocumentWriter document=new ReportDocumentWriter(engine,archive);
    TOCTree tree=new TOCTree();
    document.saveTOC(tree);
    HashMap bookmarks=new HashMap();
    document.saveBookmarks(bookmarks);
    document.close();
    IDocArchiveReader reader=new FileArchiveReader(REPORT_DOCUMENT);
    IReportDocument docReader=engine.openReportDocument(null,reader,null);
    assertFalse(reader.exists(ReportDocumentReader.BOOKMARK_STREAM));
    TOCNode root=tree.getTOCRoot();
    assertTrue(root.getChildren().isEmpty());
    assertTrue(docReader.getBookmarks().isEmpty());
    docReader.close();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    fail();
  }
}
Program: 73448
Project: 73448
Buggy source:
protected void checkTOC(ReportDocumentReader document){
  ITOCTree tree=document.getTOCTree("String_Node_Str",null);
  TOCNode root=tree.getRoot();
  assertTrue(root != null);
  assertTrue(root.getNodeID() == null);
  assertEquals(3,root.getChildren().size());
  Iterator iter=root.getChildren().iterator();
  TOCNode chart1=(TOCNode)iter.next();
  assertTOCNode(chart1,root,"String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(3,chart1.getChildren().size());
  Iterator sectionIter=chart1.getChildren().iterator();
  TOCNode section1=(TOCNode)sectionIter.next();
  assertTOCNode(section1,chart1,"String_Node_Str","String_Node_Str","String_Node_Str");
  section1=(TOCNode)sectionIter.next();
  assertTOCNode(section1,chart1,"String_Node_Str","String_Node_Str","String_Node_Str");
  section1=(TOCNode)sectionIter.next();
  assertTOCNode(section1,chart1,"String_Node_Str","String_Node_Str","String_Node_Str");
  assertFalse(sectionIter.hasNext());
  TOCNode chart2=(TOCNode)iter.next();
  assertTOCNode(chart2,root,"String_Node_Str","String_Node_Str","String_Node_Str");
  chart2=(TOCNode)iter.next();
  assertTOCNode(chart2,root,"String_Node_Str","String_Node_Str","String_Node_Str");
  assertFalse(sectionIter.hasNext());
  checkFindTOCByName(document);
}

Fixed version (ground truth):
protected void checkTOC(IReportDocument document){
  ITOCTree tree=document.getTOCTree("String_Node_Str",null);
  TOCNode root=tree.getRoot();
  assertTrue(root != null);
  assertTrue(root.getNodeID() == null);
  assertEquals(3,root.getChildren().size());
  Iterator iter=root.getChildren().iterator();
  TOCNode chart1=(TOCNode)iter.next();
  assertTOCNode(chart1,root,"String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(3,chart1.getChildren().size());
  Iterator sectionIter=chart1.getChildren().iterator();
  TOCNode section1=(TOCNode)sectionIter.next();
  assertTOCNode(section1,chart1,"String_Node_Str","String_Node_Str","String_Node_Str");
  section1=(TOCNode)sectionIter.next();
  assertTOCNode(section1,chart1,"String_Node_Str","String_Node_Str","String_Node_Str");
  section1=(TOCNode)sectionIter.next();
  assertTOCNode(section1,chart1,"String_Node_Str","String_Node_Str","String_Node_Str");
  assertFalse(sectionIter.hasNext());
  TOCNode chart2=(TOCNode)iter.next();
  assertTOCNode(chart2,root,"String_Node_Str","String_Node_Str","String_Node_Str");
  chart2=(TOCNode)iter.next();
  assertTOCNode(chart2,root,"String_Node_Str","String_Node_Str","String_Node_Str");
  assertFalse(sectionIter.hasNext());
  checkFindTOCByName(document);
}
Program: 73449
Project: 73449
Buggy source:
public TestRunAndRenderTask(IReportEngine engine,IReportRunnable runnable,IEmitterMonitor monitor){
  super(engine,runnable);
  this.monitor=monitor;
}

Fixed version (ground truth):
public TestRunAndRenderTask(IReportEngine engine,IReportRunnable runnable,IEmitterMonitor monitor){
  super(getReportEngine(engine),runnable);
  this.monitor=monitor;
}
Program: 73450
Project: 73450
Buggy source:
AbstractRunTask(IReportEngine engine,IReportRunnable runnable,int taskType){
  super(engine,runnable,taskType);
}

Fixed version (ground truth):
AbstractRunTask(ReportEngine engine,IReportRunnable runnable,int taskType){
  super(engine,runnable,taskType);
}
Program: 73451
Project: 73451
Buggy source:
public DataExtractionTask(IReportEngine engine,IReportRunnable runnable,IReportDocument reader) throws EngineException {
  String version=reader.getProperty(ReportDocumentConstants.DATA_EXTRACTION_TASK_VERSION_KEY);
  if (ReportDocumentConstants.DATA_EXTRACTION_TASK_VERSION_0.equals(version)) {
    task=new DataExtractionTaskV0(engine,runnable,reader);
  }
 else   if (ReportDocumentConstants.DATA_EXTRACTION_TASK_VERSION_1.equals(version)) {
    task=new DataExtractionTaskV1(engine,runnable,reader);
  }
}

Fixed version (ground truth):
public DataExtractionTask(ReportEngine engine,IReportRunnable runnable,IReportDocument reader) throws EngineException {
  String version=reader.getProperty(ReportDocumentConstants.DATA_EXTRACTION_TASK_VERSION_KEY);
  if (ReportDocumentConstants.DATA_EXTRACTION_TASK_VERSION_0.equals(version)) {
    task=new DataExtractionTaskV0(engine,runnable,reader);
  }
 else   if (ReportDocumentConstants.DATA_EXTRACTION_TASK_VERSION_1.equals(version)) {
    task=new DataExtractionTaskV1(engine,runnable,reader);
  }
}
Program: 73452
Project: 73452
Buggy source:
public DataExtractionTaskV0(IReportEngine engine,IReportRunnable runnable,IReportDocument reader) throws EngineException {
  super(engine,runnable,IEngineTask.TASK_DATAEXTRACTION);
  this.report=((ReportRunnable)runnable).getReportIR();
  this.reportDocReader=reader;
  executionContext.setReportDocument(reportDocReader);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
}

Fixed version (ground truth):
public DataExtractionTaskV0(ReportEngine engine,IReportRunnable runnable,IReportDocument reader) throws EngineException {
  super(engine,runnable,IEngineTask.TASK_DATAEXTRACTION);
  this.report=((ReportRunnable)runnable).getReportIR();
  this.reportDocReader=reader;
  executionContext.setReportDocument(reportDocReader);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
}
Program: 73453
Project: 73453
Buggy source:
public DataExtractionTaskV1(IReportEngine engine,IReportRunnable runnable,IReportDocument reader) throws EngineException {
  super(engine,runnable);
  this.report=((ReportRunnable)runnable).getReportIR();
  this.reportDocReader=reader;
  executionContext.setReportDocument(reportDocReader);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
  setParameterValues(reportDocReader.getParameterValues());
  setParameterDisplayTexts(reportDocReader.getParameterDisplayTexts());
  usingParameterValues();
  executionContext.registerGlobalBeans(reportDocReader.getGlobalVariables(null));
  Map appContext=executionContext.getAppContext();
  IDataEngine dataEngine=executionContext.getDataEngine();
  dataEngine.prepare(report,appContext);
}

Fixed version (ground truth):
public DataExtractionTaskV1(ReportEngine engine,IReportRunnable runnable,IReportDocument reader) throws EngineException {
  super(engine,runnable);
  this.report=((ReportRunnable)runnable).getReportIR();
  this.reportDocReader=reader;
  executionContext.setReportDocument(reportDocReader);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
  setParameterValues(reportDocReader.getParameterValues());
  setParameterDisplayTexts(reportDocReader.getParameterDisplayTexts());
  usingParameterValues();
  executionContext.registerGlobalBeans(reportDocReader.getGlobalVariables(null));
  Map appContext=executionContext.getAppContext();
  IDataEngine dataEngine=executionContext.getDataEngine();
  dataEngine.prepare(report,appContext);
}
Program: 73455
Project: 73455
Buggy source:
/** 
 * createGetParameterDefinitionTask.
 * @param runnable
 * @return the get parameter definition task
 */
public IGetParameterDefinitionTask createGetParameterDefinitionTask(IReportRunnable runnable,InputOptions options){
  IGetParameterDefinitionTask task=null;
  try {
    HttpServletRequest request=(HttpServletRequest)options.getOption(InputOptions.OPT_REQUEST);
    Locale locale=(Locale)options.getOption(InputOptions.OPT_LOCALE);
    task=engine.createGetParameterDefinitionTask(runnable);
    task.setLocale(locale);
    Map context=BirtUtility.getAppContext(request,ReportEngineService.class.getClassLoader());
    task.setAppContext(context);
  }
 catch (  Exception e) {
  }
  return task;
}

Fixed version (ground truth):
/** 
 * createGetParameterDefinitionTask.
 * @param runnable
 * @return the get parameter definition task
 */
public IGetParameterDefinitionTask createGetParameterDefinitionTask(IReportRunnable runnable,InputOptions options){
  IGetParameterDefinitionTask task=null;
  try {
    HttpServletRequest request=(HttpServletRequest)options.getOption(InputOptions.OPT_REQUEST);
    Locale locale=(Locale)options.getOption(InputOptions.OPT_LOCALE);
    task=engine.createGetParameterDefinitionTask(runnable);
    task.setLocale(locale);
    Map context=BirtUtility.getAppContext(request);
    task.setAppContext(context);
  }
 catch (  Exception e) {
  }
  return task;
}
Program: 73457
Project: 73457
Buggy source:
/** 
 * Returns app context
 * @param request
 * @param loader
 * @return
 */
public static Map getAppContext(HttpServletRequest request,ClassLoader loader){
  HashMap context=new HashMap();
  Boolean isDesigner=Boolean.valueOf(ParameterAccessor.isDesigner(request));
  context.put("String_Node_Str",isDesigner);
  context.put(EngineConstants.APPCONTEXT_BIRT_VIEWER_HTTPSERVET_REQUEST,request);
  context.put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY,loader);
  context.put(EngineConstants.APPCONTEXT_CHART_RESOLUTION,ParameterAccessor.getDpi(request));
  int maxCubeRowLevels=ParameterAccessor.getMaxCubeRowLevels(request);
  if (maxCubeRowLevels >= 0)   context.put(DataEngine.CUBECUSROR_FETCH_LIMIT_ON_ROW_EDGE,new Integer(maxCubeRowLevels));
  int maxCubeColumnLevels=ParameterAccessor.getMaxCubeColumnLevels(request);
  if (maxCubeColumnLevels >= 0)   context.put(DataEngine.CUBECURSOR_FETCH_LIMIT_ON_COLUMN_EDGE,new Integer(maxCubeColumnLevels));
  int cubeMemorySize=ParameterAccessor.getCubeMemorySize(request);
  if (cubeMemorySize >= 0)   context.put(DataEngine.IN_MEMORY_CUBE_SIZE,new Integer(cubeMemorySize));
  ParameterAccessor.pushAppContext(context,request);
  return context;
}

Fixed version (ground truth):
/** 
 * Returns appcontext
 * @param request
 * @return
 */
public static Map getAppContext(HttpServletRequest request){
  HashMap context=new HashMap();
  Boolean isDesigner=Boolean.valueOf(ParameterAccessor.isDesigner(request));
  context.put("String_Node_Str",isDesigner);
  context.put(EngineConstants.APPCONTEXT_BIRT_VIEWER_HTTPSERVET_REQUEST,request);
  context.put(EngineConstants.APPCONTEXT_CHART_RESOLUTION,ParameterAccessor.getDpi(request));
  int maxCubeRowLevels=ParameterAccessor.getMaxCubeRowLevels(request);
  if (maxCubeRowLevels >= 0)   context.put(DataEngine.CUBECUSROR_FETCH_LIMIT_ON_ROW_EDGE,new Integer(maxCubeRowLevels));
  int maxCubeColumnLevels=ParameterAccessor.getMaxCubeColumnLevels(request);
  if (maxCubeColumnLevels >= 0)   context.put(DataEngine.CUBECURSOR_FETCH_LIMIT_ON_COLUMN_EDGE,new Integer(maxCubeColumnLevels));
  int cubeMemorySize=ParameterAccessor.getCubeMemorySize(request);
  if (cubeMemorySize >= 0)   context.put(DataEngine.IN_MEMORY_CUBE_SIZE,new Integer(cubeMemorySize));
  ParameterAccessor.pushAppContext(context,request);
  return context;
}
Program: 73458
Project: 73458
Buggy source:
/** 
 * Draws a line with the line-style specified in advance from the start position to the end position with the given line width, color, and style on the PPT. If the line-style is NOT set before invoking this method, "solid" will be used as the default line-style.
 * @param startX the start X coordinate of the line
 * @param startY the start Y coordinate of the line
 * @param endX the end X coordinate of the line
 * @param endY the end Y coordinate of the line
 * @param width the lineWidth
 * @param color the color of the line
 */
private void drawRawLine(double startX,double startY,double endX,double endY,double width,Color color,String lineStyle){
  print("String_Node_Str" + (++shapeCount) + "String_Node_Str");
  print("String_Node_Str" + startX + "String_Node_Str"+ startY+ "String_Node_Str");
  print("String_Node_Str" + endX + "String_Node_Str"+ endY+ "String_Node_Str");
  print("String_Node_Str" + Integer.toHexString(color.getRGB() & 0x00ffffff) + "String_Node_Str");
  print("String_Node_Str" + width + "String_Node_Str");
  if (lineStyle.equalsIgnoreCase("String_Node_Str")) {
    println("String_Node_Str");
  }
 else   if (lineStyle.equalsIgnoreCase("String_Node_Str")) {
    println("String_Node_Str");
  }
 else   if (lineStyle.equalsIgnoreCase("String_Node_Str")) {
    println("String_Node_Str");
  }
 else {
    println("String_Node_Str");
    return;
  }
  println("String_Node_Str");
  println("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Draws a line with the line-style specified in advance from the start position to the end position with the given line width, color, and style on the PPT. If the line-style is NOT set before invoking this method, "solid" will be used as the default line-style.
 * @param startX the start X coordinate of the line
 * @param startY the start Y coordinate of the line
 * @param endX the end X coordinate of the line
 * @param endY the end Y coordinate of the line
 * @param width the lineWidth
 * @param color the color of the line
 */
private void drawRawLine(double startX,double startY,double endX,double endY,double width,Color color,String lineStyle){
  print("String_Node_Str" + (++shapeCount) + "String_Node_Str");
  print("String_Node_Str" + startX + "String_Node_Str"+ startY+ "String_Node_Str");
  print("String_Node_Str" + endX + "String_Node_Str"+ endY+ "String_Node_Str");
  print("String_Node_Str" + getColorString(color) + "String_Node_Str");
  print("String_Node_Str" + width + "String_Node_Str");
  if (lineStyle.equalsIgnoreCase("String_Node_Str")) {
    println("String_Node_Str");
  }
 else   if (lineStyle.equalsIgnoreCase("String_Node_Str")) {
    println("String_Node_Str");
  }
 else   if (lineStyle.equalsIgnoreCase("String_Node_Str")) {
    println("String_Node_Str");
  }
 else {
    println("String_Node_Str");
    return;
  }
  println("String_Node_Str");
  println("String_Node_Str");
}
Program: 73461
Project: 73461
Buggy source:
void setDataSet(String datasetName){
  try {
    if (itemHandle.getDataBindingType() == ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF) {
      itemHandle.setDataBindingReference(null);
    }
    itemHandle.setCube(null);
    if (datasetName == null) {
      if (getBoundDataSet() != null) {
        clearBindings();
      }
      itemHandle.setDataSet(null);
    }
 else {
      DataSetHandle dataset=getReportDesignHandle().findDataSet(datasetName);
      if (itemHandle.getDataSet() != dataset) {
        itemHandle.setDataSet(dataset);
        clearBindings();
        generateBindings(generateComputedColumns(dataset));
      }
    }
  }
 catch (  SemanticException e) {
    ChartWizard.showException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
void setDataSet(String datasetName){
  try {
    boolean isPreviousDataBindingReference=false;
    if (itemHandle.getDataBindingType() == ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF) {
      isPreviousDataBindingReference=true;
      itemHandle.setDataBindingReference(null);
    }
    itemHandle.setCube(null);
    if (datasetName == null) {
      if (getBoundDataSet() != null) {
        clearBindings();
      }
      itemHandle.setDataSet(null);
    }
 else {
      DataSetHandle dataset=getReportDesignHandle().findDataSet(datasetName);
      if (isPreviousDataBindingReference || itemHandle.getDataSet() != dataset) {
        itemHandle.setDataSet(dataset);
        clearBindings();
        generateBindings(generateComputedColumns(dataset));
      }
    }
  }
 catch (  SemanticException e) {
    ChartWizard.showException(e.getLocalizedMessage());
  }
}
Program: 73462
Project: 73462
Buggy source:
public String getDisplayExpression(){
  if (cmbDefinition != null && isTableSharedBinding()) {
    Object[] data=(Object[])cmbDefinition.getData();
    for (int i=0; data != null && i < data.length; i++) {
      ColumnBindingInfo chi=(ColumnBindingInfo)data[i];
      if (chi.getExpression().equals(query.getDefinition())) {
        if (queryType == ChartUIConstants.QUERY_CATEGORY || queryType == ChartUIConstants.QUERY_OPTIONAL) {
          boolean sdGrouped=seriesdefinition.getGrouping().isEnabled();
          boolean groupedBinding=(chi.getColumnType() == ColumnBindingInfo.GROUP_COLUMN);
          if (sdGrouped == groupedBinding) {
            return cmbDefinition.getItem(i);
          }
        }
      }
    }
    return query.getDefinition();
  }
 else {
    return query.getDefinition();
  }
}

Fixed version (ground truth):
public String getDisplayExpression(){
  if (cmbDefinition != null && isTableSharedBinding()) {
    Object[] data=(Object[])cmbDefinition.getData();
    for (int i=0; data != null && i < data.length; i++) {
      ColumnBindingInfo chi=(ColumnBindingInfo)data[i];
      if (chi.getExpression().equals(query.getDefinition())) {
        if (queryType == ChartUIConstants.QUERY_CATEGORY || queryType == ChartUIConstants.QUERY_OPTIONAL) {
          boolean sdGrouped=seriesdefinition.getGrouping().isEnabled();
          boolean groupedBinding=(chi.getColumnType() == ColumnBindingInfo.GROUP_COLUMN);
          if (sdGrouped == groupedBinding) {
            String expr=cmbDefinition.getItem(i);
            return (expr == null) ? "String_Node_Str" : expr;
          }
        }
      }
    }
    String expr=query.getDefinition();
    return (expr == null) ? "String_Node_Str" : expr;
  }
 else {
    String expr=query.getDefinition();
    return (expr == null) ? "String_Node_Str" : expr;
  }
}
Program: 73464
Project: 73464
Buggy source:
public void deserialize(InputStream is){
  try {
    ObjectInputStream ois=new ObjectInputStream(is){
      protected Class resolveClass(      ObjectStreamClass desc) throws IOException, ClassNotFoundException {
        if ("String_Node_Str".equals(desc.getName())) {
          return ChartScriptContext.class;
        }
        return super.resolveClass(desc);
      }
    }
;
    Object o=ois.readObject();
    if (o instanceof RunTimeContext) {
      RunTimeContext drtc=(RunTimeContext)o;
      if (rtc != null) {
        drtc.setULocale(rtc.getULocale());
        drtc.setScale(rtc.getScale());
      }
      rtc=drtc;
      cm=rtc.getScriptContext().getChartInstance();
      if (cm != null && handle != null) {
        IReportItem item=handle.getReportItem();
        ((ChartReportItemImpl)item).setModel(cm);
        ((ChartReportItemImpl)item).setScale(rtc.getScale());
      }
      Object oMaxRow=context.getAppContext().get(EngineConstants.PROPERTY_EXTENDED_ITEM_MAX_ROW);
      if (oMaxRow != null) {
        rtc.putState(ChartUtil.CHART_MAX_ROW,oMaxRow);
      }
 else {
        oMaxRow=context.getGlobalVariable(EngineConstants.PROPERTY_EXTENDED_ITEM_MAX_ROW);
        if (oMaxRow != null) {
          rtc.putState(ChartUtil.CHART_MAX_ROW,oMaxRow);
        }
      }
    }
    ois.close();
  }
 catch (  Exception e) {
    logger.log(e);
  }
}

Fixed version (ground truth):
public void deserialize(InputStream is){
  try {
    ObjectInputStream ois=new ObjectInputStream(is){
      protected Class resolveClass(      ObjectStreamClass desc) throws IOException, ClassNotFoundException {
        if ("String_Node_Str".equals(desc.getName())) {
          return ChartScriptContext.class;
        }
        return super.resolveClass(desc);
      }
    }
;
    Object o=ois.readObject();
    if (o instanceof RunTimeContext) {
      RunTimeContext drtc=(RunTimeContext)o;
      if (rtc != null) {
        drtc.setULocale(rtc.getULocale());
        drtc.setScale(rtc.getScale());
      }
      rtc=drtc;
      Object oMaxRow=context.getAppContext().get(EngineConstants.PROPERTY_EXTENDED_ITEM_MAX_ROW);
      if (oMaxRow != null) {
        rtc.putState(ChartUtil.CHART_MAX_ROW,oMaxRow);
      }
 else {
        oMaxRow=context.getGlobalVariable(EngineConstants.PROPERTY_EXTENDED_ITEM_MAX_ROW);
        if (oMaxRow != null) {
          rtc.putState(ChartUtil.CHART_MAX_ROW,oMaxRow);
        }
      }
    }
    ois.close();
  }
 catch (  Exception e) {
    logger.log(e);
  }
}
Program: 73465
Project: 73465
Buggy source:
protected void populateFieldIndexMap(){
  for (int i=0; i < resultSet.getLevelCount(); i++) {
    DimLevel level=resultSet.getAllLevels()[i];
    for (int j=0; j < resultSet.getLevelKeyColCount(i); j++) {
      String levelKeyName=resultSet.getLevelKeyName(i,j);
      String name=OlapExpressionUtil.getAttrReference(level.getDimensionName(),level.getLevelName(),levelKeyName);
      fieldIndexMap.put(name,new AggregationKeyIndex(i,j));
    }
    String[] attrNames=resultSet.getLevelAttributes(i);
    if (attrNames != null) {
      for (int j=0; j < attrNames.length; j++) {
        String name=OlapExpressionUtil.getAttrReference(level.getDimensionName(),level.getLevelName(),attrNames[j]);
        fieldIndexMap.put(name,new AggregationAttrIndex(i,j));
      }
    }
  }
}

Fixed version (ground truth):
protected void populateFieldIndexMap(){
  for (int i=0; i < resultSet.getLevelCount(); i++) {
    DimLevel level=resultSet.getAllLevels()[i];
    for (int j=0; j < resultSet.getLevelKeyColCount(i); j++) {
      String levelKeyName=resultSet.getLevelKeyName(i,j);
      String name=OlapExpressionUtil.getAttrReference(level.getDimensionName(),level.getLevelName(),levelKeyName);
      fieldIndexMap.put(name,new AggregationKeyIndex(i,j));
    }
    String[] attrNames=resultSet.getLevelAttributes(i);
    if (attrNames != null) {
      for (int j=0; j < attrNames.length; j++) {
        String attrName=parseAttributeName(attrNames[j]);
        String name=OlapExpressionUtil.getAttrReference(level.getDimensionName(),level.getLevelName(),attrName);
        fieldIndexMap.put(name,new AggregationAttrIndex(i,j));
      }
    }
  }
}
Program: 73466
Project: 73466
Buggy source:
protected void populateFieldIndexMap(){
  fieldIndexMap=new HashMap();
  ILevel[] levels=dimension.getHierarchy().getLevels();
  for (int i=0; i < levels.length; i++) {
    String[] keyNames=levels[i].getKeyNames();
    if (keyNames != null) {
      for (int j=0; j < keyNames.length; j++) {
        String keyName=OlapExpressionUtil.getAttrReference(dimension.getName(),levels[i].getName(),keyNames[j]);
        fieldIndexMap.put(keyName,new DimensionKeyIndex(i,j));
      }
    }
    String[] attrNames=levels[i].getAttributeNames();
    if (attrNames != null) {
      for (int j=0; j < attrNames.length; j++) {
        String attrName=OlapExpressionUtil.getAttrReference(dimension.getName(),levels[i].getName(),attrNames[j]);
        fieldIndexMap.put(attrName,new DimensionAttrIndex(i,j));
      }
    }
  }
}

Fixed version (ground truth):
protected void populateFieldIndexMap(){
  fieldIndexMap=new HashMap();
  ILevel[] levels=dimension.getHierarchy().getLevels();
  for (int i=0; i < levels.length; i++) {
    String[] keyNames=levels[i].getKeyNames();
    if (keyNames != null) {
      for (int j=0; j < keyNames.length; j++) {
        String name=OlapExpressionUtil.getAttrReference(dimension.getName(),levels[i].getName(),keyNames[j]);
        fieldIndexMap.put(name,new DimensionKeyIndex(i,j));
      }
    }
    String[] attrNames=levels[i].getAttributeNames();
    if (attrNames != null) {
      for (int j=0; j < attrNames.length; j++) {
        String attrName=parseAttributeName(attrNames[j]);
        String name=OlapExpressionUtil.getAttrReference(dimension.getName(),levels[i].getName(),attrName);
        fieldIndexMap.put(name,new DimensionAttrIndex(i,j));
      }
    }
  }
}
Program: 73467
Project: 73467
Buggy source:
public void testToBoolean(){
  Boolean result;
  for (int i=0; i < testObject.length; i++) {
    try {
      result=DataTypeUtil.toBoolean(testObject[i]);
      if (resultBoolean[i] instanceof Exception)       fail("String_Node_Str");
      assertEquals(result,resultBoolean[i]);
    }
 catch (    BirtException dteEx) {
      if (!(resultBoolean[i] instanceof Exception))       fail("String_Node_Str");
    }
  }
  try {
    assertTrue(DataTypeUtil.toBoolean(new Double(0.1)).booleanValue());
    assertTrue(DataTypeUtil.toBoolean(new Double(-0.1)).booleanValue());
    assertTrue(DataTypeUtil.toBoolean(new Double(1)).booleanValue());
    assertTrue(DataTypeUtil.toBoolean(new Double(1)).booleanValue());
    assertFalse(DataTypeUtil.toBoolean(new Double(0)).booleanValue());
  }
 catch (  BirtException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void testToBoolean(){
  Boolean result;
  for (int i=0; i < testObject.length; i++) {
    System.out.println(i);
    try {
      result=DataTypeUtil.toBoolean(testObject[i]);
      if (resultBoolean[i] instanceof Exception)       fail("String_Node_Str");
      assertEquals(result,resultBoolean[i]);
    }
 catch (    BirtException dteEx) {
      if (!(resultBoolean[i] instanceof Exception))       fail("String_Node_Str");
    }
  }
  try {
    assertTrue(DataTypeUtil.toBoolean(new Double(0.1)).booleanValue());
    assertTrue(DataTypeUtil.toBoolean(new Double(-0.1)).booleanValue());
    assertTrue(DataTypeUtil.toBoolean(new Double(1)).booleanValue());
    assertTrue(DataTypeUtil.toBoolean(new Double(1)).booleanValue());
    assertFalse(DataTypeUtil.toBoolean(new Double(0)).booleanValue());
  }
 catch (  BirtException e) {
    e.printStackTrace();
  }
}
Program: 73469
Project: 73469
Buggy source:
private void computeDateTimeMinMax(){
  int iStep=asInteger(oStep);
  CDateTime cdtMinValue=bMinimumFixed ? asDateTime(oMinFixed) : asDateTime(oMinAuto);
  CDateTime cdtMaxValue=bMaximumFixed ? asDateTime(oMaxFixed) : asDateTime(oMaxAuto);
  if (bMaximumFixed && !bMinimumFixed) {
    oMax=cdtMaxValue;
    double diff=CDateTime.computeDifference(cdtMaxValue,cdtMinValue,iUnit) / iStep;
    int count=(int)diff * iStep;
    if (!ChartUtil.mathEqual(diff,Math.floor(diff))) {
      count+=iStep;
    }
    CDateTime cdtMinValue_new=(CDateTime)cdtMaxValue.clone();
    cdtMinValue_new.add(iUnit,-count);
    oMin=cdtMinValue_new;
  }
 else {
    if (!bMinimumFixed) {
      cdtMinValue.clearBelow(iUnit);
    }
    oMin=cdtMinValue;
    double diff=CDateTime.computeDifference(cdtMaxValue,cdtMinValue,iUnit) / iStep;
    int count=(int)diff * iStep;
    if (!ChartUtil.mathEqual(diff,Math.floor(diff))) {
      count+=iStep;
    }
    CDateTime cdtMaxValue_new=(CDateTime)cdtMinValue.clone();
    cdtMaxValue_new.add(iUnit,count);
    oMax=cdtMaxValue_new;
  }
  oMinAuto=null;
  oMaxAuto=null;
}

Fixed version (ground truth):
private void computeDateTimeMinMax(){
  int iStep=asInteger(oStep);
  CDateTime cdtMinValue=bMinimumFixed ? asDateTime(oMinFixed) : asDateTime(oMinAuto);
  CDateTime cdtMaxValue=bMaximumFixed ? asDateTime(oMaxFixed) : asDateTime(oMaxAuto);
  if (bMaximumFixed && !bMinimumFixed) {
    oMax=cdtMaxValue;
    double diff=CDateTime.computeDifference(cdtMaxValue,cdtMinValue,iUnit) / iStep;
    int count=(int)diff * iStep;
    if (!ChartUtil.mathEqual(diff,Math.floor(diff))) {
      count+=iStep;
    }
    CDateTime cdtMinValue_new=(CDateTime)cdtMaxValue.clone();
    cdtMinValue_new.add(iUnit,-count);
    oMin=cdtMinValue_new;
  }
 else {
    if (!bMinimumFixed) {
      cdtMinValue=cdtMinValue.backward(iUnit,iStep);
      cdtMinValue.clearBelow(iUnit);
      if (!bMaximumFixed) {
        cdtMaxValue=cdtMaxValue.forward(iUnit,iStep);
        cdtMaxValue.clearBelow(iUnit);
      }
    }
    oMin=cdtMinValue;
    double diff=CDateTime.computeDifference(cdtMaxValue,cdtMinValue,iUnit) / iStep;
    int count=(int)diff * iStep;
    if (!ChartUtil.mathEqual(diff,Math.floor(diff))) {
      count+=iStep;
    }
    CDateTime cdtMaxValue_new=(CDateTime)cdtMinValue.clone();
    cdtMaxValue_new.add(iUnit,count);
    oMax=cdtMaxValue_new;
  }
  oMinAuto=null;
  oMaxAuto=null;
}
Program: 73470
Project: 73470
Buggy source:
/** 
 * Checks if the datetime data point entry is in the range of plot area. Default result is 0, inside.
 * @param entry data point entry
 * @param min scale min
 * @param max scale max
 * @return int indicates if data point entry is in the range of plot area. 0inside, 1 left side, 2 outside
 */
protected final int checkEntryInDatetimeRange(CDateTime entry,Object min,Object max){
  int iOutside=0;
  CDateTime cmin=Methods.asDateTime(min);
  CDateTime cmax=Methods.asDateTime(max);
  if (entry.before(cmin)) {
    iOutside=1;
  }
 else   if (entry.after(cmax)) {
    iOutside=2;
  }
  return iOutside;
}

Fixed version (ground truth):
/** 
 * Checks if the datetime data point entry is in the range of plot area. Default result is 0, inside.
 * @param entry data point entry
 * @param min scale min
 * @param max scale max
 * @return int indicates if data point entry is in the range of plot area. 0inside, 1 left side, 2 outside
 */
protected final int checkEntryInDatetimeRange(CDateTime entry,Object min,Object max){
  int iOutside=0;
  CDateTime cmin=Methods.asDateTime(min);
  CDateTime cmax=Methods.asDateTime(max);
  if (entry.before(cmin)) {
    if (CDateTime.getDifference(entry,cmin) != 0) {
      iOutside=1;
    }
  }
 else   if (entry.after(cmax)) {
    if (CDateTime.getDifference(entry,cmax) != 0) {
      iOutside=2;
    }
  }
  return iOutside;
}
Program: 73471
Project: 73471
Buggy source:
public DataElement getDataElement(){
  if (!btnCheck.getSelection()) {
    return null;
  }
  Calendar calendar=Calendar.getInstance();
  calendar.set(pickerDate.getYear(),pickerDate.getMonth(),pickerDate.getDay(),pickerTime.getHours(),pickerTime.getMinutes(),pickerTime.getSeconds());
  return DateTimeDataElementImpl.create(calendar);
}

Fixed version (ground truth):
public DataElement getDataElement(){
  if (!btnCheck.getSelection()) {
    return null;
  }
  Calendar calendar=Calendar.getInstance();
  calendar.set(pickerDate.getYear(),pickerDate.getMonth(),pickerDate.getDay(),pickerTime.getHours(),pickerTime.getMinutes(),pickerTime.getSeconds());
  calendar.set(calendar.MILLISECOND,0);
  return DateTimeDataElementImpl.create(calendar);
}
Program: 73472
Project: 73472
Buggy source:
/** 
 * Returns <code>true</code> if current index is in a comment line, <code>false</code> otherwise.
 * @param index the current index.
 * @return <code>true</code> if current index is in a comment line,<code>false</code> otherwise.
 */
private boolean isCommentLine(int index){
  int start=index;
  while (start > 0 && script.charAt(start - 1) != '\n') {
    if (start < script.length()) {
      if (script.charAt(start) == '/' && script.charAt(start - 1) == '/') {
        return true;
      }
    }
    start--;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns <code>true</code> if current index is in a comment line, <code>false</code> otherwise.
 * @param index the current index.
 * @return <code>true</code> if current index is in a comment line,<code>false</code> otherwise.
 */
private boolean isCommentLine(int index){
  int start=index;
  while (start >= 0 && script.charAt(start) != '\n') {
    if (start + 1 < script.length()) {
      if (script.charAt(start) == '/' && script.charAt(start + 1) == '/') {
        return true;
      }
    }
    start--;
  }
  return false;
}
Program: 73473
Project: 73473
Buggy source:
/** 
 * @param helper
 * @param currentIterator
 */
DummyJSResultSetRow(IExecutorHelper helper,IResultIterator currentIterator){
  this.helper=helper;
  this.currentIterator=currentIterator;
}

Fixed version (ground truth):
/** 
 * @param parentHelper
 * @param currentIterator
 */
DummyJSResultSetRow(IExecutorHelper parentHelper,IResultIterator currentIterator){
  this.parentHelper=parentHelper;
  this.currentIterator=currentIterator;
}
Program: 73474
Project: 73474
Buggy source:
public Object get(String name,Scriptable scope){
  if (ScriptConstants.OUTER_RESULT_KEYWORD.equalsIgnoreCase(name) && this.helper != null) {
    return this.helper.getScriptable();
  }
  try {
    return this.currentIterator.getValue(name);
  }
 catch (  BirtException e) {
    return e;
  }
}

Fixed version (ground truth):
public Object get(String name,Scriptable scope){
  if (ScriptConstants.OUTER_RESULT_KEYWORD.equalsIgnoreCase(name)) {
    if (this.parentHelper == null) {
      return new DataExceptionMocker(new DataException(ResourceConstants.NO_OUTER_RESULTS_EXIST));
    }
 else     return this.parentHelper.getScriptable();
  }
  try {
    return this.currentIterator.getValue(name);
  }
 catch (  BirtException e) {
    return e;
  }
}
Program: 73475
Project: 73475
Buggy source:
/** 
 * Constructor 
 * @param delta
 * @param propertyName
 */
public MoveGuideCommand(int delta,String propertyName){
  super();
  pDelta=delta;
  this.propertyName=propertyName;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param delta
 * @param propertyName
 */
public MoveGuideCommand(int delta,String propertyName){
  super();
  pDelta=delta;
  this.propertyName=propertyName;
}
Program: 73476
Project: 73476
Buggy source:
/** 
 * Ececute this command 
 */
public void execute(){
  ModuleHandle handle=SessionHandleAdapter.getInstance().getReportDesignHandle();
  MasterPageHandle page=SessionHandleAdapter.getInstance().getMasterPageHandle();
  String unit=handle.getDefaultUnits();
  if (unit == null) {
    unit=DesignChoiceConstants.UNITS_IN;
  }
  double value=MetricUtility.pixelToPixelInch(pDelta);
  if (value < 0.0) {
    value=0.0;
  }
  DimensionValue dim=DimensionUtil.convertTo(value,DesignChoiceConstants.UNITS_IN,unit);
  if (DesignerConstants.TRACING_COMMANDS) {
    System.out.println("String_Node_Str" + page.getDisplayLabel() + "String_Node_Str"+ propertyName+ "String_Node_Str"+ dim.toDisplayString());
  }
  try {
    page.setProperty(propertyName,dim);
    if (DesignerConstants.TRACING_COMMANDS) {
      System.out.println("String_Node_Str");
    }
  }
 catch (  SemanticException e) {
    if (DesignerConstants.TRACING_COMMANDS) {
      System.out.println("String_Node_Str");
    }
    logger.log(Level.SEVERE,e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * Ececute this command
 */
public void execute(){
  ModuleHandle handle=SessionHandleAdapter.getInstance().getReportDesignHandle();
  MasterPageHandle page=SessionHandleAdapter.getInstance().getFirstMasterPageHandle(handle);
  String unit=handle.getDefaultUnits();
  if (unit == null) {
    unit=DesignChoiceConstants.UNITS_IN;
  }
  double value=MetricUtility.pixelToPixelInch(pDelta);
  if (value < 0.0) {
    value=0.0;
  }
  DimensionValue dim=DimensionUtil.convertTo(value,DesignChoiceConstants.UNITS_IN,unit);
  if (DesignerConstants.TRACING_COMMANDS) {
    System.out.println("String_Node_Str" + page.getDisplayLabel() + "String_Node_Str"+ propertyName+ "String_Node_Str"+ dim.toDisplayString());
  }
  try {
    page.setProperty(propertyName,dim);
    if (DesignerConstants.TRACING_COMMANDS) {
      System.out.println("String_Node_Str");
    }
  }
 catch (  SemanticException e) {
    if (DesignerConstants.TRACING_COMMANDS) {
      System.out.println("String_Node_Str");
    }
    logger.log(Level.SEVERE,e.getMessage(),e);
  }
}
Program: 73477
Project: 73477
Buggy source:
/** 
 * @deprecated
 * @return Command stack of current session.
 */
public CommandStack getCommandStack(){
  if (getReportDesignHandle() != null) {
    return getReportDesignHandle().getCommandStack();
  }
  return null;
}

Fixed version (ground truth):
public CommandStack getCommandStack(ModuleHandle handle){
  if (handle != null) {
    return handle.getCommandStack();
  }
  return null;
}
Program: 73478
Project: 73478
Buggy source:
/** 
 * @deprecated Gets the first MasterPageHandle
 * @param handle
 * @return
 */
public MasterPageHandle getMasterPageHandle(ModuleHandle handle){
  SlotHandle slotHandle=handle.getMasterPages();
  Iterator iter=slotHandle.iterator();
  return (MasterPageHandle)iter.next();
}

Fixed version (ground truth):
/** 
 * Returns the first master page handle in given module
 * @deprecated use {@link #getFirstMasterPageHandle(ModuleHandle)}
 */
public MasterPageHandle getMasterPageHandle(ModuleHandle handle){
  return getFirstMasterPageHandle(handle);
}
Program: 73479
Project: 73479
Buggy source:
/** 
 * Generates GroupElementHandle for given model list.
 * @param modelList
 * @return
 */
public static GroupElementHandle getGroupElementHandle(List modelList){
  if (SessionHandleAdapter.getInstance().getReportDesignHandle() == null) {
    return GroupElementFactory.newGroupElement(SessionHandleAdapter.getInstance().getReportDesignHandle(),Collections.EMPTY_LIST);
  }
  return GroupElementFactory.newGroupElement(SessionHandleAdapter.getInstance().getReportDesignHandle(),modelList);
}

Fixed version (ground truth):
/** 
 * Generates GroupElementHandle for given model list.
 * @param modelList
 * @return
 */
public static GroupElementHandle getGroupElementHandle(List modelList){
  ModuleHandle handle=SessionHandleAdapter.getInstance().getReportDesignHandle();
  if (handle == null) {
    return GroupElementFactory.newGroupElement(handle,Collections.EMPTY_LIST);
  }
  return GroupElementFactory.newGroupElement(handle,modelList);
}
Program: 73480
Project: 73480
Buggy source:
/** 
 * Get styles
 * @param comparator
 * @return return styles list sortted with given comparator.
 */
public static Iterator getLocalStyles(Comparator comparator){
  List styles=null;
  if (SessionHandleAdapter.getInstance().getReportDesignHandle() instanceof ReportDesignHandle) {
    styles=SessionHandleAdapter.getInstance().getReportDesignHandle().getStyles().getContents();
  }
 else   if (SessionHandleAdapter.getInstance().getReportDesignHandle() instanceof LibraryHandle) {
    styles=new ArrayList();
    ThemeHandle theme=((LibraryHandle)SessionHandleAdapter.getInstance().getReportDesignHandle()).getTheme();
    if (theme != null) {
      styles.addAll(theme.getAllStyles());
    }
  }
  Object[] stylesArray=(styles == null ? new Object[0] : styles.toArray());
  if (comparator != null) {
    Arrays.sort(stylesArray,comparator);
  }
  return Arrays.asList(stylesArray).iterator();
}

Fixed version (ground truth):
/** 
 * Get styles
 * @param comparator
 * @return return styles list sortted with given comparator.
 */
public static Iterator getLocalStyles(Comparator comparator){
  List styles=null;
  ModuleHandle module=SessionHandleAdapter.getInstance().getReportDesignHandle();
  if (module instanceof ReportDesignHandle) {
    styles=module.getStyles().getContents();
  }
 else   if (module instanceof LibraryHandle) {
    styles=new ArrayList();
    ThemeHandle theme=((LibraryHandle)module).getTheme();
    if (theme != null) {
      styles.addAll(theme.getAllStyles());
    }
  }
  Object[] stylesArray=(styles == null ? new Object[0] : styles.toArray());
  if (comparator != null) {
    Arrays.sort(stylesArray,comparator);
  }
  return Arrays.asList(stylesArray).iterator();
}
Program: 73481
Project: 73481
Buggy source:
/** 
 * Get styles
 * @param comparator
 * @return return styles list sortted with given comparator.
 */
public static Iterator getStyles(ThemeHandle theme,Comparator comparator){
  List styles=new ArrayList();
  if (theme != null) {
    styles.addAll(theme.getAllStyles());
  }
 else   if (SessionHandleAdapter.getInstance().getReportDesignHandle() instanceof LibraryHandle) {
    styles=new ArrayList();
    theme=((LibraryHandle)SessionHandleAdapter.getInstance().getReportDesignHandle()).getTheme();
    if (theme != null) {
      styles.addAll(theme.getAllStyles());
    }
  }
  Object[] stylesArray=styles.toArray(new Object[styles.size()]);
  if (comparator != null) {
    Arrays.sort(stylesArray,comparator);
  }
  return Arrays.asList(stylesArray).iterator();
}

Fixed version (ground truth):
/** 
 * Get styles
 * @param comparator
 * @return return styles list sortted with given comparator.
 */
public static Iterator getStyles(ThemeHandle theme,Comparator comparator){
  List styles=new ArrayList();
  if (theme != null) {
    styles.addAll(theme.getAllStyles());
  }
 else {
    ModuleHandle module=SessionHandleAdapter.getInstance().getReportDesignHandle();
    if (module instanceof LibraryHandle) {
      styles=new ArrayList();
      theme=((LibraryHandle)module).getTheme();
      if (theme != null) {
        styles.addAll(theme.getAllStyles());
      }
    }
  }
  Object[] stylesArray=styles.toArray(new Object[styles.size()]);
  if (comparator != null) {
    Arrays.sort(stylesArray,comparator);
  }
  return Arrays.asList(stylesArray).iterator();
}
Program: 73482
Project: 73482
Buggy source:
private DataSetCacheConfig getDataSetCacheConfig(IBaseDataSetDesign dataSetDesign,Map appContect) throws DataException {
  DataSetCacheConfig result=DataSetCacheUtil.getJVMDataSetCacheConfig(appContext,context,session,dataSetDesign);
  if (result == null) {
    result=DataSetCacheUtil.getDteDataSetCacheConfig(queryExecutionHints,dataSetDesign,session);
  }
  return result;
}

Fixed version (ground truth):
private DataSetCacheConfig getDataSetCacheConfig(IBaseDataSetDesign dataSetDesign,Map appContext) throws DataException {
  DataSetCacheConfig result=DataSetCacheUtil.getJVMDataSetCacheConfig(appContext,context,session,dataSetDesign);
  if (result == null) {
    result=DataSetCacheUtil.getDteDataSetCacheConfig(queryExecutionHints,dataSetDesign,session);
  }
  return result;
}
Program: 73483
Project: 73483
Buggy source:
/** 
 * Clear cache
 * @param dataSourceDesign
 * @param dataSetDesign
 * @throws DataException 
 */
public void clearCache(IBaseDataSourceDesign dataSourceDesign,IBaseDataSetDesign dataSetDesign) throws DataException {
  if (dataSourceDesign == null || dataSetDesign == null)   return;
  DataSourceAndDataSet ds=DataSourceAndDataSet.newInstance(dataSourceDesign,dataSetDesign,null);
  switchCacheMap(dataSetDesign);
  cacheMapManager.clearCache(ds);
}

Fixed version (ground truth):
/** 
 * Clear cache
 * @param dataSourceDesign
 * @param dataSetDesign
 * @throws DataException 
 */
public void clearCache(IBaseDataSourceDesign dataSourceDesign,IBaseDataSetDesign dataSetDesign) throws DataException {
  if (dataSourceDesign == null || dataSetDesign == null)   return;
  DataSourceAndDataSet ds=DataSourceAndDataSet.newInstance(dataSourceDesign,dataSetDesign,null);
  jvmLevelCacheMapManager.clearCache(ds);
  dteLevelCacheMapManager.clearCache(ds);
}
Program: 73484
Project: 73484
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 {
  switchCacheMap(dataSet);
  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 {
  IResultClass resultClass=this.jvmLevelCacheMapManager.getCachedResultClass(DataSourceAndDataSet.newInstance(dataSource,dataSet,null));
  if (resultClass != null)   return new ResultMetaData(resultClass);
 else   return null;
}
Program: 73485
Project: 73485
Buggy source:
protected IBaseQueryResults getCachedQueryResult(IDataQueryDefinition query) throws BirtException {
  Object rsetId=cachedQueryToResults.get(query);
  if (rsetId != null) {
    return dteSession.getQueryResults(String.valueOf(rsetId));
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
protected IBaseQueryResults getCachedQueryResult(IBaseQueryDefinition query,IBaseResultSet outer) throws BirtException {
  Object rsetId=cachedQueryToResults.get(query);
  if (rsetId != null) {
    ((QueryDefinition)query).setQueryResultsID((String)rsetId);
    IBasePreparedQuery pQuery=dteSession.prepare(query,null);
    return dteSession.execute(pQuery,outer == null ? null : outer.getQueryResults(),context.getSharedScope());
  }
 else {
    return null;
  }
}