nus-yam/ex-repair huggingface dataset:
Program: 77309
Project: 77309
Buggy source:
public void handleSelectionChanged(ISelection selection){
  if (getSourceViewer() == null || !getSourceViewer().getTextWidget().isVisible()) {
    return;
  }
  if (editorUIEnabled == true) {
    saveModel();
  }
  if (selection != null) {
    settingText=true;
    Object[] sel=((IStructuredSelection)selection).toArray();
    if (sel.length == 1 && sel[0] instanceof DesignElementHandle) {
      editObject=sel[0];
      palettePage.getSupport().setCurrentEditObject(editObject);
      if (editObject instanceof ExtendedItemHandle) {
        disableEditor();
        cmbExpList.removeAll();
        cmbItemLastSelected=null;
        getSourceViewer().getTextWidget().setEnabled(true);
        setEditorText(((ExtendedItemHandle)editObject).getExternalScript());
        context.setVariable("String_Node_Str","String_Node_Str");
      }
 else {
        setComboViewerInput(editObject);
        cmbItemLastSelected=null;
        setEditorText("String_Node_Str");
        if (cmbExpList.getItemCount() > 0) {
          enableEditor();
          selectItemInComboExpList((ISelection)selectionMap.get(getModel()));
        }
 else {
          disableEditor();
        }
      }
      checkDirty();
    }
 else {
      disableEditor();
      cmbExpList.removeAll();
      cmbItemLastSelected=null;
      palettePage.getSupport().setCurrentEditObject(null);
    }
    updateAnnotationLabel(sel.length > 0 ? sel[0] : null);
    settingText=false;
  }
}

Fixed version (ground truth):
public void handleSelectionChanged(ISelection selection){
  if (getSourceViewer() == null || !getSourceViewer().getTextWidget().isVisible()) {
    return;
  }
  if (editorUIEnabled == true) {
    saveModel();
  }
  if (selection != null) {
    settingText=true;
    Object[] sel=((IStructuredSelection)selection).toArray();
    if (sel.length == 1 && sel[0] instanceof DesignElementHandle) {
      editObject=sel[0];
      palettePage.getSupport().setCurrentEditObject(editObject);
      if (editObject instanceof ExtendedItemHandle) {
        disableEditor();
        cmbExpList.removeAll();
        cmbItemLastSelected=null;
        getSourceViewer().getTextWidget().setEnabled(true);
        setEditorText(((ExtendedItemHandle)editObject).getExternalScript());
        context.setVariable("String_Node_Str","String_Node_Str");
      }
 else {
        setComboViewerInput(editObject);
        cmbItemLastSelected=null;
        setEditorText("String_Node_Str");
        if (cmbExpList.getItemCount() > 0) {
          enableEditor();
          selectItemInComboExpList((ISelection)selectionMap.get(getModel()));
        }
 else {
          disableEditor();
        }
      }
      checkDirty();
      palettePage.getSupport().updateParametersTree();
    }
 else {
      disableEditor();
      cmbExpList.removeAll();
      cmbItemLastSelected=null;
      palettePage.getSupport().setCurrentEditObject(null);
    }
    updateAnnotationLabel(sel.length > 0 ? sel[0] : null);
    settingText=false;
  }
}
Program: 77310
Project: 77310
Buggy source:
/** 
 * Sets focus on the palette's control
 * @see Page#setFocus()
 */
public void setFocus(){
  tree.setFocus();
}

Fixed version (ground truth):
/** 
 * Sets focus on the palette's control
 * @see Page#setFocus()
 */
public void setFocus(){
  tree.setFocus();
  treeCommon.updateParametersTree();
}
Program: 77311
Project: 77311
Buggy source:
public void setCurrentEditObject(Object obj){
  this.currentEditObject=obj;
  removeTreeItem();
}

Fixed version (ground truth):
public void setCurrentEditObject(Object obj){
  this.currentEditObject=obj;
  clearTreeItem(contextItem);
}
Program: 77312
Project: 77312
Buggy source:
/** 
 * Create parameters band. Must set Tree before execution.
 */
public void createParamtersTree(){
  Assert.isNotNull(tree);
  TreeItem topItem=createTopTreeItem(tree,TREE_ITEM_PARAMETERS);
  for (Iterator iterator=SessionHandleAdapter.getInstance().getReportDesignHandle().getAllParameters().iterator(); iterator.hasNext(); ) {
    ReportElementHandle handle=(ReportElementHandle)iterator.next();
    if (handle instanceof ParameterHandle) {
      createSubTreeItem(topItem,DEUtil.getDisplayLabel(handle,false),ReportPlatformUIImages.getImage(handle),DEUtil.getExpression(handle),((ParameterHandle)handle).getHelpText(),true);
    }
 else     if (handle instanceof ParameterGroupHandle) {
      TreeItem groupItem=createSubTreeItem(topItem,DEUtil.getDisplayLabel(handle,false),ReportPlatformUIImages.getImage(handle),true);
      for (Iterator itor=((ParameterGroupHandle)handle).getParameters().iterator(); itor.hasNext(); ) {
        ParameterHandle parameter=(ParameterHandle)itor.next();
        createSubTreeItem(groupItem,parameter.getDisplayLabel(),ReportPlatformUIImages.getImage(handle),DEUtil.getExpression(parameter),parameter.getDisplayLabel(),true);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Create parameters band. Must set Tree before execution.
 */
public void createParamtersTree(){
  Assert.isNotNull(tree);
  parametersItem=createTopTreeItem(tree,TREE_ITEM_PARAMETERS);
  buildParameterTree();
}
Program: 77313
Project: 77313
Buggy source:
/** 
 * Create data sets band.Must set Tree before execution.
 */
public void createDataSetsTree(List dataSetList){
  Assert.isNotNull(tree);
  TreeItem topItem=createTopTreeItem(tree,TREE_ITEM_DATASETS);
  for (Iterator iterator=dataSetList.iterator(); iterator.hasNext(); ) {
    DataSetHandle handle=(DataSetHandle)iterator.next();
    TreeItem dataSetItem=createSubTreeItem(topItem,DEUtil.getDisplayLabel(handle,false),ReportPlatformUIImages.getImage(handle),true);
    try {
      CachedMetaDataHandle cachedMetadata=DataSetUIUtil.getCachedMetaDataHandle(handle);
      for (Iterator iter=cachedMetadata.getResultSet().iterator(); iter.hasNext(); ) {
        ResultSetColumnHandle element=(ResultSetColumnHandle)iter.next();
        createSubTreeItem(dataSetItem,element.getColumnName(),IMAGE_COLUMN,DEUtil.getExpression(element),element.getColumnName(),true);
      }
    }
 catch (    SemanticException e) {
    }
  }
}

Fixed version (ground truth):
/** 
 * Create data sets band.Must set Tree before execution.
 */
public void createDataSetsTree(List dataSetList){
  Assert.isNotNull(tree);
  dataSetsItem=createTopTreeItem(tree,TREE_ITEM_DATASETS);
  buildDataSetsTree(dataSetList);
}
Program: 77314
Project: 77314
Buggy source:
/** 
 * Creates context objects tree. Context ojects tree is used in JS editor palette, which displays current object method's arguments.
 */
public void createContextObjects(String methodName){
  if (contextItem != null && !contextItem.isDisposed() && currentEditObject != null && methodName != null) {
    removeTreeItem();
    DesignElementHandle handle=(DesignElementHandle)currentEditObject;
    Map argMap=DEUtil.getDesignElementMethodArguments(handle,methodName);
    for (Iterator iter=argMap.keySet().iterator(); iter.hasNext(); ) {
      String argName=(String)iter.next();
      createSubTreeItem(contextItem,argName,IMAGE_METHOD,argName,"String_Node_Str",true);
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates context objects tree. Context ojects tree is used in JS editor palette, which displays current object method's arguments.
 */
public void createContextObjects(String methodName){
  if (contextItem != null && !contextItem.isDisposed() && currentEditObject != null && methodName != null) {
    clearTreeItem(contextItem);
    DesignElementHandle handle=(DesignElementHandle)currentEditObject;
    Map argMap=DEUtil.getDesignElementMethodArguments(handle,methodName);
    for (Iterator iter=argMap.keySet().iterator(); iter.hasNext(); ) {
      String argName=(String)iter.next();
      createSubTreeItem(contextItem,argName,IMAGE_METHOD,argName,"String_Node_Str",true);
    }
  }
}
Program: 77315
Project: 77315
Buggy source:
/** 
 * @param dateStyle
 * @param locale
 * @return
 */
public static DateFormat getDateInstance(int dateStyle,ULocale locale){
  String key=String.valueOf(dateStyle) + "String_Node_Str" + locale.getName();
  DateFormat result=(DateFormat)dateFormatHolder.get(key);
  if (result == null) {
synchronized (dateTimeFormatholder) {
      result=(DateFormat)dateFormatHolder.get(key);
      if (result == null) {
        result=DateFormat.getDateInstance(dateStyle,locale);
        dateFormatHolder.put(key,result);
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @param dateStyle
 * @param locale
 * @return
 */
public static DateFormat getDateInstance(int dateStyle,ULocale locale){
  String key=String.valueOf(dateStyle) + "String_Node_Str" + locale.getName();
  DateFormat result=(DateFormat)dateFormatHolder.get(key);
  if (result == null) {
synchronized (dateTimeFormatholder) {
      result=(DateFormat)dateFormatHolder.get(key);
      if (result == null) {
        result=DateFormat.getDateInstance(dateStyle,locale);
        result.setLenient(false);
        dateFormatHolder.put(key,result);
      }
    }
  }
  return result;
}
Program: 77316
Project: 77316
Buggy source:
/** 
 * @param dateStyle
 * @param timeStyle
 * @param locale
 * @return
 */
public static DateFormat getDateTimeInstance(int dateStyle,int timeStyle,ULocale locale){
  String key=String.valueOf(dateStyle) + "String_Node_Str" + String.valueOf(timeStyle)+ "String_Node_Str"+ locale.getName();
  DateFormat result=(DateFormat)dateTimeFormatholder.get(key);
  if (result == null) {
synchronized (dateTimeFormatholder) {
      result=(DateFormat)dateTimeFormatholder.get(key);
      if (result == null) {
        result=DateFormat.getDateTimeInstance(dateStyle,timeStyle,locale);
        dateTimeFormatholder.put(key,result);
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @param dateStyle
 * @param timeStyle
 * @param locale
 * @return
 */
public static DateFormat getDateTimeInstance(int dateStyle,int timeStyle,ULocale locale){
  String key=String.valueOf(dateStyle) + "String_Node_Str" + String.valueOf(timeStyle)+ "String_Node_Str"+ locale.getName();
  DateFormat result=(DateFormat)dateTimeFormatholder.get(key);
  if (result == null) {
synchronized (dateTimeFormatholder) {
      result=(DateFormat)dateTimeFormatholder.get(key);
      if (result == null) {
        result=DateFormat.getDateTimeInstance(dateStyle,timeStyle,locale);
        result.setLenient(false);
        dateTimeFormatholder.put(key,result);
      }
    }
  }
  return result;
}
Program: 77317
Project: 77317
Buggy source:
public Object visitAutoText(IAutoTextContent autoText,Object value){
  if (IAutoTextContent.PAGE_NUMBER == autoText.getType()) {
    String originalPageNumber=autoText.getText();
    NumberFormatter nf=new NumberFormatter();
    String patternStr=autoText.getComputedStyle().getNumberFormat();
    nf.applyPattern(patternStr);
    autoText.setText(nf.format(Integer.parseInt(originalPageNumber)));
    return handleText(autoText);
  }
  return new PDFTemplateLM(context,parent,autoText,executor);
}

Fixed version (ground truth):
public Object visitAutoText(IAutoTextContent autoText,Object value){
  if (IAutoTextContent.PAGE_NUMBER == autoText.getType()) {
    if (parent instanceof PDFLineAreaLM) {
      String originalPageNumber=autoText.getText();
      NumberFormatter nf=new NumberFormatter();
      String patternStr=autoText.getComputedStyle().getNumberFormat();
      nf.applyPattern(patternStr);
      try {
        autoText.setText(nf.format(Integer.parseInt(originalPageNumber)));
      }
 catch (      NumberFormatException nfe) {
        autoText.setText(originalPageNumber);
      }
    }
    return handleText(autoText);
  }
  return new PDFTemplateLM(context,parent,autoText,executor);
}
Program: 77318
Project: 77318
Buggy source:
public IParameterDefnBase getParameterDefn(String name){
  IParameterDefnBase ret=null;
  if (name == null) {
    return ret;
  }
  Collection original=((ReportRunnable)runnable).getParameterDefns(true);
  Iterator iter=original.iterator();
  while (iter.hasNext()) {
    ParameterDefnBase pBase=(ParameterDefnBase)iter.next();
    if (name.equals(pBase.getName())) {
      try {
        ret=(IParameterDefnBase)pBase.clone();
        break;
      }
 catch (      CloneNotSupportedException e) {
        log.log(Level.SEVERE,e.getMessage(),e);
      }
    }
  }
  if (ret != null) {
    if (ret instanceof ScalarParameterDefn) {
      ((ScalarParameterDefn)ret).setReportDesign((ReportDesignHandle)runnable.getDesignHandle());
      ((ScalarParameterDefn)ret).setLocale(locale);
      ((ScalarParameterDefn)ret).evaluateSelectionList();
    }
 else     if (ret instanceof ParameterGroupDefn) {
      Iterator iter2=((ParameterGroupDefn)ret).getContents().iterator();
      while (iter2.hasNext()) {
        IParameterDefnBase p=(IParameterDefnBase)iter2.next();
        if (p instanceof ScalarParameterDefn) {
          ((ScalarParameterDefn)p).setReportDesign((ReportDesignHandle)runnable.getDesignHandle());
          ((ScalarParameterDefn)p).setLocale(locale);
          ((ScalarParameterDefn)p).evaluateSelectionList();
        }
      }
    }
  }
  return ret;
}

Fixed version (ground truth):
public IParameterDefnBase getParameterDefn(String name){
  IParameterDefnBase ret=null;
  if (name == null) {
    return ret;
  }
  Collection original=((ReportRunnable)runnable).getParameterDefns(true);
  Iterator iter=original.iterator();
  while (iter.hasNext()) {
    ret=getParamDefnBaseByName((ParameterDefnBase)iter.next(),name);
    if (ret != null)     break;
  }
  if (ret != null) {
    if (ret instanceof ScalarParameterDefn) {
      ((ScalarParameterDefn)ret).setReportDesign((ReportDesignHandle)runnable.getDesignHandle());
      ((ScalarParameterDefn)ret).setLocale(locale);
      ((ScalarParameterDefn)ret).evaluateSelectionList();
    }
 else     if (ret instanceof ParameterGroupDefn) {
      Iterator iter2=((ParameterGroupDefn)ret).getContents().iterator();
      while (iter2.hasNext()) {
        IParameterDefnBase p=(IParameterDefnBase)iter2.next();
        if (p instanceof ScalarParameterDefn) {
          ((ScalarParameterDefn)p).setReportDesign((ReportDesignHandle)runnable.getDesignHandle());
          ((ScalarParameterDefn)p).setLocale(locale);
          ((ScalarParameterDefn)p).evaluateSelectionList();
        }
      }
    }
  }
  return ret;
}
Program: 77319
Project: 77319
Buggy source:
protected Object getRenderContext(IReportContext context){
  Map appContext=context.getAppContext();
  if (appContext != null) {
    String renderContextKey=EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT;
    String format=context.getOutputFormat();
    if ("String_Node_Str".equalsIgnoreCase(format)) {
      renderContextKey=EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT;
    }
    return appContext.get(renderContextKey);
  }
  return null;
}

Fixed version (ground truth):
protected Object getRenderContext(IReportContext context){
  if (context == null) {
    return null;
  }
  Map appContext=context.getAppContext();
  if (appContext != null) {
    String renderContextKey=EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT;
    String format=context.getOutputFormat();
    if ("String_Node_Str".equalsIgnoreCase(format)) {
      renderContextKey=EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT;
    }
    return appContext.get(renderContextKey);
  }
  return null;
}
Program: 77320
Project: 77320
Buggy source:
public IReportContext getReportContext(){
  return task.getReportContext();
}

Fixed version (ground truth):
public IReportContext getReportContext(){
  if (task == null) {
    return null;
  }
  return task.getReportContext();
}
Program: 77321
Project: 77321
Buggy source:
/** 
 */
public void test_136279(){
  IMetaDataDictionary dict=MetaDataDictionary.getInstance();
  IChoiceSet datatypes=dict.getChoiceSet("String_Node_Str");
  IChoice[] choices=datatypes.getChoices();
  assertEquals("String_Node_Str",choices[0].getName());
  assertEquals("String_Node_Str",choices[1].getName());
  assertEquals("String_Node_Str",choices[2].getName());
  assertEquals("String_Node_Str",choices[3].getName());
  assertEquals("String_Node_Str",choices[4].getName());
  assertEquals("String_Node_Str",choices[5].getName());
  assertEquals(6,choices.length);
}

Fixed version (ground truth):
/** 
 */
public void test_136279(){
  IMetaDataDictionary dict=MetaDataDictionary.getInstance();
  IChoiceSet datatypes=dict.getChoiceSet("String_Node_Str");
  IChoice[] choices=datatypes.getChoices();
  boolean valid=true;
  for (int i=0; i < choices.length; i++) {
    if ("String_Node_Str".equals(choices[i].getName()) || "String_Node_Str".equals(choices[i].getName())) {
      valid=false;
      break;
    }
  }
  assertTrue(valid);
}
Program: 77324
Project: 77324
Buggy source:
protected void repeatHeader(){
  if (isFirst) {
    isFirst=false;
    return;
  }
  ITableBandContent header=(ITableBandContent)tableContent.getHeader();
  if (!repeatHeader || header == null) {
    return;
  }
  if (header.getChildren().isEmpty()) {
    return;
  }
  if (child != null) {
    IContent content=child.getContent();
    if (content instanceof ITableBandContent) {
      if (((ITableBandContent)content).getBandType() == IBandContent.BAND_HEADER) {
        return;
      }
    }
  }
  PDFReportLayoutEngine engine=context.getLayoutEngine();
  PDFLayoutEngineContext con=new PDFLayoutEngineContext(engine);
  con.setFactory(new PDFLayoutManagerFactory(con));
  con.setFormat(context.getFormat());
  con.setAllowPageBreak(false);
  IReportItemExecutor headerExecutor=new DOMReportItemExecutor(header);
  headerExecutor.execute();
  PDFTableRegionLM regionLM=new PDFTableRegionLM(con,tableContent,layoutInfo);
  regionLM.initialize(header,null);
  regionLM.layout();
  TableArea tableRegion=(TableArea)tableContent.getExtension(IContent.LAYOUT_EXTENSION);
  if (tableRegion != null && tableRegion.getHeight() < this.getMaxAvaHeight() - currentBP) {
    Iterator iter=tableRegion.getChildren();
    RowArea row=null;
    while (iter.hasNext()) {
      row=(RowArea)iter.next();
      addArea(row);
      repeatRowCount++;
    }
    if (row != null) {
      removeBottomBorder(row);
    }
  }
  tableContent.setExtension(IContent.LAYOUT_EXTENSION,null);
}

Fixed version (ground truth):
protected void repeatHeader(){
  if (isFirst) {
    isFirst=false;
    return;
  }
  ITableBandContent header=(ITableBandContent)tableContent.getHeader();
  if (!repeatHeader || header == null) {
    return;
  }
  if (header.getChildren().isEmpty()) {
    return;
  }
  if (child != null) {
    IContent content=child.getContent();
    if (content instanceof ITableBandContent) {
      if (((ITableBandContent)content).getBandType() == IBandContent.BAND_HEADER) {
        return;
      }
    }
  }
  PDFReportLayoutEngine engine=context.getLayoutEngine();
  PDFLayoutEngineContext con=new PDFLayoutEngineContext(engine);
  con.setFactory(new PDFLayoutManagerFactory(con));
  con.setFormat(context.getFormat());
  con.setMaxHeight(context.getMaxHeight());
  con.setAllowPageBreak(false);
  IReportItemExecutor headerExecutor=new DOMReportItemExecutor(header);
  headerExecutor.execute();
  PDFTableRegionLM regionLM=new PDFTableRegionLM(con,tableContent,layoutInfo);
  regionLM.initialize(header,null);
  regionLM.layout();
  TableArea tableRegion=(TableArea)tableContent.getExtension(IContent.LAYOUT_EXTENSION);
  if (tableRegion != null && tableRegion.getHeight() < this.getMaxAvaHeight() - currentBP) {
    Iterator iter=tableRegion.getChildren();
    RowArea row=null;
    while (iter.hasNext()) {
      row=(RowArea)iter.next();
      addArea(row);
      repeatRowCount++;
    }
    if (row != null) {
      removeBottomBorder(row);
    }
  }
  tableContent.setExtension(IContent.LAYOUT_EXTENSION,null);
}
Program: 77325
Project: 77325
Buggy source:
protected void newContext(){
  createRoot();
  buildTableLayoutInfo();
  root.setWidth(layoutInfo.getTableWidth());
  setMaxAvaHeight(getAvaHeight());
  setMaxAvaWidth(layoutInfo.getTableWidth());
  setCurrentIP(0);
  setCurrentBP(0);
  repeatRowCount=0;
  rowCount=0;
  setCurrentIP(0);
}

Fixed version (ground truth):
protected void newContext(){
  createRoot();
  buildTableLayoutInfo();
  root.setWidth(layoutInfo.getTableWidth());
  setMaxAvaHeight(getAvaHeight());
  setMaxAvaWidth(layoutInfo.getTableWidth());
  setCurrentIP(0);
  setCurrentBP(0);
  repeatRowCount=0;
  rowCount=0;
  lastRowArea=null;
  setCurrentIP(0);
}
Program: 77327
Project: 77327
Buggy source:
public void initialize(ITableBandContent content,RowArea lastRowArea){
  this.executor=new DOMReportItemExecutor(content);
  this.executor.execute();
  this.lastRowArea=lastRowArea;
}

Fixed version (ground truth):
public void initialize(ITableBandContent content,RowArea lastRowArea){
  this.executor=new DOMReportItemExecutor(content);
  this.executor.execute();
  this.lastRow=lastRowArea;
}
Program: 77328
Project: 77328
Buggy source:
/** 
 * Delete folder
 * @param dirStr
 */
private void deleteDir(String dirStr){
  File sessionsFolder=new File(dirStr);
  File[] sessionFiles=sessionsFolder.listFiles();
  for (int i=0; i < sessionFiles.length; i++)   sessionFiles[i].delete();
  sessionsFolder.delete();
}

Fixed version (ground truth):
/** 
 * Delete folder
 * @param dirStr
 */
private void deleteDir(String dirStr){
  File sessionsFolder=new File(dirStr);
  if (!sessionsFolder.exists())   return;
  File[] sessionFiles=sessionsFolder.listFiles();
  for (int i=0; i < sessionFiles.length; i++)   sessionFiles[i].delete();
  sessionsFolder.delete();
}
Program: 77329
Project: 77329
Buggy source:
/** 
 * @return temp root dir directory
 */
private void createTempRootDir(){
  if (tempRootDirStr != null)   return;
  String tempDirStr=System.getProperty("String_Node_Str");
  File tempDtEDir=new File(tempDirStr,"String_Node_Str");
  if (tempDtEDir.exists() == false) {
    tempDtEDir.mkdir();
  }
 else {
    File[] sessionsFolder=tempDtEDir.listFiles();
    for (int i=0; i < sessionsFolder.length; i++) {
      File[] oneSessionFolder=sessionsFolder[i].listFiles();
      for (int j=0; j < oneSessionFolder.length; j++) {
        if (oneSessionFolder[j].isDirectory()) {
          File[] oneSessionTempFiles=oneSessionFolder[j].listFiles();
          for (int k=0; k < oneSessionTempFiles.length; k++) {
            oneSessionTempFiles[k].delete();
          }
          oneSessionFolder[j].delete();
        }
 else {
          oneSessionFolder[j].delete();
        }
      }
      sessionsFolder[i].delete();
    }
  }
  try {
    tempRootDirStr=tempDtEDir.getCanonicalPath();
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
/** 
 * @return temp root dir directory
 */
private void createTempRootDir(){
  if (tempRootDirStr != null && new File(tempRootDirStr).exists() == true)   return;
  String tempDirStr=System.getProperty("String_Node_Str");
  File tempDtEDir=new File(tempDirStr,"String_Node_Str");
  if (tempDtEDir.exists() == false) {
    tempDtEDir.mkdir();
  }
 else {
    File[] sessionsFolder=tempDtEDir.listFiles();
    for (int i=0; i < sessionsFolder.length; i++) {
      File[] oneSessionFolder=sessionsFolder[i].listFiles();
      for (int j=0; j < oneSessionFolder.length; j++) {
        if (oneSessionFolder[j].isDirectory()) {
          File[] oneSessionTempFiles=oneSessionFolder[j].listFiles();
          for (int k=0; k < oneSessionTempFiles.length; k++) {
            oneSessionTempFiles[k].delete();
          }
          oneSessionFolder[j].delete();
        }
 else {
          oneSessionFolder[j].delete();
        }
      }
      sessionsFolder[i].delete();
    }
  }
  try {
    tempRootDirStr=tempDtEDir.getCanonicalPath();
  }
 catch (  IOException e) {
  }
}
Program: 77330
Project: 77330
Buggy source:
/** 
 * Constructs a SubqueryDefn. A name must be provided that uniquely identifies the subquery within the report query that contains it.
 * @param name
 */
public SubqueryDefinition(String name){
  super(null);
  this.name=name;
  this.onGroup=true;
}

Fixed version (ground truth):
/** 
 * Constructs a SubqueryDefn. A name must be provided that uniquely identifies the subquery within the report query that contains it. The outer query (parent) can be another query, or a sub query.
 * @param name
 */
public SubqueryDefinition(String name,BaseQueryDefinition parent){
  super(parent);
  this.name=name;
  this.onGroup=true;
}
Program: 77331
Project: 77331
Buggy source:
private IExtractionResults extractByInstanceID(InstanceID iid) throws EngineException {
  DataID dataId=iid.getDataID();
  DataSetID dataSetId=dataId.getDataSetID();
  DataEngine dataEngine=executionContext.getDataEngine().getDataEngine();
  Scriptable scope=executionContext.getSharedScope();
  IResultIterator dataIter=null;
  try {
    dataIter=getResultSet(dataEngine,dataSetId,scope);
  }
 catch (  BirtException e) {
    e.printStackTrace();
    throw new EngineException("String_Node_Str",e);
  }
  IResultMetaData metaData=getMetaDateByInstanceID(iid);
  if (null != metaData) {
    return new ExtractionResults(dataIter,metaData,this.selectedColumns);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
private IExtractionResults extractByInstanceID(InstanceID iid) throws EngineException {
  DataID dataId=iid.getDataID();
  DataSetID dataSetId=dataId.getDataSetID();
  DataEngine dataEngine=executionContext.getDataEngine().getDataEngine();
  Scriptable scope=executionContext.getSharedScope();
  IResultIterator dataIter=null;
  IBaseQueryDefinition query=null;
  try {
    if (null == filterExpressions) {
      dataIter=getResultSetIterator(dataEngine,dataSetId,scope);
    }
 else {
      long id=iid.getComponentID();
      ReportItemDesign design=(ReportItemDesign)report.getReportItemByID(id);
      query=design.getQuery();
      if (null == query) {
        return null;
      }
      for (int iNum=0; iNum < filterExpressions.length; iNum++) {
        query.getFilters().add(filterExpressions[iNum]);
      }
      IBaseQueryDefinition rootQuery=query;
      while (rootQuery instanceof SubqueryDefinition) {
        rootQuery=rootQuery.getParentQuery();
      }
      QueryDefinition newRootQuery=queryCopy((QueryDefinition)rootQuery);
      HashMap queryIds=report.getQueryIDs();
      String queryId=(String)queryIds.get(rootQuery);
      String rsetId=queryId2rsetId(queryId);
      newRootQuery.setQueryResultsID(rsetId);
      IPreparedQuery preparedQuery=dataEngine.prepare(newRootQuery);
      IQueryResults rootResults=preparedQuery.execute(scope);
      dataIter=getFilterResultSetIterator(dataEngine,dataSetId,scope,rootResults);
    }
  }
 catch (  BirtException e) {
    e.printStackTrace();
    throw new EngineException("String_Node_Str",e);
  }
 finally {
    if (null != query) {
      for (int iNum=0; iNum < filterExpressions.length; iNum++) {
        query.getFilters().remove(filterExpressions[iNum]);
      }
      filterExpressions=null;
    }
  }
  IResultMetaData metaData=getMetaDateByInstanceID(iid);
  if (null != metaData) {
    return new ExtractionResults(dataIter,metaData,this.selectedColumns);
  }
 else {
    return null;
  }
}
Program: 77332
Project: 77332
Buggy source:
protected BaseQueryDefinition createSubQuery(ReportItemDesign item){
  BaseQueryDefinition query=null;
  IBaseTransform parentQuery=getTransform();
  if (parentQuery == null) {
    query=new QueryDefinition(getParentQuery());
    this.queryIDs.put(query,String.valueOf(item.getID()));
    this.queries.add(query);
    registerQueryAndElement(query,item);
  }
 else {
    String name=String.valueOf(item.getID());
    query=new SubqueryDefinition(name);
    parentQuery.getSubqueries().add(query);
    this.queryIDs.put(query,String.valueOf(item.getID()));
    registerQueryAndElement(query,item);
    String currentCondition=getCurrentCondition();
    if (currentCondition.equals(String.valueOf(true))) {
      ((SubqueryDefinition)query).setApplyOnGroupFlag(true);
    }
 else {
      ((SubqueryDefinition)query).setApplyOnGroupFlag(false);
    }
  }
  query.setMaxRows(maxRows);
  item.setQuery(query);
  if (item.getHandle() instanceof ReportItemHandle) {
    ReportItemHandle designHandle=(ReportItemHandle)item.getHandle();
    Iterator iter=designHandle.columnBindingsIterator();
    while (iter.hasNext()) {
      ComputedColumnHandle binding=(ComputedColumnHandle)iter.next();
      addColumBinding(query,binding);
    }
  }
  addSortAndFilter(item,query);
  ResultMetaData metaData=new ResultMetaData(query);
  resultMetaData.put(query,metaData);
  return query;
}

Fixed version (ground truth):
protected BaseQueryDefinition createSubQuery(ReportItemDesign item){
  BaseQueryDefinition query=null;
  IBaseTransform parentQuery=getTransform();
  if (parentQuery == null) {
    query=new QueryDefinition(getParentQuery());
    this.queryIDs.put(query,String.valueOf(item.getID()));
    this.queries.add(query);
    registerQueryAndElement(query,item);
  }
 else {
    String name=String.valueOf(item.getID());
    query=new SubqueryDefinition(name,getParentQuery());
    parentQuery.getSubqueries().add(query);
    this.queryIDs.put(query,String.valueOf(item.getID()));
    registerQueryAndElement(query,item);
    String currentCondition=getCurrentCondition();
    if (currentCondition.equals(String.valueOf(true))) {
      ((SubqueryDefinition)query).setApplyOnGroupFlag(true);
    }
 else {
      ((SubqueryDefinition)query).setApplyOnGroupFlag(false);
    }
  }
  query.setMaxRows(maxRows);
  item.setQuery(query);
  if (item.getHandle() instanceof ReportItemHandle) {
    ReportItemHandle designHandle=(ReportItemHandle)item.getHandle();
    Iterator iter=designHandle.columnBindingsIterator();
    while (iter.hasNext()) {
      ComputedColumnHandle binding=(ComputedColumnHandle)iter.next();
      addColumBinding(query,binding);
    }
  }
  addSortAndFilter(item,query);
  ResultMetaData metaData=new ResultMetaData(query);
  resultMetaData.put(query,metaData);
  return query;
}
Program: 77333
Project: 77333
Buggy source:
/** 
 * Check if the expression is a direct column reference type. If so, returns an instance of DirectColRefExpr that represents it; otherwise returns null.
 * @param parent
 * @param refNode
 * @param customerChecked
 * @return
 * @throws DataException
 */
abstract CompiledExpression compileDirectColRefExpr(Node parent,Node refNode,Node grandFather,boolean customerChecked,Context context) throws DataException ;

Fixed version (ground truth):
/** 
 * Check if the expression is a direct column reference type. If so, returns an instance of DirectColRefExpr that represents it; otherwise returns null.
 * @param parent
 * @param refNode
 * @param customerChecked
 * @return
 * @throws DataException
 */
protected abstract CompiledExpression compileDirectColRefExpr(Node parent,Node refNode,Node grandFather,boolean customerChecked,Context context) throws DataException ;
Program: 77334
Project: 77334
Buggy source:
/** 
 * Check the expression is an aggregate expression. If so, returns an instance of AggregateExpression, otherwise return null
 * @param context
 * @param parent
 * @param callNode
 * @return
 * @throws DataException
 */
abstract AggregateExpression compileAggregateExpr(Context context,Node parent,Node callNode) throws DataException ;

Fixed version (ground truth):
/** 
 * Check the expression is an aggregate expression. If so, returns an instance of AggregateExpression, otherwise return null
 * @param context
 * @param parent
 * @param callNode
 * @return
 * @throws DataException
 */
protected abstract AggregateExpression compileAggregateExpr(Context context,Node parent,Node callNode) throws DataException ;
Program: 77335
Project: 77335
Buggy source:
public boolean equals(Object other){
  if (other == null || !(other instanceof AggregateExpression))   return false;
  AggregateExpression expr2=(AggregateExpression)other;
  if (!aggregation.getName().equals(expr2.getAggregation().getName()))   return false;
  if (arguments.size() != expr2.getArguments().size())   return false;
  for (int i=0; i < arguments.size(); i++) {
    if (!arguments.get(i).equals(expr2.getArguments().get(i)))     return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean equals(Object other){
  if (other == null || !(other instanceof AggregateExpression))   return false;
  AggregateExpression expr2=(AggregateExpression)other;
  if (!aggregation.getName().equals(expr2.getAggregation().getName()))   return false;
  if (groupLevel != expr2.getGroupLevel())   return false;
  if (this.getCalculationLevel() != expr2.getCalculationLevel())   return false;
  if (arguments.size() != expr2.getArguments().size())   return false;
  for (int i=0; i < arguments.size(); i++) {
    if (!arguments.get(i).equals(expr2.getArguments().get(i)))     return false;
  }
  return true;
}
Program: 77336
Project: 77336
Buggy source:
AggregateExpression(IAggregation aggregation){
  logger.entering(AggregateExpression.class.getName(),"String_Node_Str");
  this.aggregation=aggregation;
  this.arguments=new ArrayList();
  logger.exiting(AggregateExpression.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
AggregateExpression(IAggregation aggregation){
  logger.entering(AggregateExpression.class.getName(),"String_Node_Str");
  this.aggregation=aggregation;
  this.arguments=new ArrayList();
  this.groupLevel=-1;
  logger.exiting(AggregateExpression.class.getName(),"String_Node_Str");
}
Program: 77337
Project: 77337
Buggy source:
/** 
 * Compares equivalency of two aggregate expressions
 * @param
 * @return
 */
public boolean equals(Object other){
  if (other == null || !(other instanceof AggregateObject))   return false;
  AggregateObject rhs=(AggregateObject)other;
  if (!aggregateExp.getAggregation().getName().equals(rhs.getAggregateExpr().getAggregation().getName()) || aggregateExp.getType() != rhs.getAggregateExpr().getType())   return false;
  List list1=this.getAggregateExpr().getArguments();
  List list2=rhs.getAggregateExpr().getArguments();
  if (list1 == null || list2 == null || list1.size() != list2.size())   return false;
 else {
    for (int i=0; i < list1.size(); i++) {
      if (!list1.get(i).equals(list2.get(i)))       return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Compares equivalency of two aggregate expressions
 * @param
 * @return
 */
public boolean equals(Object other){
  if (other == null || !(other instanceof AggregateObject))   return false;
  AggregateObject rhs=(AggregateObject)other;
  if (!aggregateExp.getAggregation().getName().equals(rhs.getAggregateExpr().getAggregation().getName()) || aggregateExp.getType() != rhs.getAggregateExpr().getType())   return false;
  if (!this.getAggregateExpr().equals(rhs.getAggregateExpr()))   return false;
  return true;
}
Program: 77338
Project: 77338
Buggy source:
/** 
 * Populate the AggregateTable instance using given AggregateObject. 
 * @param table
 * @param aggreObjList
 * @param groupLvl
 * @param aftergroup
 * @return
 * @throws DataException
 */
public static int populateAggregationTable(AggregateTable table,AggregateObject aggreObj,int groupLvl,boolean aftergroup,boolean isDetailedRow) throws DataException {
  Context cx=Context.enter();
  AggregateRegistry reg=table.getAggrRegistry(groupLvl,isDetailedRow,cx);
  try {
    return reg.register(aggreObj.getAggregateExpr());
  }
 catch (  DataException e) {
    throw e;
  }
 finally {
    Context.exit();
  }
}

Fixed version (ground truth):
/** 
 * Populate the AggregateTable instance using given AggregateObject. 
 * @param table
 * @param aggreObjList
 * @param groupLvl
 * @param aftergroup
 * @return
 * @throws DataException
 */
public static int populateAggregationTable(AggregateTable table,AggregateObject aggreObj,int groupLvl,int calculationLvl,boolean aftergroup,boolean isDetailedRow) throws DataException {
  Context cx=Context.enter();
  AggregateRegistry reg=table.getAggrRegistry(groupLvl,calculationLvl,isDetailedRow,cx);
  try {
    return reg.register(aggreObj.getAggregateExpr());
  }
 catch (  DataException e) {
    throw e;
  }
 finally {
    Context.exit();
  }
}
Program: 77339
Project: 77339
Buggy source:
int getType(){
  return CompiledExpression.TYPE_COMPLEX_EXPR;
}

Fixed version (ground truth):
/** 
 */
int getType(){
  return CompiledExpression.TYPE_COMPLEX_EXPR;
}
Program: 77340
Project: 77340
Buggy source:
CompiledExpression compileDirectColRefExpr(Node parent,Node refNode,Node grandFather,boolean customerChecked,Context context) throws DataException {
  assert(refNode.getType() == Token.GETPROP || refNode.getType() == Token.GETELEM);
  Node rowName=refNode.getFirstChild();
  assert(rowName != null);
  if (rowName.getType() != Token.NAME)   return null;
  String str=rowName.getString();
  assert(str != null);
  if (!str.equals(rowIndicator))   return null;
  Node rowColumn=rowName.getNext();
  assert(rowColumn != null);
  if (refNode.getType() == Token.GETPROP && rowColumn.getType() == Token.STRING) {
    if ("String_Node_Str".equals(rowColumn.getString()) || "String_Node_Str".equals(rowColumn.getString()) || "String_Node_Str".equals(rowColumn.getString()))     return null;
    return new ColumnReferenceExpression(getDataSetMode() ? STRING_ROW : STRING_DATASETROW,rowColumn.getString());
  }
  if (refNode.getType() == Token.GETELEM) {
    if (rowColumn.getType() == Token.NUMBER) {
      if (0 == rowColumn.getDouble())       return null;
      return new ColumnReferenceExpression(getDataSetMode() ? STRING_ROW : STRING_DATASETROW,(int)rowColumn.getDouble());
    }
 else     if (rowColumn.getType() == Token.STRING) {
      if ("String_Node_Str".equals(rowColumn.getString()))       return null;
      return new ColumnReferenceExpression(getDataSetMode() ? STRING_ROW : STRING_DATASETROW,rowColumn.getString());
    }
  }
  return null;
}

Fixed version (ground truth):
protected CompiledExpression compileDirectColRefExpr(Node parent,Node refNode,Node grandFather,boolean customerChecked,Context context) throws DataException {
  assert(refNode.getType() == Token.GETPROP || refNode.getType() == Token.GETELEM);
  Node rowName=refNode.getFirstChild();
  assert(rowName != null);
  if (rowName.getType() != Token.NAME)   return null;
  String str=rowName.getString();
  assert(str != null);
  if (!str.equals(rowIndicator))   return null;
  Node rowColumn=rowName.getNext();
  assert(rowColumn != null);
  if (refNode.getType() == Token.GETPROP && rowColumn.getType() == Token.STRING) {
    if ("String_Node_Str".equals(rowColumn.getString()) || "String_Node_Str".equals(rowColumn.getString()) || "String_Node_Str".equals(rowColumn.getString()))     return null;
    return new ColumnReferenceExpression(getDataSetMode() ? STRING_ROW : STRING_DATASETROW,rowColumn.getString());
  }
  if (refNode.getType() == Token.GETELEM) {
    if (rowColumn.getType() == Token.NUMBER) {
      if (0 == rowColumn.getDouble())       return null;
      return new ColumnReferenceExpression(getDataSetMode() ? STRING_ROW : STRING_DATASETROW,(int)rowColumn.getDouble());
    }
 else     if (rowColumn.getType() == Token.STRING) {
      if ("String_Node_Str".equals(rowColumn.getString()))       return null;
      return new ColumnReferenceExpression(getDataSetMode() ? STRING_ROW : STRING_DATASETROW,rowColumn.getString());
    }
  }
  return null;
}
Program: 77341
Project: 77341
Buggy source:
AggregateExpression compileAggregateExpr(Context context,Node parent,Node callNode) throws DataException {
  assert(callNode.getType() == Token.CALL);
  IAggregation aggregation=getAggregationFunction(callNode);
  if (aggregation == null)   return null;
  AggregateExpression aggregateExpression=new AggregateExpression(aggregation);
  extractArguments(context,aggregateExpression,callNode);
  replaceAggregateNode(aggregateExpression,parent,callNode);
  return aggregateExpression;
}

Fixed version (ground truth):
protected AggregateExpression compileAggregateExpr(Context context,Node parent,Node callNode) throws DataException {
  assert(callNode.getType() == Token.CALL);
  IAggregation aggregation=getAggregationFunction(callNode);
  if (aggregation == null)   return null;
  AggregateExpression aggregateExpression=new AggregateExpression(aggregation);
  extractArguments(context,aggregateExpression,callNode);
  replaceAggregateNode(aggregateExpression,parent,callNode);
  return aggregateExpression;
}
Program: 77342
Project: 77342
Buggy source:
/** 
 * Anything before do service.
 * @param request incoming http request
 * @param response http response
 * @exception ServletException
 * @exception IOException
 */
protected void doPreService(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  String format=ParameterAccessor.getFormat(request);
  if (IBirtConstants.SERVLET_PATH_DOWNLOAD.equalsIgnoreCase(request.getServletPath())) {
    response.setContentType("String_Node_Str");
    response.setHeader("String_Node_Str","String_Node_Str");
  }
 else   if (ParameterAccessor.PARAM_FORMAT_PDF.equalsIgnoreCase(format)) {
    response.setContentType("String_Node_Str");
    String filename=ParameterAccessor.generateFileName(request);
    response.setHeader("String_Node_Str","String_Node_Str" + filename + "String_Node_Str");
  }
 else {
    String mimeType=ReportEngineService.getInstance().getMIMEType(format);
    if (mimeType != null && mimeType.length() > 0)     response.setContentType(mimeType + "String_Node_Str");
 else     response.setContentType("String_Node_Str");
    response.setHeader("String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Anything before do service.
 * @param request incoming http request
 * @param response http response
 * @exception ServletException
 * @exception IOException
 */
protected void doPreService(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  String format=ParameterAccessor.getFormat(request);
  if (IBirtConstants.SERVLET_PATH_DOWNLOAD.equalsIgnoreCase(request.getServletPath())) {
    response.setContentType("String_Node_Str");
    response.setHeader("String_Node_Str","String_Node_Str");
  }
 else   if (ParameterAccessor.PARAM_FORMAT_PDF.equalsIgnoreCase(format)) {
    response.setContentType("String_Node_Str");
    String filename=ParameterAccessor.generateFileName(request);
    response.setHeader("String_Node_Str","String_Node_Str" + filename + "String_Node_Str");
  }
 else {
    String mimeType=ReportEngineService.getInstance().getMIMEType(format);
    if (mimeType != null && mimeType.length() > 0)     response.setContentType(mimeType);
 else     response.setContentType("String_Node_Str");
    response.setHeader("String_Node_Str","String_Node_Str");
  }
}
Program: 77343
Project: 77343
Buggy source:
/** 
 * Anything before do service.
 * @param request incoming http request
 * @param response http response
 * @exception ServletException
 * @exception IOException
 */
protected void doPreService(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  String format=ParameterAccessor.getFormat(request);
  if (ParameterAccessor.PARAM_FORMAT_PDF.equalsIgnoreCase(format)) {
    response.setContentType("String_Node_Str");
    String filename=ParameterAccessor.generateFileName(request);
    response.setHeader("String_Node_Str","String_Node_Str" + filename + "String_Node_Str");
  }
 else {
    String mimeType=ReportEngineService.getInstance().getMIMEType(format);
    if (mimeType != null && mimeType.length() > 0)     response.setContentType(mimeType + "String_Node_Str");
 else     response.setContentType("String_Node_Str");
    response.setHeader("String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Anything before do service.
 * @param request incoming http request
 * @param response http response
 * @exception ServletException
 * @exception IOException
 */
protected void doPreService(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  String format=ParameterAccessor.getFormat(request);
  if (ParameterAccessor.PARAM_FORMAT_PDF.equalsIgnoreCase(format)) {
    response.setContentType("String_Node_Str");
    String filename=ParameterAccessor.generateFileName(request);
    response.setHeader("String_Node_Str","String_Node_Str" + filename + "String_Node_Str");
  }
 else {
    String mimeType=ReportEngineService.getInstance().getMIMEType(format);
    if (mimeType != null && mimeType.length() > 0)     response.setContentType(mimeType);
 else     response.setContentType("String_Node_Str");
    response.setHeader("String_Node_Str","String_Node_Str");
  }
}
Program: 77344
Project: 77344
Buggy source:
private void createDrillthroughSelectFormat(Composite container){
  Group group=new Group(container,SWT.NONE);
  group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  group.setText(Messages.getString("String_Node_Str"));
  group.setLayout(new GridLayout());
  htmlButton=new Button(group,SWT.RADIO);
  htmlButton.setText(Messages.getString("String_Node_Str"));
  pdfButton=new Button(group,SWT.RADIO);
  pdfButton.setText(Messages.getString("String_Node_Str"));
}

Fixed version (ground truth):
private void createDrillthroughSelectFormat(Composite container){
  Group group=new Group(container,SWT.NONE);
  group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  group.setText(Messages.getString("String_Node_Str"));
  group.setLayout(new GridLayout());
  ReportEngine engine=new ReportEngine(new EngineConfig());
  supportedFormats=engine.getSupportedFormats();
  formatCheckBtns=new HashMap();
  for (int i=0; i < supportedFormats.length; i++) {
    Button btn=new Button(group,SWT.RADIO);
    if (supportedFormats.equals("String_Node_Str")) {
      btn.setText(Messages.getString("String_Node_Str"));
    }
 else     if (supportedFormats.equals("String_Node_Str")) {
      btn.setText(Messages.getString("String_Node_Str"));
    }
 else {
      btn.setText(supportedFormats[i]);
    }
    formatCheckBtns.put(supportedFormats[i],btn);
  }
}
Program: 77347
Project: 77347
Buggy source:
/** 
 * Anything before do service.
 * @param request incoming http request
 * @param response http response
 * @exception ServletException
 * @exception IOException
 */
protected void doPreService(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  String format=ParameterAccessor.getFormat(request);
  if (IBirtConstants.SERVLET_PATH_DOWNLOAD.equalsIgnoreCase(request.getServletPath())) {
    response.setContentType("String_Node_Str");
    response.setHeader("String_Node_Str","String_Node_Str");
  }
 else   if (ParameterAccessor.PARAM_FORMAT_PDF.equalsIgnoreCase(format)) {
    response.setContentType("String_Node_Str");
    String filename=ParameterAccessor.generateFileName(request);
    response.setHeader("String_Node_Str","String_Node_Str" + filename + "String_Node_Str");
  }
 else {
    String mimeType=ReportEngineService.getInstance().getMIMEType(format);
    if (mimeType != null && mimeType.length() > 0)     response.setContentType(mimeType);
 else     response.setContentType("String_Node_Str");
    response.setHeader("String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Anything before do service.
 * @param request incoming http request
 * @param response http response
 * @exception ServletException
 * @exception IOException
 */
protected void doPreService(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  String format=ParameterAccessor.getFormat(request);
  if (IBirtConstants.SERVLET_PATH_DOWNLOAD.equalsIgnoreCase(request.getServletPath())) {
    response.setContentType("String_Node_Str");
    response.setHeader("String_Node_Str","String_Node_Str");
  }
 else   if (ParameterAccessor.PARAM_FORMAT_PDF.equalsIgnoreCase(format)) {
    response.setContentType("String_Node_Str");
    String filename=ParameterAccessor.generateFileName(request);
    response.setHeader("String_Node_Str","String_Node_Str" + filename + "String_Node_Str");
  }
 else {
    String mimeType=ReportEngineService.getInstance().getMIMEType(format);
    if (mimeType != null && mimeType.length() > 0)     response.setContentType(mimeType);
 else     response.setContentType("String_Node_Str");
  }
}